summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-04-02 10:26:15 +0200
committerLudovic Courtès <ludo@gnu.org>2015-04-02 10:26:15 +0200
commit7e3c9f741b8a5ee3551be6ba5fe1721b4fb30e8a (patch)
tree89bf7644f8bc1ae1ba5fc603dc91f8a423f4565d /gnu
parentc2366e3ce4596382df6811661abd8612ecabb23d (diff)
downloadpatches-7e3c9f741b8a5ee3551be6ba5fe1721b4fb30e8a.tar
patches-7e3c9f741b8a5ee3551be6ba5fe1721b4fb30e8a.tar.gz
gnu: gcc: Fix libgcc_s directory in RUNPATH for cross-compiled binaries.
* gnu/packages/gcc.scm (gcc-4.7): Add 'libdir' procedure. Use it to determine the right libdir, including when cross-compiling. This fixes a bug whereby the RUNPATH of cross-compiled binaries would be set to $crossgcc/lib instead of $crossgcc/$triplet/lib. See <http://hydra.gnu.org/build/354389/nixlog/1/raw> for an example.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/gcc.scm11
1 files changed, 9 insertions, 2 deletions
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index 27e40f2f66..68c9e98762 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -85,6 +85,14 @@ where the OS part is overloaded to denote a specific ABI---into GCC
'("CC" "CXX" "LD" "AR" "NM" "RANLIB" "STRIP")
'("gcc" "g++" "ld" "ar" "nm" "ranlib" "strip"))
'()))))
+ (libdir
+ (let ((base '(or (assoc-ref outputs "lib")
+ (assoc-ref outputs "out"))))
+ (lambda ()
+ ;; Return the directory that contains lib/libgcc_s.so et al.
+ (if (%current-target-system)
+ `(string-append ,base "/" ,(%current-target-system))
+ base))))
(configure-flags
(lambda ()
;; This is terrible. Since we have two levels of quasiquotation,
@@ -185,8 +193,7 @@ where the OS part is overloaded to denote a specific ABI---into GCC
(alist-cons-before
'configure 'pre-configure
(lambda* (#:key inputs outputs #:allow-other-keys)
- (let ((libdir (or (assoc-ref outputs "lib")
- (assoc-ref outputs "out")))
+ (let ((libdir ,(libdir))
(libc (assoc-ref inputs "libc")))
(when libc
;; The following is not performed for `--without-headers'