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

Alexey Samsonov samsonov at google.com
Tue Feb 18 04:09:50 PST 2014


FYI I've disabled building ASan for iossim if -mmacosx-version-min is added
to CMAKE_CXX_FLAGS in r201566. Does this fix the build for you?
The problem comes from the fact that we automatically re-use build flags
specified for building LLVM/Clang when we build compiler-rt libraries.
I'm working on improving the situation here.


On Tue, Feb 18, 2014 at 3:57 PM, Alexander Potapenko <glider at google.com>wrote:

> 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
>



-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140218/3321f39a/attachment.html>


More information about the cfe-dev mailing list