GNU bug report logs - #42555
[PATCH core-updates] build-system/gnu: strip with --strip-unneeded

Previous Next

Package: guix-patches;

Reported by: Jakub Kądziołka <kuba <at> kadziolka.net>

Date: Sun, 26 Jul 2020 23:40:01 UTC

Severity: normal

Tags: patch

Done: Jakub Kądziołka <kuba <at> kadziolka.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Jakub Kądziołka <kuba <at> kadziolka.net>
Subject: bug#42555: closed (Re: [bug#42555] [PATCH v2 core-updates]
 build-system/gnu: strip with --strip-unneeded)
Date: Sat, 19 Sep 2020 13:55:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#42555: [PATCH core-updates] build-system/gnu: strip with --strip-unneeded

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 42555 <at> debbugs.gnu.org.

-- 
42555: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=42555
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 42555 <at> debbugs.gnu.org, 42555-done <at> debbugs.gnu.org
Subject: Re: [bug#42555] [PATCH v2 core-updates] build-system/gnu: strip
 with --strip-unneeded
Date: Sat, 19 Sep 2020 15:49:31 +0200
On Sat Sep 19, 2020 at 4:49 PM CEST, Ludovic Courtès wrote:
> Hi Jakub,
>
> Jakub Kądziołka <kuba <at> kadziolka.net> skribis:
>
> > Apart from debug information, one can also strip some symbols. This can
> > be a significant difference, the closure of gcc-toolchain <at> 7 got reduced
> > by 15 MB in my tests.
>
> Nice! Now’s a good time to get that patch in on ‘core-updates’.

Thanks. Patch pushed (with a small hiccup...)

> > [1]: https://stackoverflow.com/a/52555093
>
> Perhaps we can omit this one. In general, I think it’s safer to refer
> to “primary sources” as Wikipedians would say.

The problem with "primary sources" is that the docs on this are quite
sparse. I think this link is much more comprehensive.

> > [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.
>
> LGTM!
>
> For the record, I tried ‘--strip-all’ before, but that was
> problematic
> for some reason:
>
> https://lists.gnu.org/archive/html/guix-devel/2018-03/msg00135.html

The docs for --strip-all say "Do not copy relocation and symbol
information", so I would expect some relocation and/or linking use case
to get broken...

Regards,
Jakub Kądziołka

[Message part 3 (message/rfc822, inline)]
From: Jakub Kądziołka <kuba <at> kadziolka.net>
To: guix-patches <at> gnu.org
Subject: [PATCH core-updates] build-system/gnu: strip with --strip-unneeded
Date: Mon, 27 Jul 2020 01:38:50 +0200
Apart from debug information, one can also strip some symbols. This can
be a significant difference, qtbase:out consists of about 5 MB of those
symbols. 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/gnu-build-system.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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.27.0




This bug report was last modified 4 years and 307 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.