diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2015-03-07 10:01:29 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2015-03-07 10:01:29 +0000 |
| commit | 7e7dd47fc21daf11c12484f4e9c4585b70d91560 (patch) | |
| tree | aefa290671bf891a6a74f97045da028926b8f6ce /clang/lib/Driver | |
| parent | df397c520d48937df0a44bea3a49190176e107f2 (diff) | |
| download | bcm5719-llvm-7e7dd47fc21daf11c12484f4e9c4585b70d91560.tar.gz bcm5719-llvm-7e7dd47fc21daf11c12484f4e9c4585b70d91560.zip | |
Much like we silence warnings about -flto in many cases to facilitate
simplicity in build systems, silence '-stdlib=libc++' when linking. Even
if we're not linking C++ code per-se, we may be passing this flag so
that when we are linking C++ code we pick up the desired standard
library. While most build systems already provide separate C and C++
compile flags, many conflate link flags. Sadly, CMake is among them
causing this warning in a libc++ selfhost.
llvm-svn: 231559
Diffstat (limited to 'clang/lib/Driver')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index a80214e1e66..3c6827af9d8 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -7704,6 +7704,8 @@ void gnutools::Link::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back("-Bdynamic"); CmdArgs.push_back("-lm"); } + // Silence warnings when linking C code with a C++ '-stdlib' argument. + Args.ClaimAllArgs(options::OPT_stdlib_EQ); if (!Args.hasArg(options::OPT_nostdlib)) { if (!Args.hasArg(options::OPT_nodefaultlibs)) { |

