Browse Source

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.
gn-latest-20200428
Ludovic Courtès 6 years ago
parent
commit
7e3c9f741b
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      gnu/packages/gcc.scm

+ 9
- 2
gnu/packages/gcc.scm View File

@ -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'


Loading…
Cancel
Save