~ruther/guix-local

7e3c9f741b8a5ee3551be6ba5fe1721b4fb30e8a — Ludovic Courtès 11 years ago c2366e3
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.
1 files changed, 9 insertions(+), 2 deletions(-)

M gnu/packages/gcc.scm
M gnu/packages/gcc.scm => gnu/packages/gcc.scm +9 -2
@@ 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'