mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: clang: Allow 'clang' to link executables.
* gnu/packages/patches/clang-libc-search-path.patch: New file. * gnu-system.am (dist_patch_DATA): Add it. * gnu/packages/llvm.scm (clang-from-llvm)[source]: Use it. [inputs]: Add "gcc-lib". [arguments]. Add -DGCC_INSTALL_PREFIX and -DC_INCLUDE_DIRS to #:configure-flags. Add #:phases argument.
This commit is contained in:
parent
ef11ac8701
commit
fd6ae1b983
3 changed files with 55 additions and 2 deletions
19
gnu/packages/patches/clang-libc-search-path.patch
Normal file
19
gnu/packages/patches/clang-libc-search-path.patch
Normal file
|
@ -0,0 +1,19 @@
|
|||
Clang attempts to guess file names based on the OS and distro (yes!),
|
||||
but unfortunately, that doesn't work for us.
|
||||
|
||||
This patch makes it easy to insert libc's $libdir so that Clang passes the
|
||||
correct absolute file name of crt1.o etc. to 'ld'.
|
||||
|
||||
--- cfe-3.6.0.src/lib/Driver/ToolChains.cpp 2015-02-18 22:03:07.000000000 +0100
|
||||
+++ cfe-3.6.0.src/lib/Driver/ToolChains.cpp 2015-06-19 16:37:20.459701044 +0200
|
||||
@@ -3085,6 +3085,10 @@ Linux::Linux(const Driver &D, const llvm
|
||||
|
||||
addPathIfExists(SysRoot + "/lib", Paths);
|
||||
addPathIfExists(SysRoot + "/usr/lib", Paths);
|
||||
+
|
||||
+ // Add libc's lib/ directory to the search path, so that crt1.o, crti.o,
|
||||
+ // and friends can be found.
|
||||
+ addPathIfExists("@GLIBC_LIBDIR@", Paths);
|
||||
}
|
||||
|
||||
bool Linux::HasNativeLLVMSupport() const {
|
Loading…
Add table
Add a link
Reference in a new issue