guix_mirror_bot pushed a commit to branch core-packages-team in repository guix.
commit da9bff780daa909b5532920b1637286d06732cfd Author: Nicolas Graves <[email protected]> AuthorDate: Sat Feb 21 15:38:22 2026 +0100 gnu: gcc-final: Improve style. Dropping input labels here is a harder issue than for most other packages, because of libc/libc-native. Instead make some progress towards dropping input labels without dropping them entirely. * gnu/packages/commencement.scm (gcc-boot0)[arguments] <#:make-flags>: Improve style, use search-input-file. <#:phases>: Improve style. Replace phase 'unpack-gmp&co by refactored unpack-and-symlink-other-tarballs-phase. Use search-input-file. <#:modules>: Adapt them accordingly. [inputs]: Reorganize them accordingly. Change-Id: I9e98b7b89cc9c864a2c60919eec61913fdf01baa Signed-off-by: Ludovic Courtès <[email protected]> --- gnu/packages/commencement.scm | 62 ++++++++++++++++--------------------------- 1 file changed, 23 insertions(+), 39 deletions(-) diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm index af668ed05fe..cf2de338e0e 100644 --- a/gnu/packages/commencement.scm +++ b/gnu/packages/commencement.scm @@ -3334,7 +3334,8 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" (define gcc-final ;; The final GCC. - (package (inherit gcc-boot0) + (package + (inherit gcc-boot0) (name "gcc") ;; XXX: Currently #:allowed-references applies to all the outputs but the @@ -3356,7 +3357,8 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" #:validate-runpath? #f ;; Additional modules for the libstdc++ phase below. - #:modules `((srfi srfi-1) + #:modules `((ice-9 match) + (srfi srfi-1) (srfi srfi-26) ,@%default-gnu-modules) @@ -3364,7 +3366,8 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" (substitute-keyword-arguments (package-arguments gcc) ((#:make-flags flags) ;; Since $LIBRARY_PATH is not honored, add the relevant flags. - #~(let ((zlib (assoc-ref %build-inputs "zlib"))) + #~(let ((z-lib (dirname + (search-input-file %build-inputs "lib/libz.so")))) (map (lambda (flag) (if #$(if (target-hurd64?) #~(and (string? flag) @@ -3372,8 +3375,7 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" #~(string-prefix? "LDFLAGS=" flag)) (string-append flag " -L" (assoc-ref %build-inputs "libstdc++") - "/lib -L" zlib "/lib -Wl,-rpath=" - zlib "/lib") + "/lib -L" z-lib " -Wl,-rpath=" z-lib) flag)) #$flags))) ((#:configure-flags flags) @@ -3389,27 +3391,8 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" ;; doesn't honor $LIBRARY_PATH, which breaks `gnu-build-system'.) ((#:phases phases) #~(modify-phases #$phases - (add-after 'unpack 'unpack-gmp&co - (lambda* (#:key inputs #:allow-other-keys) - (let ((gmp (assoc-ref %build-inputs "gmp-source")) - (mpfr (assoc-ref %build-inputs "mpfr-source")) - (mpc (assoc-ref %build-inputs "mpc-source"))) - - ;; To reduce the set of pre-built bootstrap inputs, build - ;; GMP & co. from GCC. - (for-each (lambda (source) - (invoke "tar" "xvf" source)) - (list gmp mpfr mpc)) - - ;; Create symlinks like `gmp' -> `gmp-x.y.z'. - #$@(map (lambda (lib) - ;; Drop trailing letters, as gmp-6.0.0a unpacks - ;; into gmp-6.0.0. - #~(symlink #$(string-trim-right - (package-full-name lib "-") - char-set:letter) - #$(package-name lib))) - (list gmp-6.0 mpfr mpc))))) + (add-after 'unpack 'unpack-other-tarballs + #$unpack-and-symlink-other-tarballs-phase) (add-after 'unpack 'fix-build-with-external-libstdc++ (lambda* (#:key inputs #:allow-other-keys) (let ((libstdc++ (assoc-ref inputs "libstdc++"))) @@ -3434,19 +3417,20 @@ exec ~a/bin/~a-~a -B~a/lib -Wl,-dynamic-linker -Wl,~a/~a \"$@\"~%" ;; STATIC-BASH-FOR-GLIBC so that it's used in the final shebangs of ;; scripts such as 'mkheaders' and 'fixinc.sh' (XXX: who cares about these ;; scripts?). - (native-inputs `(("texinfo" ,texinfo-boot0) - ("perl" ,perl-boot0) ;for manpages - ("bash-static" ,static-bash-for-glibc) - ,@(package-native-inputs gcc-boot0))) - - (inputs `(("gmp-source" ,(bootstrap-origin (package-source gmp-6.0))) - ("mpfr-source" ,(package-source mpfr)) - ("mpc-source" ,(package-source mpc)) - ("ld-wrapper" ,ld-wrapper-boot3) - ("binutils" ,binutils-final) - ("libstdc++" ,libstdc++) - ("zlib" ,zlib-final) - ,@(%boot2-inputs))))) + (native-inputs + (modify-inputs (package-native-inputs gcc-boot0) + (prepend texinfo-boot0 + perl-boot0 ;for manpages + static-bash-for-glibc))) + (inputs + (modify-inputs (%boot2-inputs) + (prepend (bootstrap-origin (package-source gmp-6.0)) + (package-source mpfr) + (package-source mpc) + ld-wrapper-boot3 + binutils-final + libstdc++ + zlib-final))))) (define (%boot3-inputs) ;; 4th stage inputs.
