summary refs log tree commit diff
path: root/gnu/packages/gcc.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/gcc.scm')
-rw-r--r--gnu/packages/gcc.scm25
1 files changed, 18 insertions, 7 deletions
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index bbc0a134d2..db1984306e 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -73,6 +73,9 @@ where the OS part is overloaded to denote a specific ABI---into GCC
                      "--enable-languages=c,c++"
                      "--disable-multilib"
 
+                     ;; No pre-compiled libstdc++ headers, to save space.
+                     "--disable-libstdcxx-pch"
+
                      "--with-local-prefix=/no-gcc-local-prefix"
 
                      ,(let ((libc (assoc-ref %build-inputs "libc")))
@@ -115,7 +118,9 @@ where the OS part is overloaded to denote a specific ABI---into GCC
          #:strip-binaries? ,stripped?
          #:configure-flags ,(configure-flags)
          #:make-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)))
            `(,@(if libc
                    (list (string-append "LDFLAGS_FOR_TARGET="
                                         "-B" libc "/lib "
@@ -123,6 +128,12 @@ where the OS part is overloaded to denote a specific ABI---into GCC
                                         "-Wl," libc
                                         ,(glibc-dynamic-linker)))
                    '())
+
+             ;; Native programs like 'genhooks' also need that right.
+             ,(string-append "LDFLAGS="
+                              "-Wl,-rpath=" libc-native "/lib "
+                             "-Wl,-dynamic-linker "
+                             "-Wl," libc-native ,(glibc-dynamic-linker))
              ,(string-append "BOOT_CFLAGS=-O2 "
                              ,(if stripped? "-g0" "-g"))))
 
@@ -148,18 +159,18 @@ where the OS part is overloaded to denote a specific ABI---into GCC
                 ;; Tell where to find libstdc++, libc, and `?crt*.o', except
                 ;; `crt{begin,end}.o', which come with GCC.
                 (substitute* (find-files "gcc/config"
-                                         "^(gnu-user(64)?|linux-elf)\\.h$")
-                  (("#define LIB_SPEC (.*)$" _ suffix)
+                                         "^gnu-user.*\\.h$")
+                  (("#define GNU_USER_TARGET_LIB_SPEC (.*)$" _ suffix)
                    ;; Note that with this "lib" spec, we may still add a
                    ;; RUNPATH to GCC even when `libgcc_s' is not NEEDED.
                    ;; There's not much that can be done to avoid it, though.
-                   (format #f "#define LIB_SPEC \"-L~a/lib %{!static:-rpath=~a/lib \
-%{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib}} \" ~a"
+                   (format #f "#define GNU_USER_TARGET_LIB_SPEC \
+\"-L~a/lib %{!static:-rpath=~a/lib %{!static-libgcc:-rpath=~a/lib64 -rpath=~a/lib}} \" ~a"
                            libc libc out out suffix))
-                  (("#define STARTFILE_SPEC.*$" line)
+                  (("#define GNU_USER_TARGET_STARTFILE_SPEC.*$" line)
                    (format #f "#define STANDARD_STARTFILE_PREFIX_1 \"~a/lib\"
 #define STANDARD_STARTFILE_PREFIX_2 \"\"
-~a~%"
+~a"
                            libc line))))
 
               ;; Don't retain a dependency on the build-time sed.