gnu: Use gexps for gcc-boot0 and related packages.
There are currently problems with native or cross building for i586-gnu, and one factor mixed up with this is that some of the gcc packages use sexp's for the phases, and thus introducing gexp's has caused problems. As part of the going in circles with this, this commit switches gcc-boot0 to use gexp's in it's arguments, and then also modifies libstdc++-boot0, libstdc++-boot0-gcc7, cross-gcc-wrapper, gcc-final and make-libstdc++ to handle this change. If done correctly, this change shouldn't affect any derivations. * gnu/packages/commencement.scm (libstdc++-boot0, libstdc++-boot0-gcc7, gcc-boot0, gcc-final)[arguments]: Use gexps. (cross-gcc-wrapper): Use gexps in the generated package. * gnu/packages/gcc.scm (make-libstdc++): Use gexps in the generated package.
This commit is contained in:
parent
211ea54122
commit
a795a02a9d
2 changed files with 253 additions and 249 deletions
|
@ -2259,7 +2259,7 @@ exec " gcc "/bin/" program
|
||||||
((or "i686-linux" "x86_64-linux")
|
((or "i686-linux" "x86_64-linux")
|
||||||
(substitute-keyword-arguments (package-arguments lib)
|
(substitute-keyword-arguments (package-arguments lib)
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
`(modify-phases ,phases
|
#~(modify-phases #$phases
|
||||||
(add-after 'unpack 'workaround-wrapper-bug
|
(add-after 'unpack 'workaround-wrapper-bug
|
||||||
;; XXX: The crude gcc-cross-wrapper causes "g++ -v" to
|
;; XXX: The crude gcc-cross-wrapper causes "g++ -v" to
|
||||||
;; fail, which in turn confuses the configure script.
|
;; fail, which in turn confuses the configure script.
|
||||||
|
@ -2292,7 +2292,7 @@ exec " gcc "/bin/" program
|
||||||
|
|
||||||
,@(substitute-keyword-arguments (package-arguments lib)
|
,@(substitute-keyword-arguments (package-arguments lib)
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
`(modify-phases ,phases
|
#~(modify-phases #$phases
|
||||||
(add-after 'unpack 'unpack-gmp&co
|
(add-after 'unpack 'unpack-gmp&co
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
(let ((gmp (assoc-ref %build-inputs "gmp-source"))
|
(let ((gmp (assoc-ref %build-inputs "gmp-source"))
|
||||||
|
@ -2306,13 +2306,13 @@ exec " gcc "/bin/" program
|
||||||
(list gmp mpfr mpc))
|
(list gmp mpfr mpc))
|
||||||
|
|
||||||
;; Create symlinks like `gmp' -> `gmp-x.y.z'.
|
;; Create symlinks like `gmp' -> `gmp-x.y.z'.
|
||||||
,@(map (lambda (lib)
|
#$@(map (lambda (lib)
|
||||||
;; Drop trailing letters, as gmp-6.0.0a unpacks
|
;; Drop trailing letters, as gmp-6.0.0a unpacks
|
||||||
;; into gmp-6.0.0.
|
;; into gmp-6.0.0.
|
||||||
`(symlink ,(string-trim-right
|
#~(symlink #$(string-trim-right
|
||||||
(package-full-name lib "-")
|
(package-full-name lib "-")
|
||||||
char-set:letter)
|
char-set:letter)
|
||||||
,(package-name lib)))
|
#$(package-name lib)))
|
||||||
(list gmp-6.0 mpfr mpc))))))))))
|
(list gmp-6.0 mpfr mpc))))))))))
|
||||||
(inputs `(("gmp-source" ,(bootstrap-origin (package-source gmp-6.0)))
|
(inputs `(("gmp-source" ,(bootstrap-origin (package-source gmp-6.0)))
|
||||||
("mpfr-source" ,(bootstrap-origin (package-source mpfr)))
|
("mpfr-source" ,(bootstrap-origin (package-source mpfr)))
|
||||||
|
@ -2338,16 +2338,17 @@ exec " gcc "/bin/" program
|
||||||
(system* #$(file-append coreutils-boot0 "/bin/rm") "-rf"
|
(system* #$(file-append coreutils-boot0 "/bin/rm") "-rf"
|
||||||
"gcc/testsuite/go.test/test/fixedbugs/issue27836.dir"))))))
|
"gcc/testsuite/go.test/test/fixedbugs/issue27836.dir"))))))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:guile ,%bootstrap-guile
|
(cons*
|
||||||
|
#:guile %bootstrap-guile
|
||||||
#:implicit-inputs? #f
|
#:implicit-inputs? #f
|
||||||
#:modules ((guix build gnu-build-system)
|
#:modules '((guix build gnu-build-system)
|
||||||
(guix build utils)
|
(guix build utils)
|
||||||
(ice-9 regex)
|
(ice-9 regex)
|
||||||
(srfi srfi-1)
|
(srfi srfi-1)
|
||||||
(srfi srfi-26))
|
(srfi srfi-26))
|
||||||
,@(substitute-keyword-arguments (package-arguments gcc)
|
(substitute-keyword-arguments (package-arguments gcc)
|
||||||
((#:configure-flags flags)
|
((#:configure-flags flags)
|
||||||
`(append (list ,(string-append "--target=" (boot-triplet))
|
#~(append (list #$(string-append "--target=" (boot-triplet))
|
||||||
|
|
||||||
;; No libc yet.
|
;; No libc yet.
|
||||||
"--without-headers"
|
"--without-headers"
|
||||||
|
@ -2375,7 +2376,7 @@ exec " gcc "/bin/" program
|
||||||
"--disable-decimal-float")
|
"--disable-decimal-float")
|
||||||
(remove (cut string-match
|
(remove (cut string-match
|
||||||
"--(with-system-zlib|enable-languages.*)" <>)
|
"--(with-system-zlib|enable-languages.*)" <>)
|
||||||
,flags)))
|
#$flags)))
|
||||||
((#:make-flags flags)
|
((#:make-flags flags)
|
||||||
`(let* ((libc (assoc-ref %build-inputs "libc"))
|
`(let* ((libc (assoc-ref %build-inputs "libc"))
|
||||||
(libc-native (or (assoc-ref %build-inputs "libc-native")
|
(libc-native (or (assoc-ref %build-inputs "libc-native")
|
||||||
|
@ -2388,7 +2389,7 @@ exec " gcc "/bin/" program
|
||||||
("x86_64-linux" "i686-linux")
|
("x86_64-linux" "i686-linux")
|
||||||
(_ (%current-system))))))))
|
(_ (%current-system))))))))
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
`(modify-phases ,phases
|
#~(modify-phases #$phases
|
||||||
(add-after 'unpack 'unpack-gmp&co
|
(add-after 'unpack 'unpack-gmp&co
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
(let ((gmp (assoc-ref %build-inputs "gmp-source"))
|
(let ((gmp (assoc-ref %build-inputs "gmp-source"))
|
||||||
|
@ -2402,17 +2403,17 @@ exec " gcc "/bin/" program
|
||||||
(list gmp mpfr mpc))
|
(list gmp mpfr mpc))
|
||||||
|
|
||||||
;; Create symlinks like `gmp' -> `gmp-x.y.z'.
|
;; Create symlinks like `gmp' -> `gmp-x.y.z'.
|
||||||
,@(map (lambda (lib)
|
#$@(map (lambda (lib)
|
||||||
;; Drop trailing letters, as gmp-6.0.0a unpacks
|
;; Drop trailing letters, as gmp-6.0.0a unpacks
|
||||||
;; into gmp-6.0.0.
|
;; into gmp-6.0.0.
|
||||||
`(symlink ,(string-trim-right
|
#~(symlink #$(string-trim-right
|
||||||
(package-full-name lib "-")
|
(package-full-name lib "-")
|
||||||
char-set:letter)
|
char-set:letter)
|
||||||
,(package-name lib)))
|
#$(package-name lib)))
|
||||||
(list gmp-6.0 mpfr mpc)))))
|
(list gmp-6.0 mpfr mpc)))))
|
||||||
,(match (%current-system)
|
#$(match (%current-system)
|
||||||
((or "i686-linux" "x86_64-linux")
|
((or "i686-linux" "x86_64-linux")
|
||||||
'(add-before 'configure 'fix-libcc1
|
#~(add-before 'configure 'fix-libcc1
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
;; libcc1.so NEEDs libgcc_s.so, so provide one here
|
;; libcc1.so NEEDs libgcc_s.so, so provide one here
|
||||||
;; to placate the 'validate-runpath' phase.
|
;; to placate the 'validate-runpath' phase.
|
||||||
|
@ -2423,7 +2424,7 @@ exec " gcc "/bin/" program
|
||||||
;; XXX: "g++ -v" is broken (see also libstdc++ above).
|
;; XXX: "g++ -v" is broken (see also libstdc++ above).
|
||||||
(substitute* "libcc1/configure"
|
(substitute* "libcc1/configure"
|
||||||
(("g\\+\\+ -v") "true")))))
|
(("g\\+\\+ -v") "true")))))
|
||||||
(_ '(add-before 'configure 'return-true
|
(_ #~(add-before 'configure 'return-true
|
||||||
(lambda _ #t))))
|
(lambda _ #t))))
|
||||||
(add-after 'install 'symlink-libgcc_eh
|
(add-after 'install 'symlink-libgcc_eh
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
|
@ -2432,8 +2433,8 @@ exec " gcc "/bin/" program
|
||||||
;; it.
|
;; it.
|
||||||
(with-directory-excursion
|
(with-directory-excursion
|
||||||
(string-append out "/lib/gcc/"
|
(string-append out "/lib/gcc/"
|
||||||
,(boot-triplet)
|
#$(boot-triplet)
|
||||||
"/" ,(package-version gcc))
|
"/" #$(package-version gcc))
|
||||||
(symlink "libgcc.a" "libgcc_eh.a"))))))))))
|
(symlink "libgcc.a" "libgcc_eh.a"))))))))))
|
||||||
|
|
||||||
(inputs `(("gmp-source" ,(bootstrap-origin (package-source gmp-6.0)))
|
(inputs `(("gmp-source" ,(bootstrap-origin (package-source gmp-6.0)))
|
||||||
|
@ -2888,9 +2889,10 @@ that makes it available under the native tool names."
|
||||||
(build-system trivial-build-system)
|
(build-system trivial-build-system)
|
||||||
(outputs '("out"))
|
(outputs '("out"))
|
||||||
(arguments
|
(arguments
|
||||||
`(#:guile ,%bootstrap-guile
|
(list
|
||||||
#:modules ((guix build utils))
|
#:guile %bootstrap-guile
|
||||||
#:builder (begin
|
#:modules '((guix build utils))
|
||||||
|
#:builder #~(begin
|
||||||
(use-modules (guix build utils))
|
(use-modules (guix build utils))
|
||||||
|
|
||||||
(let* ((binutils (assoc-ref %build-inputs "binutils"))
|
(let* ((binutils (assoc-ref %build-inputs "binutils"))
|
||||||
|
@ -2899,7 +2901,7 @@ that makes it available under the native tool names."
|
||||||
(bash (assoc-ref %build-inputs "bash"))
|
(bash (assoc-ref %build-inputs "bash"))
|
||||||
(out (assoc-ref %outputs "out"))
|
(out (assoc-ref %outputs "out"))
|
||||||
(bindir (string-append out "/bin"))
|
(bindir (string-append out "/bin"))
|
||||||
(triplet ,(boot-triplet)))
|
(triplet #$(boot-triplet)))
|
||||||
(define (wrap-program program)
|
(define (wrap-program program)
|
||||||
;; GCC-BOOT0 is a libc-less cross-compiler, so it
|
;; GCC-BOOT0 is a libc-less cross-compiler, so it
|
||||||
;; needs to be told where to find the crt files and
|
;; needs to be told where to find the crt files and
|
||||||
|
@ -2911,7 +2913,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
|
||||||
bash
|
bash
|
||||||
gcc triplet program
|
gcc triplet program
|
||||||
libc libc
|
libc libc
|
||||||
,(glibc-dynamic-linker))))
|
#$(glibc-dynamic-linker))))
|
||||||
|
|
||||||
(chmod program #o555))
|
(chmod program #o555))
|
||||||
|
|
||||||
|
@ -3122,10 +3124,11 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
|
||||||
(outputs (delete "debug" (package-outputs gcc-boot0)))
|
(outputs (delete "debug" (package-outputs gcc-boot0)))
|
||||||
|
|
||||||
(arguments
|
(arguments
|
||||||
`(#:guile ,%bootstrap-guile
|
(cons*
|
||||||
|
#:guile %bootstrap-guile
|
||||||
#:implicit-inputs? #f
|
#:implicit-inputs? #f
|
||||||
|
|
||||||
#:allowed-references ("out" "lib" ,zlib-final
|
#:allowed-references `("out" "lib" ,zlib-final
|
||||||
,glibc-final ,static-bash-for-glibc)
|
,glibc-final ,static-bash-for-glibc)
|
||||||
|
|
||||||
;; Things like libasan.so and libstdc++.so NEED ld.so for some
|
;; Things like libasan.so and libstdc++.so NEED ld.so for some
|
||||||
|
@ -3134,14 +3137,14 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
|
||||||
#:validate-runpath? #f
|
#:validate-runpath? #f
|
||||||
|
|
||||||
;; Additional modules for the libstdc++ phase below.
|
;; Additional modules for the libstdc++ phase below.
|
||||||
#:modules ((srfi srfi-1)
|
#:modules `((srfi srfi-1)
|
||||||
(srfi srfi-26)
|
(srfi srfi-26)
|
||||||
,@%gnu-build-system-modules)
|
,@%gnu-build-system-modules)
|
||||||
|
|
||||||
,@(substitute-keyword-arguments (package-arguments gcc)
|
(substitute-keyword-arguments (package-arguments gcc)
|
||||||
((#:make-flags flags)
|
((#:make-flags flags)
|
||||||
;; Since $LIBRARY_PATH is not honored, add the relevant flags.
|
;; Since $LIBRARY_PATH is not honored, add the relevant flags.
|
||||||
`(let ((zlib (assoc-ref %build-inputs "zlib")))
|
#~(let ((zlib (assoc-ref %build-inputs "zlib")))
|
||||||
(map (lambda (flag)
|
(map (lambda (flag)
|
||||||
(if (string-prefix? "LDFLAGS=" flag)
|
(if (string-prefix? "LDFLAGS=" flag)
|
||||||
(string-append flag " -L"
|
(string-append flag " -L"
|
||||||
|
@ -3149,12 +3152,12 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
|
||||||
"/lib -L" zlib "/lib -Wl,-rpath="
|
"/lib -L" zlib "/lib -Wl,-rpath="
|
||||||
zlib "/lib")
|
zlib "/lib")
|
||||||
flag))
|
flag))
|
||||||
,flags)))
|
#$flags)))
|
||||||
;; Build again GMP & co. within GCC's build process, because it's hard
|
;; Build again GMP & co. within GCC's build process, because it's hard
|
||||||
;; to do outside (because GCC-BOOT0 is a cross-compiler, and thus
|
;; to do outside (because GCC-BOOT0 is a cross-compiler, and thus
|
||||||
;; doesn't honor $LIBRARY_PATH, which breaks `gnu-build-system'.)
|
;; doesn't honor $LIBRARY_PATH, which breaks `gnu-build-system'.)
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
`(modify-phases ,phases
|
#~(modify-phases #$phases
|
||||||
(add-after 'unpack 'unpack-gmp&co
|
(add-after 'unpack 'unpack-gmp&co
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
(let ((gmp (assoc-ref %build-inputs "gmp-source"))
|
(let ((gmp (assoc-ref %build-inputs "gmp-source"))
|
||||||
|
@ -3168,13 +3171,13 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%"
|
||||||
(list gmp mpfr mpc))
|
(list gmp mpfr mpc))
|
||||||
|
|
||||||
;; Create symlinks like `gmp' -> `gmp-x.y.z'.
|
;; Create symlinks like `gmp' -> `gmp-x.y.z'.
|
||||||
,@(map (lambda (lib)
|
#$@(map (lambda (lib)
|
||||||
;; Drop trailing letters, as gmp-6.0.0a unpacks
|
;; Drop trailing letters, as gmp-6.0.0a unpacks
|
||||||
;; into gmp-6.0.0.
|
;; into gmp-6.0.0.
|
||||||
`(symlink ,(string-trim-right
|
#~(symlink #$(string-trim-right
|
||||||
(package-full-name lib "-")
|
(package-full-name lib "-")
|
||||||
char-set:letter)
|
char-set:letter)
|
||||||
,(package-name lib)))
|
#$(package-name lib)))
|
||||||
(list gmp-6.0 mpfr mpc)))))
|
(list gmp-6.0 mpfr mpc)))))
|
||||||
(add-after 'unpack 'fix-build-with-external-libstdc++
|
(add-after 'unpack 'fix-build-with-external-libstdc++
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
|
|
|
@ -864,17 +864,18 @@ using compilers other than GCC."
|
||||||
(inherit gcc)
|
(inherit gcc)
|
||||||
(name "libstdc++")
|
(name "libstdc++")
|
||||||
(arguments
|
(arguments
|
||||||
`(#:out-of-source? #t
|
(list
|
||||||
#:modules ((srfi srfi-1)
|
#:out-of-source? #t
|
||||||
|
#:modules `((srfi srfi-1)
|
||||||
(srfi srfi-26)
|
(srfi srfi-26)
|
||||||
,@%gnu-build-system-modules)
|
,@%gnu-build-system-modules)
|
||||||
#:phases
|
#:phases
|
||||||
(modify-phases %standard-phases
|
#~(modify-phases %standard-phases
|
||||||
,@(if (version>=? (package-version gcc) "11")
|
#$@(if (version>=? (package-version gcc) "11")
|
||||||
`((add-after 'unpack 'hide-gcc-headers
|
#~((add-after 'unpack 'hide-gcc-headers
|
||||||
(lambda* (#:key native-inputs inputs #:allow-other-keys)
|
(lambda* (#:key native-inputs inputs #:allow-other-keys)
|
||||||
(let ((gcc (assoc-ref (or native-inputs inputs)
|
(let ((gcc (assoc-ref (or native-inputs inputs)
|
||||||
,(if (%current-target-system)
|
#$(if (%current-target-system)
|
||||||
"cross-gcc"
|
"cross-gcc"
|
||||||
"gcc"))))
|
"gcc"))))
|
||||||
;; Fix a regression in GCC 11 where the GCC headers
|
;; Fix a regression in GCC 11 where the GCC headers
|
||||||
|
@ -886,25 +887,25 @@ using compilers other than GCC."
|
||||||
;; and the similar adjustment in GCC-FINAL.
|
;; and the similar adjustment in GCC-FINAL.
|
||||||
(substitute* "libstdc++-v3/src/c++17/Makefile.in"
|
(substitute* "libstdc++-v3/src/c++17/Makefile.in"
|
||||||
(("AM_CXXFLAGS = ")
|
(("AM_CXXFLAGS = ")
|
||||||
(string-append ,(if (%current-target-system)
|
(string-append #$(if (%current-target-system)
|
||||||
"CROSS_CPLUS_INCLUDE_PATH = "
|
"CROSS_CPLUS_INCLUDE_PATH = "
|
||||||
"CPLUS_INCLUDE_PATH = ")
|
"CPLUS_INCLUDE_PATH = ")
|
||||||
(string-join
|
(string-join
|
||||||
(remove (cut string-prefix? gcc <>)
|
(remove (cut string-prefix? gcc <>)
|
||||||
(string-split
|
(string-split
|
||||||
(getenv
|
(getenv
|
||||||
,(if (%current-target-system)
|
#$(if (%current-target-system)
|
||||||
"CROSS_CPLUS_INCLUDE_PATH"
|
"CROSS_CPLUS_INCLUDE_PATH"
|
||||||
"CPLUS_INCLUDE_PATH"))
|
"CPLUS_INCLUDE_PATH"))
|
||||||
#\:))
|
#\:))
|
||||||
":")
|
":")
|
||||||
"\nAM_CXXFLAGS = ")))))))
|
"\nAM_CXXFLAGS = ")))))))
|
||||||
'())
|
'())
|
||||||
,@(let ((version (package-version gcc)))
|
#$@(let ((version (package-version gcc)))
|
||||||
(if (and (target-ppc64le?)
|
(if (and (target-ppc64le?)
|
||||||
(version>=? version "11")
|
(version>=? version "11")
|
||||||
(not (version>=? version "12")))
|
(not (version>=? version "12")))
|
||||||
`((add-after 'unpack 'patch-powerpc
|
#~((add-after 'unpack 'patch-powerpc
|
||||||
(lambda* (#:key inputs #:allow-other-keys)
|
(lambda* (#:key inputs #:allow-other-keys)
|
||||||
(invoke "patch" "--force" "-p1" "-i"
|
(invoke "patch" "--force" "-p1" "-i"
|
||||||
(assoc-ref inputs "powerpc64le-patch")))))
|
(assoc-ref inputs "powerpc64le-patch")))))
|
||||||
|
@ -919,7 +920,7 @@ using compilers other than GCC."
|
||||||
(lambda _
|
(lambda _
|
||||||
(chdir "libstdc++-v3"))))
|
(chdir "libstdc++-v3"))))
|
||||||
|
|
||||||
#:configure-flags `("--disable-libstdcxx-pch"
|
#:configure-flags '`("--disable-libstdcxx-pch"
|
||||||
,(string-append "--with-gxx-include-dir="
|
,(string-append "--with-gxx-include-dir="
|
||||||
(assoc-ref %outputs "out")
|
(assoc-ref %outputs "out")
|
||||||
"/include"))))
|
"/include"))))
|
||||||
|
|
Reference in a new issue