From a795a02a9d988be5a762886620f7bb6a95e7ffdb Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Sat, 6 May 2023 14:16:17 +0100 Subject: 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. --- gnu/packages/gcc.scm | 109 ++++++++++++++++++++++++++------------------------- 1 file changed, 55 insertions(+), 54 deletions(-) (limited to 'gnu/packages/gcc.scm') diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm index fade5bb64b..d1c79b8dc2 100644 --- a/gnu/packages/gcc.scm +++ b/gnu/packages/gcc.scm @@ -864,62 +864,63 @@ using compilers other than GCC." (inherit gcc) (name "libstdc++") (arguments - `(#:out-of-source? #t - #:modules ((srfi srfi-1) + (list + #:out-of-source? #t + #:modules `((srfi srfi-1) (srfi srfi-26) ,@%gnu-build-system-modules) - #:phases - (modify-phases %standard-phases - ,@(if (version>=? (package-version gcc) "11") - `((add-after 'unpack 'hide-gcc-headers - (lambda* (#:key native-inputs inputs #:allow-other-keys) - (let ((gcc (assoc-ref (or native-inputs inputs) - ,(if (%current-target-system) - "cross-gcc" - "gcc")))) - ;; Fix a regression in GCC 11 where the GCC headers - ;; shadows glibc headers when building libstdc++. An - ;; upstream fix was added in GCC 11.3.0, but it only - ;; hides system include directories, not those on - ;; CPLUS_INCLUDE_PATH. See discussion at - ;; - ;; and the similar adjustment in GCC-FINAL. - (substitute* "libstdc++-v3/src/c++17/Makefile.in" - (("AM_CXXFLAGS = ") - (string-append ,(if (%current-target-system) - "CROSS_CPLUS_INCLUDE_PATH = " - "CPLUS_INCLUDE_PATH = ") - (string-join - (remove (cut string-prefix? gcc <>) - (string-split - (getenv - ,(if (%current-target-system) - "CROSS_CPLUS_INCLUDE_PATH" - "CPLUS_INCLUDE_PATH")) - #\:)) - ":") - "\nAM_CXXFLAGS = "))))))) - '()) - ,@(let ((version (package-version gcc))) - (if (and (target-ppc64le?) - (version>=? version "11") - (not (version>=? version "12"))) - `((add-after 'unpack 'patch-powerpc - (lambda* (#:key inputs #:allow-other-keys) - (invoke "patch" "--force" "-p1" "-i" - (assoc-ref inputs "powerpc64le-patch"))))) - '())) - ;; Force rs6000 (i.e., powerpc) libdir to be /lib and not /lib64. - (add-before 'chdir 'fix-rs6000-libdir - (lambda _ - (when (file-exists? "gcc/config/rs6000") - (substitute* (find-files "gcc/config/rs6000") - (("/lib64") "/lib"))))) - (add-before 'configure 'chdir - (lambda _ - (chdir "libstdc++-v3")))) - - #:configure-flags `("--disable-libstdcxx-pch" + #:phases + #~(modify-phases %standard-phases + #$@(if (version>=? (package-version gcc) "11") + #~((add-after 'unpack 'hide-gcc-headers + (lambda* (#:key native-inputs inputs #:allow-other-keys) + (let ((gcc (assoc-ref (or native-inputs inputs) + #$(if (%current-target-system) + "cross-gcc" + "gcc")))) + ;; Fix a regression in GCC 11 where the GCC headers + ;; shadows glibc headers when building libstdc++. An + ;; upstream fix was added in GCC 11.3.0, but it only + ;; hides system include directories, not those on + ;; CPLUS_INCLUDE_PATH. See discussion at + ;; + ;; and the similar adjustment in GCC-FINAL. + (substitute* "libstdc++-v3/src/c++17/Makefile.in" + (("AM_CXXFLAGS = ") + (string-append #$(if (%current-target-system) + "CROSS_CPLUS_INCLUDE_PATH = " + "CPLUS_INCLUDE_PATH = ") + (string-join + (remove (cut string-prefix? gcc <>) + (string-split + (getenv + #$(if (%current-target-system) + "CROSS_CPLUS_INCLUDE_PATH" + "CPLUS_INCLUDE_PATH")) + #\:)) + ":") + "\nAM_CXXFLAGS = "))))))) + '()) + #$@(let ((version (package-version gcc))) + (if (and (target-ppc64le?) + (version>=? version "11") + (not (version>=? version "12"))) + #~((add-after 'unpack 'patch-powerpc + (lambda* (#:key inputs #:allow-other-keys) + (invoke "patch" "--force" "-p1" "-i" + (assoc-ref inputs "powerpc64le-patch"))))) + '())) + ;; Force rs6000 (i.e., powerpc) libdir to be /lib and not /lib64. + (add-before 'chdir 'fix-rs6000-libdir + (lambda _ + (when (file-exists? "gcc/config/rs6000") + (substitute* (find-files "gcc/config/rs6000") + (("/lib64") "/lib"))))) + (add-before 'configure 'chdir + (lambda _ + (chdir "libstdc++-v3")))) + + #:configure-flags '`("--disable-libstdcxx-pch" ,(string-append "--with-gxx-include-dir=" (assoc-ref %outputs "out") "/include")))) -- cgit v1.2.3