diff options
author | Nirav Dave <niravd@google.com> | 2015-11-24 16:07:21 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2015-11-24 16:07:21 +0000 |
commit | b0bb6142f5b837a15b4d2c8031d4074145989fe2 (patch) | |
tree | 66bf15c694b0a817105bfe5a20aa841a07800bea /clang/lib/Driver/Driver.cpp | |
parent | 47c1baeb1f648ae779ad617e74eaa5ea5c7a37d3 (diff) | |
download | bcm5719-llvm-b0bb6142f5b837a15b4d2c8031d4074145989fe2.tar.gz bcm5719-llvm-b0bb6142f5b837a15b4d2c8031d4074145989fe2.zip |
Fix rewrite of reserved library name in case of -nodefaultlibs
The Driver only checked if nostdlib was set when deciding to add
reserved_lib_stdcxx, but as nostdlib is always exactly nodefaultlibs and
nostartfiles we should be checking one (clearly nodefaultlibs in the
case) as well. This appears to be the only such instance of this in the
codebase.
Differential Revision: http://reviews.llvm.org/D14935
llvm-svn: 253990
Diffstat (limited to 'clang/lib/Driver/Driver.cpp')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index 5ff57093537..4f8481c0bee 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -209,6 +209,7 @@ DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const { DerivedArgList *DAL = new DerivedArgList(Args); bool HasNostdlib = Args.hasArg(options::OPT_nostdlib); + bool HasNodefaultlib = Args.hasArg(options::OPT_nodefaultlibs); for (Arg *A : Args) { // Unfortunately, we have to parse some forwarding options (-Xassembler, // -Xlinker, -Xpreprocessor) because we either integrate their functionality @@ -252,7 +253,7 @@ DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const { StringRef Value = A->getValue(); // Rewrite unless -nostdlib is present. - if (!HasNostdlib && Value == "stdc++") { + if (!HasNostdlib && !HasNodefaultlib && Value == "stdc++") { DAL->AddFlagArg(A, Opts->getOption(options::OPT_Z_reserved_lib_stdcxx)); continue; } |