On Tue, Feb 5, 2013 at 12:38 PM, Kostya Serebryany <kcc at google.com> wrote:> +samsonov, glider > > > On Tue, Feb 5, 2013 at 12:16 PM, Chandler Carruth <chandlerc at google.com>wrote: > >> On Mon, Feb 4, 2013 at 6:21 AM, Erik Verbruggen <erik.verbruggen at me.com>wrote: >> >>> Hi Chandler, >>> >>> If I remember correctly, you are the de-facto maintainer for the >>> CMake-built-mainainer, so..: >>> >> >> Sure, but I'm often busy. You're better off using the development mailing >> list for questions such as this, and I've moved the conversation there. >> >> >>> I have a problem compiling compiler-rt on MacOS with libc++. For this to >>> work, the flag -mmacosx-version-min=10.7 is required, so I use: >>> CMAKE_CXX_FLAGS:STRING=-mmacosx-version-min=10.7 -stdlib=libc++ >>> >>> However, around line 140, the CMakeLists.txt of compiler-rt contains: >>> if(APPLE) >>> list(APPEND SANITIZER_COMMON_CFLAGS -mmacosx-version-min=10.5) >>> endif() >>> >>> Now, when building with clang, the minimal minimal version is used, so >>> 10.5, which results in a compiler error complaining that the minimal >>> version should be 10.7. >>> >>> My question: could you please add some CMake logic to the compiler-rt >>> CMakeLists.txt to check if there is already a macosx-version-min flag set, >>> or to not include the flag if -stdlib=libc++ is set? >>> >>Hi Erik, IIRC, using -stdlib=libc++ on Mac should also require presence of flag -mmacosx-version-min? If that's the case, then probably we can put the logic of determining the set of flags required for libc++ into CMake build rules and use CMake variable like COMPILER_RT_USES_LIBCXX. Does the attached patch solve a problem for you? If you're building LLVM/Clang tree, however, we may want to hoist this to smth. like LLVM_USES_LIBCXX.> >> I don't know the specific needs of either libc++ or the sanitizer on mac; >> instead this should be answered by one of the folks actively working on >> that area. There are several on the list that can likely help. >> >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> >> >-- Alexey Samsonov, MSK -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130205/67115469/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: zpatch.macosx_version Type: application/octet-stream Size: 1433 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130205/67115469/attachment.obj>
On Feb 5, 2013, at 15:14, Alexey Samsonov <samsonov at google.com> wrote:> > On Tue, Feb 5, 2013 at 12:38 PM, Kostya Serebryany <kcc at google.com> wrote: > +samsonov, glider > > > On Tue, Feb 5, 2013 at 12:16 PM, Chandler Carruth <chandlerc at google.com> wrote: > On Mon, Feb 4, 2013 at 6:21 AM, Erik Verbruggen <erik.verbruggen at me.com> wrote: > Hi Chandler, > > If I remember correctly, you are the de-facto maintainer for the CMake-built-mainainer, so..: > > Sure, but I'm often busy. You're better off using the development mailing list for questions such as this, and I've moved the conversation there. > > I have a problem compiling compiler-rt on MacOS with libc++. For this to work, the flag -mmacosx-version-min=10.7 is required, so I use: > CMAKE_CXX_FLAGS:STRING=-mmacosx-version-min=10.7 -stdlib=libc++ > > However, around line 140, the CMakeLists.txt of compiler-rt contains: > if(APPLE) > list(APPEND SANITIZER_COMMON_CFLAGS -mmacosx-version-min=10.5) > endif() > > Now, when building with clang, the minimal minimal version is used, so 10.5, which results in a compiler error complaining that the minimal version should be 10.7. > > My question: could you please add some CMake logic to the compiler-rt CMakeLists.txt to check if there is already a macosx-version-min flag set, or to not include the flag if -stdlib=libc++ is set? > > Hi Erik, > IIRC, using -stdlib=libc++ on Mac should also require presence of flag -mmacosx-version-min? If that's the case, then probably we can put the logic > of determining the set of flags required for libc++ into CMake build rules and use CMake variable like COMPILER_RT_USES_LIBCXX. Does the attached > patch solve a problem for you? If you're building LLVM/Clang tree, however, we may want to hoist this to smth. like LLVM_USES_LIBCXX.Yes, that works, when I (manually) set the COMPILER_RT_USES_LIBCXX flag. I was wondering if that flag could actually be set when detecting the -stdlib=libc++ flag... -- Erik. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130207/394d2fb6/attachment.html>
On Fri, Feb 8, 2013 at 1:08 AM, Erik Verbruggen <erik.verbruggen at me.com>wrote:> > On Feb 5, 2013, at 15:14, Alexey Samsonov <samsonov at google.com> wrote: > > > On Tue, Feb 5, 2013 at 12:38 PM, Kostya Serebryany <kcc at google.com> wrote: > >> +samsonov, glider >> >> >> On Tue, Feb 5, 2013 at 12:16 PM, Chandler Carruth <chandlerc at google.com>wrote: >> >>> On Mon, Feb 4, 2013 at 6:21 AM, Erik Verbruggen <erik.verbruggen at me.com>wrote: >>> >>>> Hi Chandler, >>>> >>>> If I remember correctly, you are the de-facto maintainer for the >>>> CMake-built-mainainer, so..: >>>> >>> >>> Sure, but I'm often busy. You're better off using the development >>> mailing list for questions such as this, and I've moved the conversation >>> there. >>> >>> >>>> I have a problem compiling compiler-rt on MacOS with libc++. For this >>>> to work, the flag -mmacosx-version-min=10.7 is required, so I use: >>>> CMAKE_CXX_FLAGS:STRING=-mmacosx-version-min=10.7 -stdlib=libc++ >>>> >>>> However, around line 140, the CMakeLists.txt of compiler-rt contains: >>>> if(APPLE) >>>> list(APPEND SANITIZER_COMMON_CFLAGS -mmacosx-version-min=10.5) >>>> endif() >>>> >>>> Now, when building with clang, the minimal minimal version is used, so >>>> 10.5, which results in a compiler error complaining that the minimal >>>> version should be 10.7. >>>> >>>> My question: could you please add some CMake logic to the compiler-rt >>>> CMakeLists.txt to check if there is already a macosx-version-min flag set, >>>> or to not include the flag if -stdlib=libc++ is set? >>>> >>> > Hi Erik, > IIRC, using -stdlib=libc++ on Mac should also require presence of flag > -mmacosx-version-min? If that's the case, then probably we can put the logic > of determining the set of flags required for libc++ into CMake build rules > and use CMake variable like COMPILER_RT_USES_LIBCXX. Does the attached > patch solve a problem for you? If you're building LLVM/Clang tree, > however, we may want to hoist this to smth. like LLVM_USES_LIBCXX. > > > Yes, that works, when I (manually) set the COMPILER_RT_USES_LIBCXX flag. I > was wondering if that flag could actually be set when detecting the > -stdlib=libc++ flag... >r174699 should do this.> > -- Erik. > >-- Alexey Samsonov, MSK -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130208/adb3bd6b/attachment.html>