guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: gnu: libstdc++: Fix cross-compilation.


From: guix-commits
Subject: 02/02: gnu: libstdc++: Fix cross-compilation.
Date: Thu, 9 Mar 2023 08:19:38 -0500 (EST)

civodul pushed a commit to branch core-updates
in repository guix.

commit 0ad86e94f518c70690641c1d6f3a04037974a25b
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Thu Mar 9 13:08:53 2023 +0100

    gnu: libstdc++: Fix cross-compilation.
    
    * gnu/packages/gcc.scm (make-libstdc++): Adjust 'hide-gcc-headers' for
    cross-compiled libstdc++.
---
 gnu/packages/gcc.scm | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index d002545f8f..ce6e3e7a83 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012-2022 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2012-2023 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014, 2015, 2016, 2017, 2019, 2021 Ricardo Wurmus 
<rekado@elephly.net>
 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
@@ -849,9 +849,12 @@ using compilers other than GCC."
        #:phases
        (modify-phases %standard-phases
          ,@(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)
-                     (let ((gcc (assoc-ref (or native-inputs inputs) "gcc")))
+                     (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
@@ -861,11 +864,16 @@ using compilers other than GCC."
                        ;; and the similar adjustment in GCC-FINAL.
                        (substitute* "libstdc++-v3/src/c++17/Makefile.in"
                          (("AM_CXXFLAGS = ")
-                          (string-append "CPLUS_INCLUDE_PATH = "
+                          (string-append ,(if (%current-target-system)
+                                              "CROSS_CPLUS_INCLUDE_PATH = "
+                                              "CPLUS_INCLUDE_PATH = ")
                                          (string-join
                                           (remove (cut string-prefix? gcc <>)
                                                   (string-split
-                                                   (getenv 
"CPLUS_INCLUDE_PATH")
+                                                   (getenv
+                                                    ,(if 
(%current-target-system)
+                                                         
"CROSS_CPLUS_INCLUDE_PATH"
+                                                         "CPLUS_INCLUDE_PATH"))
                                                    #\:))
                                           ":")
                                          "\nAM_CXXFLAGS = ")))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]