so im having a linker error while building an xcode project when using scan-build
for my normal xcodebuild command i use the following
xcodebuild -target LibCoreMobileGHUnit -configuration Debug -sdk iphonesimulator5.0 clean build
and it uses the following options for the linker phase
"/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld"
-demangle
-dynamic
-arch i386
-all_load
-ios_simulator_version_min 5.0.0
-syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
-ObjC
-o /Users/ops/workspace/MobileFramework_Test_IOS_Client/LibCoreMobile/build/Debug-iphonesimulator/LibCoreMobileGHUnit.app/LibCoreMobileGHUnit
-lcrt1.o
-L/Users/ops/workspace/MobileFramework_Test_IOS_Client/LibCoreMobile/build/Debug-iphonesimulator
-filelist /Users/ops/workspace/MobileFramework_Test_IOS_Client/LibCoreMobile/build/LibCoreMobile.build/Debug-iphonesimulator/LibCoreMobileGHUnit.build/Objects-normal/i386/LibCoreMobileGHUnit.LinkFileList
-objc_abi_version 2
-no_implicit_dylibs
-lz
-framework QuartzCore
-framework UIKit
-framework Foundation
-framework CoreGraphics
-framework GHUnitIOS
-force_load /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a
-framework Foundation
-lobjc
-lc++ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.1/lib/darwin/libclang_rt.profile_ios.a
-lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.1/lib/darwin/libclang_rt.ios.a
-F/Users/ops/workspace/MobileFramework_Test_IOS_Client/LibCoreMobile/build/Debug-iphonesimulator
-F/Applications/Xcode.app/Contents/Developer/Library/Frameworks
-F/Users/ops/workspace/MobileFramework_Test_IOS_Client/LibCoreMobile/LibCoreMobileGHUnit
-F/Users/ops/workspace/MobileFramework_Test_IOS_Client/LibCoreMobile/ExternalFrameworks
and this is sucessfull
however when I run the following
scan-build -k -v -v -o ../clangScanBuildReports xcodebuild -target LibCoreMobileGHUnit -configuration Debug -sdk iphonesimulator5.0 clean build
it links with the following options:
"/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld"
-dynamic
-arch i386
-all_load
-ios_simulator_version_min 5.0.0
-syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk
-ObjC
-o /Users/ops/workspace/MobileFramework_Test_IOS_Client/LibCoreMobile/build/Debug-iphonesimulator/LibCoreMobileGHUnit.app/LibCoreMobileGHUnit
-lcrt1.o
-L/Users/ops/workspace/MobileFramework_Test_IOS_Client/LibCoreMobile/build/Debug-iphonesimulator
-filelist /Users/ops/workspace/MobileFramework_Test_IOS_Client/LibCoreMobile/build/LibCoreMobile.build/Debug-iphonesimulator/LibCoreMobileGHUnit.build/Objects-normal/i386/LibCoreMobileGHUnit.LinkFileList
-objc_abi_version 2
-no_implicit_dylibs
-lz
-framework QuartzCore
-framework UIKit
-framework Foundation
-framework CoreGraphics
-framework GHUnitIOS
-force_load /Users/ops/tools/checker-269/lib/arc/libarclite_iphonesimulator.a
-framework Foundation
-lobjc
-lc++
-lSystem
-F/Users/ops/workspace/MobileFramework_Test_IOS_Client/LibCoreMobile/build/Debug-iphonesimulator
-F/Applications/Xcode.app/Contents/Developer/Library/Frameworks
-F/Users/ops/workspace/MobileFramework_Test_IOS_Client/LibCoreMobile/LibCoreMobileGHUnit
-F/Users/ops/workspace/MobileFramework_Test_IOS_Client/LibCoreMobile/ExternalFrameworks
so theres a few things here that are different when running scan-build it seems to be using a different linker /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld vs /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
in the normal xcodebuild it has an extra option -demangle and in the scan-build it is missing the two libclang libs
-lc++ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.1/lib/darwin/libclang_rt.profile_ios.a
-lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/4.1/lib/darwin/libclang_rt.ios.a
Does anyone know how i could force the libaries to be included in the linker flags on the "scan-build" execution.