build fail with ios app
I build successful if I just use the commond xcodebuild
I build my ios app with command infer,but I got the error as follows: /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:16:1: error: expected identifier or '(' .text ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:212:1: error: unknown type name 'mov' mov r7, sp ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:212:15: error: expected ';' after top level declarator mov r7, sp ^ ; /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:251:1: error: unknown type name 'ldr' ldr r1, [sp, #16]; ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:251:14: error: use of undeclared identifier 'sp' ldr r1, [sp, #16]; ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:251:13: error: expected identifier or '(' ldr r1, [sp, #16]; ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:254:1: error: unknown type name 'mov' mov r2, sp ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:254:15: error: expected ';' after top level declarator mov r2, sp ^ ; 8 errors generated. clang -cc1as: error: error reading '/var/folders/yt/mcn2wbd112g1pyjcn84h4c3h0000gn/T/QHCrashAsyncThread_current-e9c334.s' Command /Users/selmazhang/workspace/infer-osx-v0.9.2/infer/lib/python/inferlib/../../../lib/xcode_wrappers/clang failed with exit code 1
** BUILD FAILED **
Could you paste the full output of infer please? Please use a paste site such as https://gist.github.com/.
Could you try applying the following diff and running infer again to see if it fixes your issue? Thanks!
https://gist.github.com/jvillard/5fd9b9dc32a402aa5347edc5d327f45b
please tell me what can I do
The all information that I can give is : I build successful if I just use the commond xcodebuild I build my ios app with command infer,but I got the error as follows: /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:16:1: error: expected identifier or '(' .text ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:212:1: error: unknown type name 'mov' mov r7, sp ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:212:15: error: expected ';' after top level declarator mov r7, sp ^ ; /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:251:1: error: unknown type name 'ldr' ldr r1, [sp, #16]; ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:251:14: error: use of undeclared identifier 'sp' ldr r1, [sp, #16]; ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:251:13: error: expected identifier or '(' ldr r1, [sp, #16]; ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:254:1: error: unknown type name 'mov' mov r2, sp ^ /Users/selmazhang/workspace/house_ios_codeCheck/src/Classes/Crash/Base/QHCrashAsyncThread_current.S:254:15: error: expected ';' after top level declarator mov r2, sp ^ ; 8 errors generated. clang -cc1as: error: error reading '/var/folders/yt/mcn2wbd112g1pyjcn84h4c3h0000gn/T/QHCrashAsyncThread_current-e9c334.s' Command /Users/selmazhang/workspace/infer-osx-v0.9.2/infer/lib/python/inferlib/../../../lib/xcode_wrappers/clang failed with exit code 1
** BUILD FAILED **
I do not change anything about infer
What I meant was: What happens if you replace infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh with this: https://gist.github.com/jvillard/9649b78fff071179509cd2dc2a254680 ?
I replace infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh with this: https://gist.github.com/jvillard/9649b78fff071179509cd2dc2a254680 It seems I got the same errors. This is the all output 1.txt
I looked at full output and it seems that infer is failing to build code in assembler-with-cpp language. I'll try to play with some small examples to see if infer works at all with assembler-with-cpp, but I suspect issue may be hidden further.
@zhangying19871987 It would greatly help me to debug issue sooner if I could get my hands on standalone repro. It'd be great if you could run following command and upload result. The output may be pretty large: https://gist.github.com/akotulski/1889f58356837730bd2a9a6b91f7c652
Is the code in QNCore/QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/x86/darwin64_x86_64.S same as in https://github.com/bang590/JSPatch?
I couldn't reproduce the issue on small example (file that failed to compile and is coming from https://github.com/bang590/JSPatch) - it compiles fine for me. For posteriority, this is what I ran:
infer -- clang -x assembler-with-cpp -arch armv7 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -fmodules -gmodules -fpascal-strings -O0 -fno-common -DDEBUG=1 -isysroot /Applications/Xcode7.2.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk -fstrict-aliasing -c darwin64_x86_64.S -I ../../headers/
I run following command and the result is
And I can give you the file QNCore/QNCore/QNCrashGuard/3rd/JSPatch/Extensions/JPCFunction/libffi/src/x86/darwin64_x86_64.S
I have another app, I replace infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh with this: https://gist.github.com/jvillard/9649b78fff071179509cd2dc2a254680
I build successful if I just use the commond xcodebuild If I build my ios app with command infer, I got the error as follows: 1.txt
I believe I managed to reproduce similar problem and fix it in https://github.com/facebook/infer/commit/0817ab0ec221d97c6685e0f22f88c967b2b471df
To quickly test the change, could you replace infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh with version from master?
https://github.com/facebook/infer/blob/0817ab0ec221d97c6685e0f22f88c967b2b471df/infer/lib/clang_wrappers/hijack_and_normalize_clang_command.sh
It was fixed this issue. Thanks a lot.
Infer 0.9.3 has been released, please try and reopen this issue if the problem remains.