gnu: cross-base: Use the right dynamic linker name.

* gnu/packages/cross-base.scm (cross-gcc-arguments): Parametrize
  %CURRENT-TARGET-SYSTEM.
* tests/monads.scm ("package-file + package->cross-derivation"): Replace
  "foo64-gnu" with "mips64el-linux-gnu".
This commit is contained in:
Ludovic Courtès 2014-10-05 16:25:25 +02:00
parent cdb4b4b3ed
commit b4469d8c12
2 changed files with 93 additions and 90 deletions

View file

@ -69,13 +69,16 @@
(define (cross-gcc-arguments target libc) (define (cross-gcc-arguments target libc)
"Return build system arguments for a cross-gcc for TARGET, using LIBC (which "Return build system arguments for a cross-gcc for TARGET, using LIBC (which
may be either a libc package or #f.)" may be either a libc package or #f.)"
;; Set the current target system so that 'glibc-dynamic-linker' returns the
;; right name.
(parameterize ((%current-target-system target))
(substitute-keyword-arguments (package-arguments gcc-4.8) (substitute-keyword-arguments (package-arguments gcc-4.8)
((#:configure-flags flags) ((#:configure-flags flags)
`(append (list ,(string-append "--target=" target) `(append (list ,(string-append "--target=" target)
,@(gcc-configure-flags-for-triplet target) ,@(gcc-configure-flags-for-triplet target)
,@(if libc ,@(if libc
'() '()
`(;; Disable features not needed at this stage. `( ;; Disable features not needed at this stage.
"--disable-shared" "--enable-static" "--disable-shared" "--enable-static"
;; Disable C++ because libstdc++'s configure ;; Disable C++ because libstdc++'s configure
@ -160,7 +163,7 @@ may be either a libc package or #f.)"
;; libgcc.a showing up as having an unknown architecture. See ;; libgcc.a showing up as having an unknown architecture. See
;; <http://lists.fedoraproject.org/pipermail/arm/2010-August/000663.html> ;; <http://lists.fedoraproject.org/pipermail/arm/2010-August/000663.html>
;; for instance. ;; for instance.
#f))) #f))))
(define* (cross-gcc target (define* (cross-gcc target
#:optional (xbinutils (cross-binutils target)) libc) #:optional (xbinutils (cross-binutils target)) libc)

View file

@ -123,10 +123,10 @@
(test-assert "package-file + package->cross-derivation" (test-assert "package-file + package->cross-derivation"
(run-with-store %store (run-with-store %store
(mlet* %store-monad ((file (package-file coreutils "bin/ls" (mlet* %store-monad ((target -> "mips64el-linux-gnu")
#:target "foo64-gnu")) (file (package-file coreutils "bin/ls"
(xcu (package->cross-derivation coreutils #:target target))
"foo64-gnu"))) (xcu (package->cross-derivation coreutils target)))
(let ((output (derivation->output-path xcu))) (let ((output (derivation->output-path xcu)))
(return (string=? file (string-append output "/bin/ls"))))) (return (string=? file (string-append output "/bin/ls")))))
#:guile-for-build (package-derivation %store %bootstrap-guile))) #:guile-for-build (package-derivation %store %bootstrap-guile)))