Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode4.5 assembler fails to compile files that Xcode4.4 handled perfectly

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,

like image 414
user1595102 Avatar asked Oct 08 '12 10:10

user1595102


2 Answers

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.

like image 79
MoDJ Avatar answered Nov 09 '22 11:11

MoDJ


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.

like image 24
David H Avatar answered Nov 09 '22 12:11

David H