infer icon indicating copy to clipboard operation
infer copied to clipboard

build fail with ios app

Open zhangying19871987 opened this issue 10 years ago • 12 comments

The infer version I used is V0.9.2. when I execute infer -- xcodebuild -workspace QQNews.xcworkspace -scheme QQNews -configuration Debug -sdk iphoneos I met the error clang -cc1as: error: error reading '/var/folders/yt/mcn2wbd112g1pyjcn84h4c3h0000gn/T/darwin64_x86_64-c68750.s'

zhangying19871987 avatar Aug 25 '16 09:08 zhangying19871987

Thanks for the report @zhangying19871987

Could you edit this line to change

if [ "$1" = "-cc1" ]; then

to

if [ "$1" = "-cc1" ] || [ "$1" = "-cc1as" ]; then

and report back?

jvillard avatar Aug 26 '16 01:08 jvillard

After I edit the line, I got the same error as follows:

clang -cc1as: error: error reading '/var/folders/yt/mcn2wbd112g1pyjcn84h4c3h0000gn/T/darwin64_x86_64-08684d.s' Command /Users/selmazhang/workspace/infer-osx-v0.9.2/infer/lib/python/inferlib/../../../lib/xcode_wrappers/clang failed wi th exit code 1 ** BUILD FAILED **

The following build commands failed: CompileC /Users/selmazhang/Library/Developer/Xcode/DerivedData/QQNews-dzxfdpizqronydacwqerxzqgevkb/Build/Intermediates/QNCore.build/Debug-iphoneos/QNCore.build/Objects-normal/armv7/darwin64_x86_64.o QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/x86/darwin64_x86_64.S normal armv7 assembler-with-cpp com.apple.compilers.llvm.clang.1_0.compiler (1 failure)

zhangying19871987 avatar Aug 29 '16 03:08 zhangying19871987

which version of xcode are you using (you can run xcodebuild -version to find out)?

akotulski avatar Aug 29 '16 09:08 akotulski

Xcode 7.3 Build version 7D175

zhangying19871987 avatar Aug 30 '16 01:08 zhangying19871987

I comment the line in infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh I change the line

sed -e "s#^[[:space:]]"([^"])" "-cc1" (.)$# "$CLANG_CC1_CAPTURE" "-cc1" \2#g" | \

to

#sed -e "s#^[[:space:]]"([^"])" "-cc1" (.)$# "$CLANG_CC1_CAPTURE" "-cc1" \2#g" | \

My ios app build success, but I got the print Analyzed 0 files

No issues found

So, I guess I cannot do this.

zhangying19871987 avatar Aug 30 '16 03:08 zhangying19871987

Could you paste the full output of infer prior to the changes please? Please use a paste site such as https://gist.github.com/.

jvillard avatar Aug 30 '16 18:08 jvillard

You could also try not executing -cc1as commands by inserting this line right after the sed line that you commented out (but uncomment the sed line as well):

        grep -v "\"-cc1as\"" | \

jvillard avatar Aug 30 '16 18:08 jvillard

More precisely, could try to apply this diff? Thanks!

https://gist.github.com/jvillard/5fd9b9dc32a402aa5347edc5d327f45b

jvillard avatar Aug 31 '16 01:08 jvillard

The problem is I got the error when I compile my ios project

clang -cc1as: error: error reading '/var/folders/yt/mcn2wbd112g1pyjcn84h4c3h0000gn/T/darwin64_x86_64-08684d.s' Command /Users/selmazhang/workspace/infer-osx-v0.9.2/infer/lib/python/inferlib/../../../lib/xcode_wrappers/clang failed wi th exit code 1 ** BUILD FAILED **

The following build commands failed: CompileC /Users/selmazhang/Library/Developer/Xcode/DerivedData/QQNews-dzxfdpizqronydacwqerxzqgevkb/Build/Intermediates/QNCore.build/Debug-iphoneos/QNCore.build/Objects-normal/armv7/darwin64_x86_64.o QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/x86/darwin64_x86_64.S normal armv7 assembler-with-cpp com.apple.compilers.llvm.clang.1_0.compiler (1 failure)

I do not change anything about infer except that change

if [ "$1" = "-cc1" ]; then to

if [ "$1" = "-cc1" ] || [ "$1" = "-cc1as" ]; then

Please tell me what shall I do ?

zhangying19871987 avatar Aug 31 '16 03:08 zhangying19871987

I try not executing -cc1as commands by inserting this line right after the sed line

    grep -v "\"-cc1as\"" | \

and I got error as well:

/Users/selmazhang/workspace/news_ios_codeCheck/QNCore/QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/ar m/trampoline_armv7.S:3:1: error: expected identifier or '('

GENERATED CODE - DO NOT EDIT

^ /Users/selmazhang/workspace/news_ios_codeCheck/QNCore/QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/ar m/trampoline_armv7.S:41:5: error: unknown type name 'ldr' ldr r0, [pc, #-4092] ^ /Users/selmazhang/workspace/news_ios_codeCheck/QNCore/QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/ar m/trampoline_armv7.S:41:14: error: use of undeclared identifier 'pc' ldr r0, [pc, #-4092] ^ /Users/selmazhang/workspace/news_ios_codeCheck/QNCore/QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/ar m/trampoline_armv7.S:44:8: error: expected ';' after top level declarator ldr pc, [pc, #-4092] ^ ; 4 errors generated. Command /Users/selmazhang/workspace/infer-osx-v0.9.2/infer/lib/python/inferlib/../../../lib/xcode_wrappers/clang failed wi th exit code 1

** BUILD FAILED **

The following build commands failed: CompileC /Users/selmazhang/Library/Developer/Xcode/DerivedData/QQNews-dzxfdpizqronydacwqerxzqgevkb/Build/Intermediates/QNCore.build/Debug-iphoneos/QNCore.build/Objects-normal/armv7/trampoline_armv7.o QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/arm/trampoline_armv7.S normal armv7 assembler-with-cpp com.apple.compilers.llvm.clang.1_0.compiler

zhangying19871987 avatar Aug 31 '16 04:08 zhangying19871987

It was fixed this issue. Thanks a lot.

zhangying19871987 avatar Sep 12 '16 10:09 zhangying19871987

Infer 0.9.3 has been released, please try and reopen this issue if the problem remains.

jberdine avatar Sep 22 '16 15:09 jberdine