mirror of
https://github.com/CHN-beta/nixpkgs.git
synced 2026-01-13 11:30:35 +08:00
llvmPackages_{14, git}.clang: add nostdlibinc flag
Fix header search paths as #153963
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
|
||||
index 3bfddeefc7b2..05b11d9e562d 100644
|
||||
--- a/lib/Driver/Driver.cpp
|
||||
+++ b/lib/Driver/Driver.cpp
|
||||
@@ -482,6 +482,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;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ let
|
||||
./purity.patch
|
||||
# https://reviews.llvm.org/D51899
|
||||
./gnu-install-dirs.patch
|
||||
./add-nostdlibinc-flag.patch
|
||||
(substituteAll {
|
||||
src = ../../clang-11-12-LLVMgold-path.patch;
|
||||
libllvmLibdir = "${libllvm.lib}/lib";
|
||||
@@ -54,10 +55,6 @@ let
|
||||
postPatch = ''
|
||||
(cd tools && ln -s ../../clang-tools-extra extra)
|
||||
|
||||
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \
|
||||
-e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \
|
||||
lib/Driver/ToolChains/*.cpp
|
||||
|
||||
# Patch for standalone doc building
|
||||
sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
|
||||
'' + lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp
|
||||
index 3f29afd35971..223d2769cdfc 100644
|
||||
--- a/lib/Driver/Driver.cpp
|
||||
+++ b/lib/Driver/Driver.cpp
|
||||
@@ -491,6 +491,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;
|
||||
}
|
||||
|
||||
@@ -46,6 +46,7 @@ let
|
||||
./purity.patch
|
||||
# https://reviews.llvm.org/D51899
|
||||
./gnu-install-dirs.patch
|
||||
./add-nostdlibinc-flag.patch
|
||||
(substituteAll {
|
||||
src = ../../clang-11-12-LLVMgold-path.patch;
|
||||
libllvmLibdir = "${libllvm.lib}/lib";
|
||||
@@ -55,10 +56,6 @@ let
|
||||
postPatch = ''
|
||||
(cd tools && ln -s ../../clang-tools-extra extra)
|
||||
|
||||
sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \
|
||||
-e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \
|
||||
lib/Driver/ToolChains/*.cpp
|
||||
|
||||
# Patch for standalone doc building
|
||||
sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
|
||||
'' + lib.optionalString stdenv.hostPlatform.isMusl ''
|
||||
|
||||
Reference in New Issue
Block a user