guix-commits
[Top][All Lists]
Advanced

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

01/01: gnu: Don't use --strip-all in cases where this is problematic.


From: Ludovic Courtès
Subject: 01/01: gnu: Don't use --strip-all in cases where this is problematic.
Date: Sun, 28 Dec 2014 22:47:14 +0000

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

commit f05bdc9412135f34a1c417edc203c35cd005d0d5
Author: Ludovic Courtès <address@hidden>
Date:   Sun Dec 28 23:46:59 2014 +0100

    gnu: Don't use --strip-all in cases where this is problematic.
    
    This is a followup to 856ae5e.  See <http://hydra.gnu.org/build/180506>
    for an example of build failure.
    
    * guix/build/gnu-build-system.scm (strip): Add #:archive-strip-flags
      parameter.  Use it when (ar-file? path).
    * guix/build-system/gnu.scm (gnu-build): Add #:archive-strip-flags
      parameter and pass it down.
    * gnu/packages/commencement.scm (gcc-boot0)[arguments]: Add
      #:strip-flags.
    * gnu/packages/base.scm (glibc)[arguments]: Likewise.
---
 gnu/packages/base.scm           |    3 +++
 gnu/packages/commencement.scm   |    4 ++++
 guix/build-system/gnu.scm       |    2 ++
 guix/build/gnu-build-system.scm |   11 ++++++++++-
 4 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 5bf27c9..b4f4d8e 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -421,6 +421,9 @@ included.")
             ;; XXX: Work around "undefined reference to `__stack_chk_guard'".
             "libc_cv_ssp=no")
 
+      ;; Using '--strip-all' on crt*.o breaks them.
+      #:strip-flags '("--strip-debug")
+
       #:tests? #f                                 ; XXX
       #:phases (alist-cons-before
                 'configure 'pre-configure
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 20831de..309e195 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -170,6 +170,10 @@ identifier SYSTEM."
                    (ice-9 regex)
                    (srfi srfi-1)
                    (srfi srfi-26))
+
+        ;; Using '--strip-all' leads to a link failure while building libc.
+        #:strip-flags '("--strip-debug")
+
         ,@(substitute-keyword-arguments (package-arguments gcc-4.8)
             ((#:configure-flags flags)
              `(append (list ,(string-append "--target=" (boot-triplet))
diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm
index f765a14..e2b41b1 100644
--- a/guix/build-system/gnu.scm
+++ b/guix/build-system/gnu.scm
@@ -275,6 +275,7 @@ standard packages used as implicit inputs of the GNU build 
system."
                     (patch-shebangs? #t)
                     (strip-binaries? #t)
                     (strip-flags ''("--strip-all"))
+                    (archive-strip-flags ''("--strip-debug"))
                     (strip-directories ''("lib" "lib64" "libexec"
                                           "bin" "sbin"))
                     (phases '%standard-phases)
@@ -338,6 +339,7 @@ are allowed to refer to."
                   #:patch-shebangs? ,patch-shebangs?
                   #:strip-binaries? ,strip-binaries?
                   #:strip-flags ,strip-flags
+                  #:archive-strip-flags ,archive-strip-flags
                   #:strip-directories ,strip-directories)))
 
   (define guile-for-build
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 11b43c5..a985b1c 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -298,6 +298,12 @@ makefiles."
                                      (string-append target "-objcopy")
                                      "objcopy"))
                 (strip-flags '("--strip-all"))
+
+                ;; Using '--strip-all' on .a file would remove the archive
+                ;; index, leading to "Archive has no index" errors when
+                ;; linking against them.
+                (archive-strip-flags '("--strip-debug"))
+
                 (strip-directories '("lib" "lib64" "libexec"
                                      "bin" "sbin"))
                 #:allow-other-keys)
@@ -353,7 +359,10 @@ makefiles."
                              (or (not debug-output)
                                  (make-debug-file path))
                              (zero? (apply system* strip-command
-                                           (append strip-flags (list path))))
+                                           (append (if (ar-file? path)
+                                                       archive-strip-flags
+                                                       strip-flags)
+                                                   (list path))))
                              (or (not debug-output)
                                  (add-debug-link path))))
                       (const #t)                  ; down



reply via email to

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