summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/llvm.scm6
-rw-r--r--gnu/packages/patches/clang-12.0-libc-search-path.patch84
3 files changed, 0 insertions, 91 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 6d0bb89c4c3..845aebf30a4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1111,7 +1111,6 @@ dist_patch_DATA = \
1111 %D%/packages/patches/clamav-config-llvm-libs.patch \ 1111 %D%/packages/patches/clamav-config-llvm-libs.patch \
1112 %D%/packages/patches/clamav-system-tomsfastmath.patch \ 1112 %D%/packages/patches/clamav-system-tomsfastmath.patch \
1113 %D%/packages/patches/clang-11.0-libc-search-path.patch \ 1113 %D%/packages/patches/clang-11.0-libc-search-path.patch \
1114 %D%/packages/patches/clang-12.0-libc-search-path.patch \
1115 %D%/packages/patches/clang-13.0-libc-search-path.patch \ 1114 %D%/packages/patches/clang-13.0-libc-search-path.patch \
1116 %D%/packages/patches/clang-13-remove-crypt-interceptors.patch \ 1115 %D%/packages/patches/clang-13-remove-crypt-interceptors.patch \
1117 %D%/packages/patches/clang-14.0-libc-search-path.patch \ 1116 %D%/packages/patches/clang-14.0-libc-search-path.patch \
diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index a526a7bc627..121d7449734 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -1011,12 +1011,6 @@ Library.")
1011 (setenv "LD_LIBRARY_PATH" 1011 (setenv "LD_LIBRARY_PATH"
1012 (string-append (getcwd) "/lib")))))))))) 1012 (string-append (getcwd) "/lib"))))))))))
1013 1013
1014(define-public clang-runtime-12
1015 (clang-runtime-from-llvm
1016 llvm-12
1017 "1950rg294izdwkaasi7yjrmadc9mzdd5paf0q63jjcq2m3rdbj5l"
1018 '("clang-runtime-13-glibc-2.36-compat.patch" "clang-runtime-12-remove-crypt-interceptors.patch")))
1019
1020(define-public llvm-16 1014(define-public llvm-16
1021 (make-llvm "16.0.6")) 1015 (make-llvm "16.0.6"))
1022 1016
diff --git a/gnu/packages/patches/clang-12.0-libc-search-path.patch b/gnu/packages/patches/clang-12.0-libc-search-path.patch
deleted file mode 100644
index 38de2750488..00000000000
--- a/gnu/packages/patches/clang-12.0-libc-search-path.patch
+++ /dev/null
@@ -1,84 +0,0 @@
1Clang attempts to guess file names based on the OS and distro (yes!),
2but unfortunately, that doesn't work for us.
3
4This patch makes it easy to insert libc's $libdir so that Clang passes the
5correct absolute file name of crt1.o etc. to 'ld'. It also disables all
6the distro-specific stuff and removes the hard-coded FHS directory names
7to make sure Clang also works on foreign distros.
8
9diff --git a/lib/Driver/Distro.cpp b/lib/Driver/Distro.cpp
10index ee4fe841..f0313bbe 100644
11--- a/lib/Driver/Distro.cpp
12+++ b/lib/Driver/Distro.cpp
13@@ -93,6 +93,10 @@ static Distro::DistroType DetectLsbRelease(llvm::vfs::FileSystem &VFS) {
14 }
15
16 static Distro::DistroType DetectDistro(llvm::vfs::FileSystem &VFS) {
17+ // The compiler should always behave the same, even when used via Guix on a
18+ // foreign distro.
19+ return Distro::UnknownDistro;
20+
21 Distro::DistroType Version = Distro::UnknownDistro;
22
23 // Newer freedesktop.org's compilant systemd-based systems
24diff --git a/lib/Driver/ToolChains/Cuda.cpp b/lib/Driver/ToolChains/Cuda.cpp
25index d14776c5..88bc3ccd 100644
26--- a/lib/Driver/ToolChains/Cuda.cpp
27+++ b/lib/Driver/ToolChains/Cuda.cpp
28@@ -119,6 +119,9 @@ CudaInstallationDetector::CudaInstallationDetector(
29 const Driver &D, const llvm::Triple &HostTriple,
30 const llvm::opt::ArgList &Args)
31 : D(D) {
32+ // Don't look for CUDA in /usr.
33+ return;
34+
35 struct Candidate {
36 std::string Path;
37 bool StrictChecking;
38diff --git a/lib/Driver/ToolChains/Linux.cpp b/lib/Driver/ToolChains/Linux.cpp
39index 9663a739..107f96d6 100644
40--- a/lib/Driver/ToolChains/Linux.cpp
41+++ b/lib/Driver/ToolChains/Linux.cpp
42@@ -223,6 +223,9 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
43
44 Generic_GCC::PushPPaths(PPaths);
45
46+ // Comment out the distro-specific tweaks so that they don't bite when
47+ // using Guix on a foreign distro.
48+#if 0
49 Distro Distro(D.getVFS(), Triple);
50
51 if (Distro.IsAlpineLinux() || Triple.isAndroid()) {
52@@ -288,6 +291,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
53
54 if (IsAndroid || Distro.IsOpenSUSE())
55 ExtraOpts.push_back("--enable-new-dtags");
56+#endif
57
58 // The selection of paths to try here is designed to match the patterns which
59 // the GCC driver itself uses, as this is part of the GCC-compatible driver.
60@@ -301,6 +305,7 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
61
62 Generic_GCC::AddMultilibPaths(D, SysRoot, OSLibDir, MultiarchTriple, Paths);
63
64+#if 0
65 // Similar to the logic for GCC above, if we currently running Clang inside
66 // of the requested system root, add its parent library paths to
67 // those searched.
68@@ -352,9 +357,14 @@ Linux::Linux(const Driver &D, const llvm::Triple &Triple, const ArgList &Args)
69 // directory ('Dir' below) or the ResourceDir.
70 if (StringRef(D.Dir).startswith(SysRoot))
71 addPathIfExists(D, D.Dir + "/../lib", Paths);
72+#endif
73+
74+ // Add libc's lib/ directory to the search path, so that crt1.o, crti.o,
75+ // and friends can be found.
76+ addPathIfExists(D, "@GLIBC_LIBDIR@", Paths);
77
78- addPathIfExists(D, SysRoot + "/lib", Paths);
79- addPathIfExists(D, SysRoot + "/usr/lib", Paths);
80+ // Add GCC's lib/ directory so libstdc++.so can be found.
81+ addPathIfExists(D, GCCInstallation.getParentLibPath(), Paths);
82 }
83
84 ToolChain::CXXStdlibType Linux::GetDefaultCXXStdlibType() const {