aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/gcc.scm
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-05-06 14:16:17 +0100
committerChristopher Baines <mail@cbaines.net>2023-05-06 14:16:17 +0100
commit54e8a32abd9f31253787d5997dbed172d794024f (patch)
tree320bb55f5ac7e3aee340c07c6c8907e9afa65897 /gnu/packages/gcc.scm
parent40d6615ca2755605e8aab790fbbae0221ec1d827 (diff)
downloadguix-54e8a32abd9f31253787d5997dbed172d794024f.tar
guix-54e8a32abd9f31253787d5997dbed172d794024f.tar.gz
gnu: Use gexps for gcc-boot0 and related packages.use-gexps-in-gcc-boot0
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, 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, 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.
Diffstat (limited to 'gnu/packages/gcc.scm')
-rw-r--r--gnu/packages/gcc.scm109
1 files changed, 55 insertions, 54 deletions
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
- ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017>
- ;; 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
+ ;; <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017>
+ ;; 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"))))