unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jakub Kądziołka" <kuba@kadziolka.net>
To: 42555@debbugs.gnu.org
Subject: [bug#42555] [PATCH v2 core-updates] build-system/gnu: strip with --strip-unneeded
Date: Thu, 30 Jul 2020 02:21:54 +0200	[thread overview]
Message-ID: <20200730002154.5704-1-kuba@kadziolka.net> (raw)
In-Reply-To: <20200726233850.12321-1-kuba@kadziolka.net>

Apart from debug information, one can also strip some symbols. This can
be a significant difference, the closure of gcc-toolchain@7 got reduced
by 15 MB in my tests.

As per [1], --strip-debug is included in --strip-unneeded, and
the debug files created also contain a copy of the information removed
by --strip-unneeded.

Linux From Scratch suggests that this option shouldn't be used on static
libraries [2], however other sources [3] indicate otherwise. Building a
toolchain with this patch succeeds, and the result works fine for
'gcc -static hello-world.c'.

[1]: https://stackoverflow.com/a/52555093
[2]: http://www.linuxfromscratch.org/lfs/view/9.1/chapter05/stripping.html
[3]: https://www.technovelty.org/linux/stripping-shared-libraries.html

* guix/build/gnu-build-system.scm (strip): Use --strip-unneeded.
* guix/build-system/gnu.scm (static-package, gnu-build, gnu-cross-build): Likewise.
---

I have realized that my previous patch was a no-op due to default values
for arguments being scattered across files. I ran my builds again and
now I can observe results in the earlier stages of the toolchain,
accessible to a testing core-updates build.

 guix/build-system/gnu.scm       | 6 +++---
 guix/build/gnu-build-system.scm | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/guix/build-system/gnu.scm b/guix/build-system/gnu.scm
index 6b481ad45c..2c23197e77 100644
--- a/guix/build-system/gnu.scm
+++ b/guix/build-system/gnu.scm
@@ -215,7 +215,7 @@ use `--strip-all' as the arguments to `strip'."
     (arguments
      (let ((a (default-keyword-arguments (package-arguments p)
                 '(#:configure-flags '()
-                  #:strip-flags '("--strip-debug")))))
+                  #:strip-flags '("--strip-unneeded")))))
        (substitute-keyword-arguments a
          ((#:configure-flags flags)
           `(cons* "--disable-shared" "LDFLAGS=-static" ,flags))
@@ -337,7 +337,7 @@ standard packages used as implicit inputs of the GNU build system."
                     (parallel-tests? #t)
                     (patch-shebangs? #t)
                     (strip-binaries? #t)
-                    (strip-flags ''("--strip-debug"
+                    (strip-flags ''("--strip-unneeded"
                                     "--enable-deterministic-archives"))
                     (strip-directories ''("lib" "lib64" "libexec"
                                           "bin" "sbin"))
@@ -492,7 +492,7 @@ is one of `host' or `target'."
                           (parallel-build? #t) (parallel-tests? #t)
                           (patch-shebangs? #t)
                           (strip-binaries? #t)
-                          (strip-flags ''("--strip-debug"
+                          (strip-flags ''("--strip-unneeded"
                                           "--enable-deterministic-archives"))
                           (strip-directories ''("lib" "lib64" "libexec"
                                                 "bin" "sbin"))
diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm
index 2e7dff2034..d3347c9518 100644
--- a/guix/build/gnu-build-system.scm
+++ b/guix/build/gnu-build-system.scm
@@ -425,7 +425,7 @@ makefiles."
                 (objcopy-command (if target
                                      (string-append target "-objcopy")
                                      "objcopy"))
-                (strip-flags '("--strip-debug"
+                (strip-flags '("--strip-unneeded"
                                "--enable-deterministic-archives"))
                 (strip-directories '("lib" "lib64" "libexec"
                                      "bin" "sbin"))
-- 
2.28.0





  reply	other threads:[~2020-07-30  0:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-26 23:38 [bug#42555] [PATCH core-updates] build-system/gnu: strip with --strip-unneeded Jakub Kądziołka
2020-07-30  0:21 ` Jakub Kądziołka [this message]
2020-09-19 12:49   ` [bug#42555] [PATCH v2 " Ludovic Courtès
2020-09-19 13:49     ` bug#42555: " Jakub Kądziołka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200730002154.5704-1-kuba@kadziolka.net \
    --to=kuba@kadziolka.net \
    --cc=42555@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).