[cfe-dev] CMake/Xcode build fails trying to build asan
Alexander Potapenko
glider at google.com
Tue Feb 18 03:57:58 PST 2014
We're basically cross-compiling the iOS simulator version of ASan
runtime here, so supplying an additional -mmacosx-version flag sounds
a wrong thing to do.
If it isn't possible to avoid setting this flag for the iossim builds,
we can just disable building the iossim runtime if
-mmacosx-version-min is present in OTHER_CFLAGS.
But I'm not sure that's what you want.
On Tue, Feb 18, 2014 at 10:37 AM, Kyle Sluder <kyle at ksluder.com> wrote:
> [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
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
--
Alexander Potapenko
Software Engineer
Google Moscow
More information about the cfe-dev
mailing list