Skip to content
Snippets Groups Projects
Unverified Commit d76181a7 authored by Manolis Ragkousis's avatar Manolis Ragkousis
Browse files

gnu: cross-libc: Use the correct libc.

* gnu/packages/cross-base.scm (cross-libc): Use cross-libc-for-target
to determine the correct libc to use.
parent 5bde4503
No related branches found
No related tags found
No related merge requests found
...@@ -464,62 +464,62 @@ (define (cross-libc-for-target target) ...@@ -464,62 +464,62 @@ (define (cross-libc-for-target target)
((or "i586-pc-gnu" "i586-gnu") glibc/hurd) ((or "i586-pc-gnu" "i586-gnu") glibc/hurd)
(_ glibc/linux))) (_ glibc/linux)))
(package (inherit glibc) ;; Use (cross-libc-for-target ...) to determine the correct libc to use.
(name (string-append "glibc-cross-" target)) (let ((libc (cross-libc-for-target target)))
(arguments (package (inherit libc)
(substitute-keyword-arguments (name (string-append "glibc-cross-" target))
`(;; Disable stripping (see above.) (arguments
#:strip-binaries? #f (substitute-keyword-arguments
`(;; Disable stripping (see above.)
#:strip-binaries? #f
;; This package is used as a target input, but it should not have ;; This package is used as a target input, but it should not have
;; the usual cross-compilation inputs since that would include ;; the usual cross-compilation inputs since that would include
;; itself. ;; itself.
#:implicit-cross-inputs? #f #:implicit-cross-inputs? #f
;; We need SRFI 26. ;; We need SRFI 26.
#:modules ((guix build gnu-build-system) #:modules ((guix build gnu-build-system)
(guix build utils) (guix build utils)
(srfi srfi-26)) (srfi srfi-26))
;; Package-arguments does not use the correct libc, so we use ,@(package-arguments libc))
;; (cross-libc-for-target ...) to determine the correct one. ((#:configure-flags flags)
,@(package-arguments (cross-libc-for-target target))) `(cons ,(string-append "--host=" target)
((#:configure-flags flags)
`(cons ,(string-append "--host=" target)
,flags)) ,flags))
((#:phases phases) ((#:phases phases)
`(alist-cons-before `(alist-cons-before
'configure 'set-cross-kernel-headers-path 'configure 'set-cross-kernel-headers-path
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(let* ((kernel (assoc-ref inputs "kernel-headers")) (let* ((kernel (assoc-ref inputs "kernel-headers"))
(cpath (string-append kernel "/include"))) (cpath (string-append kernel "/include")))
(for-each (cut setenv <> cpath) (for-each (cut setenv <> cpath)
'("CROSS_C_INCLUDE_PATH" '("CROSS_C_INCLUDE_PATH"
"CROSS_CPLUS_INCLUDE_PATH" "CROSS_CPLUS_INCLUDE_PATH"
"CROSS_OBJC_INCLUDE_PATH" "CROSS_OBJC_INCLUDE_PATH"
"CROSS_OBJCPLUS_INCLUDE_PATH")) "CROSS_OBJCPLUS_INCLUDE_PATH"))
(setenv "CROSS_LIBRARY_PATH" (setenv "CROSS_LIBRARY_PATH"
(string-append kernel "/lib")) ;for Hurd's libihash (string-append kernel "/lib")) ;for Hurd's libihash
#t)) #t))
,phases)))) ,phases))))
;; Shadow the native "kernel-headers" because glibc's recipe expects the ;; Shadow the native "kernel-headers" because glibc's recipe expects the
;; "kernel-headers" input to point to the right thing. ;; "kernel-headers" input to point to the right thing.
(propagated-inputs `(("kernel-headers" ,xheaders))) (propagated-inputs `(("kernel-headers" ,xheaders)))
;; FIXME: 'static-bash' should really be an input, not a native input, but ;; FIXME: 'static-bash' should really be an input, not a native input, but
;; to do that will require building an intermediate cross libc. ;; to do that will require building an intermediate cross libc.
(inputs '()) (inputs '())
(native-inputs `(("cross-gcc" ,xgcc) (native-inputs `(("cross-gcc" ,xgcc)
("cross-binutils" ,xbinutils) ("cross-binutils" ,xbinutils)
,@(if (string-match (or "i586-pc-gnu" "i586-gnu") target) ,@(if (string-match (or "i586-pc-gnu" "i586-gnu") target)
`(("cross-mig" `(("cross-mig"
,@(assoc-ref (package-native-inputs xheaders) ,@(assoc-ref (package-native-inputs xheaders)
"cross-mig"))) "cross-mig")))
'()) '())
,@(package-inputs glibc) ;FIXME: static-bash ,@(package-inputs libc) ;FIXME: static-bash
,@(package-native-inputs glibc))))) ,@(package-native-inputs libc))))))
;;; ;;;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment