7

After update xcode to 4.5 version I have an error

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

I read about error like this after update, but changing the architecture in target's builds settings doesn't help. It's work on simulator but not on device.

The whole error

CompileC /Users/psitkowski/Library/Developer/Xcode/DerivedData/Jasiu2-gskaidiujznurtdqnebvtogjtdnd/Build/Intermediates/Jasiu2.build/Debug-iphoneos/Jasiu2.build/Objects-normal/armv7/maxvid_decode_arm.o Classes/AVAnimator/maxvid_decode_arm.s normal armv7 assembler-with-cpp com.apple.compilers.llvm.clang.1_0.compiler cd /Users/psitkowski/Xcode/ksiazki/kopie/Jasiu2 setenv LANG en_US.US-ASCII setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x assembler-with-cpp -arch armv7 -fmessage-length=0 -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-shorten-64-to-32 -Wno-newline-eof -DDEBUG=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk -Wdeprecated-declarations -g -Wno-sign-conversion -miphoneos-version-min=5.1 -iquote /Users/psitkowski/Library/Developer/Xcode/DerivedData/Jasiu2-gskaidiujznurtdqnebvtogjtdnd/Build/Intermediates/Jasiu2.build/Debug-iphoneos/Jasiu2.build/Jasiu2-generated-files.hmap -I/Users/psitkowski/Library/Developer/Xcode/DerivedData/Jasiu2-gskaidiujznurtdqnebvtogjtdnd/Build/Intermediates/Jasiu2.build/Debug-iphoneos/Jasiu2.build/Jasiu2-own-target-headers.hmap -I/Users/psitkowski/Library/Developer/Xcode/DerivedData/Jasiu2-gskaidiujznurtdqnebvtogjtdnd/Build/Intermediates/Jasiu2.build/Debug-iphoneos/Jasiu2.build/Jasiu2-all-target-headers.hmap -iquote /Users/psitkowski/Library/Developer/Xcode/DerivedData/Jasiu2-gskaidiujznurtdqnebvtogjtdnd/Build/Intermediates/Jasiu2.build/Debug-iphoneos/Jasiu2.build/Jasiu2-project-headers.hmap -I/Users/psitkowski/Library/Developer/Xcode/DerivedData/Jasiu2-gskaidiujznurtdqnebvtogjtdnd/Build/Products/Debug-iphoneos/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/psitkowski/Library/Developer/Xcode/DerivedData/Jasiu2-gskaidiujznurtdqnebvtogjtdnd/Build/Intermediates/Jasiu2.build/Debug-iphoneos/Jasiu2.build/DerivedSources/armv7 -I/Users/psitkowski/Library/Developer/Xcode/DerivedData/Jasiu2-gskaidiujznurtdqnebvtogjtdnd/Build/Intermediates/Jasiu2.build/Debug-iphoneos/Jasiu2.build/DerivedSources -F/Users/psitkowski/Library/Developer/Xcode/DerivedData/Jasiu2-gskaidiujznurtdqnebvtogjtdnd/Build/Products/Debug-iphoneos -MMD -MT dependencies -MF /Users/psitkowski/Library/Developer/Xcode/DerivedData/Jasiu2-gskaidiujznurtdqnebvtogjtdnd/Build/Intermediates/Jasiu2.build/Debug-iphoneos/Jasiu2.build/Objects-normal/armv7/maxvid_decode_arm.d --serialize-diagnostics /Users/psitkowski/Library/Developer/Xcode/DerivedData/Jasiu2-gskaidiujznurtdqnebvtogjtdnd/Build/Intermediates/Jasiu2.build/Debug-iphoneos/Jasiu2.build/Objects-normal/armv7/maxvid_decode_arm.dia -c /Users/psitkowski/Xcode/ksiazki/kopie/Jasiu2/Classes/AVAnimator/maxvid_decode_arm.s -o /Users/psitkowski/Library/Developer/Xcode/DerivedData/Jasiu2-gskaidiujznurtdqnebvtogjtdnd/Build/Intermediates/Jasiu2.build/Debug-iphoneos/Jasiu2.build/Objects-normal/armv7/maxvid_decode_arm.o

/Users/psitkowski/Xcode/ksiazki/kopie/Jasiu2/Classes/AVAnimator/maxvid_decode_arm.s:65:2: error: invalid instruction strneh r8, [r10], #2 ^

... About 100 lines like above ... /Users/psitkowski/Xcode/ksiazki/kopie/Jasiu2/Classes/AVAnimator/maxvid_decode_arm.s:474:2: error: invalid instruction stmeqia r10!, {r0, r1} ^ Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

I have a error like this before, when I forgot add libz.dylib in build phases. Have you got any idea how to fix it?

Thanks a lot,

user1595102
  • 127
  • 2
  • 8

3 Answers3

9

Yes, Xcode 4.5 has made some changes that break compilation of ASM code. There fix is easy, just add the -no-integrated-as flag to the compilation options for the maxvid_decode_arm.s file in AVAnimator.

Like so:

Choose the project file in the left window that lists files (it is the one at the top with the blue icon).

Select your Target in the "TARGETS" list.

Select the "Build Phases" Tab.

Double click on maxvid_decode_arm.s, then add -no-integrated-as by pasting into the list that comes up.

MoDJ
  • 4,309
  • 2
  • 30
  • 65
  • 1
    Thanks - this really helped: for google, we needed to add this to JScocoa as well – Blitz Oct 27 '12 at 17:45
  • maxvid_decode_arm.s i can't this keyword in xcode 4.5 in build Phases tab – Raju Nov 22 '12 at 10:28
  • maxvid_decode_arm.s is the name of a specific .s ARM ASM file in the target list. If you are having this compilation problem in your own project that includes ARM ASM code, then choose the specific .s file in your project and then add this -no-integrated-as. – MoDJ Nov 24 '12 at 21:21
1

The error is quite clear - two assembler instructions in max_vid_decode.s are not properly formatted:

strneh r8, [r10], #2
stmeqia r10!, {r0, r1}

Probably the assembler spec has tightened, and code that was slightly non-compliant worked previously. Find the armv7 assembler document and read up on these two commands, and make them compliant.

David H
  • 40,852
  • 12
  • 92
  • 138
  • I did a mistake in writting tread, because I don't copy whole error but almost whole. I miss the line like this >/Users/psitkowski/Xcode/ksiazki/kopie/Jasiu2/Classes/AVAnimator/maxvid_decode_arm.s:65:2: error: invalid instruction strneh r8, [r10], #2 ^ beacuse compiler see mistakes in every instructions – user1595102 Oct 08 '12 at 11:53
  • 1
    You really need to completely restructure this question. I believe what you are saying would have a title like "Xcode4.5 assembler fails to compile files that Xcode4.4 handled perfectly". I suggest you also post this on the Apple Xcode listserv. – David H Oct 08 '12 at 14:34
0

Found this in Workflow for writing ARM assembly code on the iphone. Actually I think i'ts the developer who answered it

add -no-integrated-as in your compiler flags in buildphases.

Community
  • 1
  • 1
yeahdixon
  • 6,647
  • 1
  • 41
  • 43