[cfe-dev] CMake/Xcode build fails trying to build asan

Kyle Sluder kyle at ksluder.com
Mon Feb 17 22:37:07 PST 2014


[resending to cfe-dev since this is a compiler-rt/asan issue]

I checked out llvm, clang, and compiler-rt, then ran the following
command to generate an Xcode project:

% cmake -G "Xcode" /Users/Shared/objc-namespaces/llvm
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX=/Users/Shared/objc-namespaces/llvm/DstRoot
-DLLVM_TARGETS_TO_BUILD="X86"

I opened the resulting LLVM.xcodeproj and tried to build the default
ALL_BUILD target. It failed while trying to build asan:

clang: error: invalid argument '-mmacosx-version-min=10.9' not allowed
with '-mios-simulator-version-min=7.0'
Command
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
failed with exit code 1

Inspecting the entire build command reveals that there are two -isysroot
flags, one specifying the OS X 10.9 SDK and another specifying the iOS
simulator SDK. Since AFAICT, asan tries to specify a minimum deployment
target of 10.7 when building for OS X, I think it's pretty certain that
the first -mmacosx-version-min flag (and its -isysroot companion) are
coming from Xcode's default project settings.

Is it possible to convince CMake to add overrides of the relevant build
settings in the xcodeproj rather than trying to stuff everything into
$(OTHER_CFLAGS)?

--Kyle Sluder



More information about the cfe-dev mailing list