nixpkgs/pkgs/development/compilers/llvm/13/clang/add-nostdlibinc-flag.patch
Jyun-Yan You 2fe19fe24a llvmPackages_13.clang: add nostdlibinc flag
This patch adds nostdlibinc flag after parsing arguments
instead of sed substitution.

Fix #151879
2022-02-14 17:10:32 +08:00

18 lines
464 B
Diff

diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
index 94a7553e273b..8a1d455950b2 100644
--- a/lib/Driver/Driver.cpp
+++ b/lib/Driver/Driver.cpp
@@ -412,6 +412,13 @@ DerivedArgList *Driver::TranslateInputArgs(const InputArgList &Args) const {
}
#endif
+ {
+ Arg *A = DAL->MakeFlagArg(/*BaseArg=*/nullptr,
+ Opts.getOption(options::OPT_nostdlibinc));
+ A->claim();
+ DAL->append(A);
+ }
+
return DAL;
}