[llvm-dev] "-stdlib=libc++" applied to CMAKE_CXX_FLAGS

Brian Cain via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 18 11:22:50 PST 2016


Hmm, so it does: HSOpts.UseLibcxx.  My mistake.

 

-Brian

 

From: jordan_rose at apple.com [mailto:jordan_rose at apple.com] 
Sent: Friday, November 18, 2016 12:59 PM
To: Brian Cain <bcain at codeaurora.org>
Cc: llvm-dev <llvm-dev at lists.llvm.org>
Subject: Re: [llvm-dev] "-stdlib=libc++" applied to CMAKE_CXX_FLAGS

 

Doesn't this control search paths as well? It's only because you're specifying -nostdinc++ that it's going unused for you.

 

Jordan

 

 

On Nov 18, 2016, at 10:50, Brian Cain <bcain at codeaurora.org <mailto:bcain at codeaurora.org> > wrote:

 

Jordan,

 

Waaay back in 2014 you added “append_if(CXX_SUPPORTS_STDLIB "-stdlib=libc++" CMAKE_CXX_FLAGS)” to HandleLLVMStdlib.cmake and I’m asking if it might’ve been in error.  I’ll submit a review to delete the CMAKE_CXX_FLAGS unless you think it still makes sense.

 

-Brian

 

 

From: llvm-dev [ <mailto:llvm-dev-bounces at lists.llvm.org> mailto:llvm-dev-bounces at lists.llvm.org] On Behalf Of Brian Cain via llvm-dev
Sent: Thursday, November 17, 2016 5:10 PM
To: 'llvm-dev' < <mailto:llvm-dev at lists.llvm.org> llvm-dev at lists.llvm.org>
Subject: [llvm-dev] "-stdlib=libc++" applied to CMAKE_CXX_FLAGS

 

llvm/cmake/modules/HandleLLVMStdlib.cmake specifies “-stdlib=libc++” for CMAKE_CXX_FLAGS when LLVM_ENABLE_LIBCXX and CXX_SUPPORTS_STDLIB.  From what I can see this is a flag intended for the linker and not the compiler.

 

I’d like to submit a change to delete CMAKE_CXX_FLAGS from this append() but I wanted to check in with the list to see if that makes sense or if there are other contexts for which “stdlib=libc++” might be used.

 

If I specify “-nostdinc++”, “-stdlib=libc++” doesn’t get consumed and clang emits a warning. 

 

$ clang++ -nostdinc++ -stdlib=libc++ -o main.o -c main.cpp

clang-4.0: warning: argument unused during compilation: '-stdlib=libc++' [-Wunused-command-line-argument]

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161118/8d621159/attachment.html>


More information about the llvm-dev mailing list