I have an ios xcode project, that compile and running fine for simulator but failed to compile for device target.
I am trying to port a QT project to iOS and my project setup is quite complex. The desktop version is totally working fine and I didn't change any code except removed all UI related code.
I already file a bug report to apple (problem id:12103227) but just wondering anyone seen similar problem before?
I am using Xcode 4.4.1(4F1003) and Apple LLVM compiler 4.0
0 clang 0x00000001010536f2 main + 17107682
1 clang 0x0000000101053b79 main + 17108841
2 libsystem_c.dylib 0x00007fff8f08592a _sigtramp + 26
3 libsystem_c.dylib 000000000000000000 _sigtramp + 18446603338116474608
4 clang 0x0000000100e9e31f main + 15316751
5 clang 0x00000001002d9be3 main + 2977747
6 clang 0x000000010028061d main + 2611725
7 clang 0x0000000100280237 main + 2610727
8 clang 0x0000000100280168 main + 2610520
9 clang 0x00000001001e5bdf main + 1978319
10 clang 0x00000001001df8e4 main + 1952980
11 clang 0x00000001001df55e main + 1952078
12 clang 0x00000001001b8dff main + 1794543
13 clang 0x00000001001cf06b main + 1885275
14 clang 0x00000001001ca32d main + 1865501
15 clang 0x00000001001ca1f5 main + 1865189
16 clang 0x00000001001ca0dd main + 1864909
17 clang 0x0000000100197dfc main + 1659372
18 clang 0x000000010018a31d main + 1603341
19 clang 0x0000000100047606 main + 281078
20 clang 0x0000000100045bbe main + 274350
21 clang 0x0000000100044c01 main + 270321
22 clang 0x0000000100019ae2 main + 93906
23 clang 0x0000000100018748 main + 88888
24 clang 0x0000000100006438 main + 14376
25 clang 0x0000000100002e97 main + 647
26 clang 0x0000000100002c04
27 clang 0x00000000000000a3
Stack dump:
0. Program arguments: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -cc1 -triple thumbv7-apple-ios5.1.0 -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name clientplayer.cpp -pic-level 1 -mdisable-fp-elim -relaxed-aliasing -masm-verbose -target-abi apcs-gnu -target-cpu cortex-a8 -mfloat-abi soft -target-feature +soft-float-abi -target-linker-version 133.3 -g -coverage-file /Users/xiliangchen/Library/Developer/Xcode/DerivedData/QSanguosha-bpsvweybikzifuarrculsvqhjwqj/Build/Intermediates/QSanguosha-ios.build/Debug-iphoneos/QSanguosha-ios.build/Objects-normal/armv7/clientplayer.o -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.0 -dependency-file /Users/xiliangchen/Library/Developer/Xcode/DerivedData/QSanguosha-bpsvweybikzifuarrculsvqhjwqj/Build/Intermediates/QSanguosha-ios.build/Debug-iphoneos/QSanguosha-ios.build/Objects-normal/armv7/clientplayer.d -MT dependencies -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -iquote /Users/xiliangchen/Library/Developer/Xcode/DerivedData/QSanguosha-bpsvweybikzifuarrculsvqhjwqj/Build/Intermediates/QSanguosha-ios.build/Debug-iphoneos/QSanguosha-ios.build/QSanguosha-ios-generated-files.hmap -iquote /Users/xiliangchen/Library/Developer/Xcode/DerivedData/QSanguosha-bpsvweybikzifuarrculsvqhjwqj/Build/Intermediates/QSanguosha-ios.build/Debug-iphoneos/QSanguosha-ios.build/QSanguosha-ios-project-headers.hmap -D DEBUG=1 -D QT_GUI_LIB -D QT_NETWORK_LIB -D QT_CORE_LIB -D QT_SHARED -D Q_WS_IOS -I /Users/xiliangchen/Library/Developer/Xcode/DerivedData/QSanguosha-bpsvweybikzifuarrculsvqhjwqj/Build/Intermediates/QSanguosha-ios.build/Debug-iphoneos/QSanguosha-ios.build/QSanguosha-ios-own-target-headers.hmap -I /Users/xiliangchen/Library/Developer/Xcode/DerivedData/QSanguosha-bpsvweybikzifuarrculsvqhjwqj/Build/Intermediates/QSanguosha-ios.build/Debug-iphoneos/QSanguosha-ios.build/QSanguosha-ios-all-target-headers.hmap -I /Users/xiliangchen/Library/Developer/Xcode/DerivedData/QSanguosha-bpsvweybikzifuarrculsvqhjwqj/Build/Products/Debug-iphoneos/include -I ../../../QtSDK/Desktop/Qt/4.8.1/gcc/lib/QtCore.framework/Versions/4/Headers -I ../../../QtSDK/Desktop/Qt/4.8.1/gcc/include/QtCore -I ../../../QtSDK/Desktop/Qt/4.8.1/gcc/lib/QtNetwork.framework/Versions/4/Headers -I ../../../QtSDK/Desktop/Qt/4.8.1/gcc/include/QtNetwork -I ../../../QtSDK/Desktop/Qt/4.8.1/gcc/include -I include -I src/client -I src/core -I src/dialog -I src/package -I src/scenario -I src/server -I src/ui -I src/util -I src/lua -I src/jsoncpp/include -I include/freetype -I . -I /usr/local/include -I /System/Library/Frameworks/CarbonCore.framework/Headers -I ../../../QtSDK/Desktop/Qt/4.8.1/gcc/mkspecs/macx-xcode -I /Users/xiliangchen/Library/Developer/Xcode/DerivedData/QSanguosha-bpsvweybikzifuarrculsvqhjwqj/Build/Intermediates/QSanguosha-ios.build/Debug-iphoneos/QSanguosha-ios.build/DerivedSources/armv7 -I /Users/xiliangchen/Library/Developer/Xcode/DerivedData/QSanguosha-bpsvweybikzifuarrculsvqhjwqj/Build/Intermediates/QSanguosha-ios.build/Debug-iphoneos/QSanguosha-ios.build/DerivedSources -F/Users/xiliangchen/Library/Developer/Xcode/DerivedData/QSanguosha-bpsvweybikzifuarrculsvqhjwqj/Build/Products/Debug-iphoneos -F/Users/xiliangchen/QtSDK/Desktop/Qt/4.8.1/gcc/lib -F/Users/xiliangchen/QtSDK/Desktop/Qt/4.8.1/gcc/lib -F/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib -fmodule-cache-path /var/folders/9s/3z214w8n5vxdv_ycqss9t6jc0000gn/T/clang-module-cache -O0 -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Wreturn-type -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wuninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wno-sign-compare -Wno-shorten-64-to-32 -Wno-newline-eof -Wc++11-extensions -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -std=gnu++11 -fdeprecated-macro -ferror-limit 19 -fmessage-length 0 -mstackrealign -fblocks -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-runtime-has-terminate -fobjc-default-synthesize-properties -fcxx-exceptions -fexceptions -fsjlj-exceptions -fpascal-strings -fdiagnostics-show-option -serialize-diagnostic-file /Users/xiliangchen/Library/Developer/Xcode/DerivedData/QSanguosha-bpsvweybikzifuarrculsvqhjwqj/Build/Intermediates/QSanguosha-ios.build/Debug-iphoneos/QSanguosha-ios.build/Objects-normal/armv7/clientplayer.dia -o /Users/xiliangchen/Library/Developer/Xcode/DerivedData/QSanguosha-bpsvweybikzifuarrculsvqhjwqj/Build/Intermediates/QSanguosha-ios.build/Debug-iphoneos/QSanguosha-ios.build/Objects-normal/armv7/clientplayer.o -x c++ /Users/xiliangchen/Documents/project/QSanguosha/src/client/clientplayer.cpp
1. <eof> parser at end of file
2. Code generation
3. Running pass 'Function Pass Manager' on module '/Users/xiliangchen/Documents/project/QSanguosha/src/client/clientplayer.cpp'.
4. Running pass 'ARM Instruction Selection' on function '@_ZN15QBasicAtomicInt5derefEv'
clang: error: unable to execute command: Segmentation fault: 11
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://developer.apple.com/bugreporter/ and include command line arguments and all diagnostic information.
clang: note: diagnostic msg: Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /var/folders/9s/3z214w8n5vxdv_ycqss9t6jc0000gn/T/clientplayer-diYdeq.ii
clang: note: diagnostic msg: /var/folders/9s/3z214w8n5vxdv_ycqss9t6jc0000gn/T/clientplayer-diYdeq.sh
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 254
It turns out that the header file Qt used for atomic variable linked to ppc header instead of armv7. The ppc header contains some inline assembly code and crashed the cross compiler.