From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 26 19:39:04 2020 Received: (at submit) by debbugs.gnu.org; 26 Jul 2020 23:39:04 +0000 Received: from localhost ([127.0.0.1]:53563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jzqES-0004HU-7Y for submit@debbugs.gnu.org; Sun, 26 Jul 2020 19:39:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:44582) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jzqEQ-0004HD-1f for submit@debbugs.gnu.org; Sun, 26 Jul 2020 19:39:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:56214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jzqEP-0000W4-Nq for guix-patches@gnu.org; Sun, 26 Jul 2020 19:39:01 -0400 Received: from pat.zlotemysli.pl ([37.59.186.212]:50178) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jzqEN-00027D-BZ for guix-patches@gnu.org; Sun, 26 Jul 2020 19:39:01 -0400 Received: (qmail 13673 invoked by uid 1009); 27 Jul 2020 01:38:56 +0200 Received: from 83.22.51.66.ipv4.supernova.orange.pl (kuba@kadziolka.net@83.22.51.66.ipv4.supernova.orange.pl) by pat.zlotemysli.pl (envelope-from , uid 1002) with qmail-scanner-2.08st (clamdscan: 0.98.6/25884. spamassassin: 3.4.0. perlscan: 2.08st. Clear:RC:1(83.22.51.66):. Processed in 0.055554 secs); 26 Jul 2020 23:38:56 -0000 Received: from 83.22.51.66.ipv4.supernova.orange.pl (HELO localhost.localdomain) (kuba@kadziolka.net@83.22.51.66) by pat.zlotemysli.pl with AES256-SHA encrypted SMTP; 27 Jul 2020 01:38:56 +0200 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= To: guix-patches@gnu.org Subject: [PATCH core-updates] build-system/gnu: strip with --strip-unneeded Date: Mon, 27 Jul 2020 01:38:50 +0200 Message-Id: <20200726233850.12321-1-kuba@kadziolka.net> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Qmailux-2.08st: added fake Content-Type header Content-Type: text/plain Received-SPF: none client-ip=37.59.186.212; envelope-from=kuba@kadziolka.net; helo=pat.zlotemysli.pl X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/26 19:19:28 X-ACL-Warn: Detected OS = Linux 3.11 and newer X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_NONE=0.001, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 29 20:22:11 2020 Received: (at 42555) by debbugs.gnu.org; 30 Jul 2020 00:22:11 +0000 Received: from localhost ([127.0.0.1]:34027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0wKp-00047o-Fo for submit@debbugs.gnu.org; Wed, 29 Jul 2020 20:22:11 -0400 Received: from pat.zlotemysli.pl ([37.59.186.212]:51898) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k0wKm-00047a-15 for 42555@debbugs.gnu.org; Wed, 29 Jul 2020 20:22:09 -0400 Received: (qmail 14182 invoked by uid 1009); 30 Jul 2020 02:22:05 +0200 Received: from 188.123.215.55 (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl (envelope-from , uid 1002) with qmail-scanner-2.08st (clamdscan: 0.98.6/25887. spamassassin: 3.4.0. perlscan: 2.08st. Clear:RC:1(188.123.215.55):. Processed in 0.056218 secs); 30 Jul 2020 00:22:05 -0000 Received: from unknown (HELO localhost.localdomain) (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl with AES256-SHA encrypted SMTP; 30 Jul 2020 02:22:05 +0200 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= To: 42555@debbugs.gnu.org Subject: [PATCH v2 core-updates] build-system/gnu: strip with --strip-unneeded Date: Thu, 30 Jul 2020 02:21:54 +0200 Message-Id: <20200730002154.5704-1-kuba@kadziolka.net> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Qmailux-2.08st: added fake Content-Type header Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 42555 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) 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 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 19 08:49:58 2020 Received: (at 42555) by debbugs.gnu.org; 19 Sep 2020 12:49:58 +0000 Received: from localhost ([127.0.0.1]:45807 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJcJO-0006ov-Em for submit@debbugs.gnu.org; Sat, 19 Sep 2020 08:49:58 -0400 Received: from eggs.gnu.org ([209.51.188.92]:37710) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJcJJ-0006og-Ru for 42555@debbugs.gnu.org; Sat, 19 Sep 2020 08:49:52 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:43767) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJcJD-0008Vq-F1; Sat, 19 Sep 2020 08:49:43 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=47258 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kJcJD-0006o5-2v; Sat, 19 Sep 2020 08:49:43 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Jakub =?utf-8?B?S8SFZHppb8WCa2E=?= Subject: Re: [bug#42555] [PATCH v2 core-updates] build-system/gnu: strip with --strip-unneeded References: <20200726233850.12321-1-kuba@kadziolka.net> <20200730002154.5704-1-kuba@kadziolka.net> Date: Sat, 19 Sep 2020 14:49:41 +0200 In-Reply-To: <20200730002154.5704-1-kuba@kadziolka.net> ("Jakub =?utf-8?B?S8SFZHppb8WCa2EiJ3M=?= message of "Thu, 30 Jul 2020 02:21:54 +0200") Message-ID: <87o8m2q6ca.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 42555 Cc: 42555@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Jakub, Jakub K=C4=85dzio=C5=82ka skribis: > 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. Nice! Now=E2=80=99s a good time to get that patch in on =E2=80=98core-upda= tes=E2=80=99. > 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. Hmm the Binutils manual suggests otherwise (info "(binutils) objcopy"): --8<---------------cut here---------------start------------->8--- '-g' '--strip-debug' Do not copy debugging symbols or sections from the source file. '--strip-unneeded' Strip all symbols that are not needed for relocation processing. --8<---------------cut here---------------end--------------->8--- =E2=80=A6 but objcopy.c reads this: --8<---------------cut here---------------start------------->8--- else if ((flags & BSF_DEBUGGING) !=3D 0) /* Debugging symbol. */ keep =3D (strip_symbols !=3D STRIP_DEBUG && strip_symbols !=3D STRIP_UNNEEDED && ! convert_debugging); --8<---------------cut here---------------end--------------->8--- =E2=80=A6 confirming that =E2=80=98--strip-unneeded=E2=80=99 includes =E2= =80=98--strip-debug=E2=80=99. I submitted a patch for the Binutils manual. > 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'. OK. > [1]: https://stackoverflow.com/a/52555093 Perhaps we can omit this one. In general, I think it=E2=80=99s safer to re= fer to =E2=80=9Cprimary sources=E2=80=9D as Wikipedians would say. > [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 =E2=80=98--strip-all=E2=80=99 before, but that was = problematic for some reason: https://lists.gnu.org/archive/html/guix-devel/2018-03/msg00135.html Thanks, Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 19 09:54:07 2020 Received: (at 42555) by debbugs.gnu.org; 19 Sep 2020 13:54:07 +0000 Received: from localhost ([127.0.0.1]:45840 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJdJT-00020m-VM for submit@debbugs.gnu.org; Sat, 19 Sep 2020 09:54:07 -0400 Received: from pat.zlotemysli.pl ([37.59.186.212]:40550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kJdJN-00020A-Rj for 42555@debbugs.gnu.org; Sat, 19 Sep 2020 09:54:00 -0400 Received: (qmail 1895 invoked by uid 1009); 19 Sep 2020 15:53:55 +0200 Received: from 188.123.215.55 (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl (envelope-from , uid 1002) with qmail-scanner-2.08st (clamdscan: 0.98.6/25932. spamassassin: 3.4.0. perlscan: 2.08st. Clear:RC:1(188.123.215.55):. Processed in 0.045518 secs); 19 Sep 2020 13:53:55 -0000 Received: from unknown (HELO localhost) (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl with SMTP; 19 Sep 2020 15:53:55 +0200 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Subject: Re: [bug#42555] [PATCH v2 core-updates] build-system/gnu: strip with --strip-unneeded From: =?utf-8?q?Jakub_K=C4=85dzio=C5=82ka?= To: =?utf-8?q?Ludovic_Court=C3=A8s?= Date: Sat, 19 Sep 2020 15:49:31 +0200 Message-Id: In-Reply-To: <87o8m2q6ca.fsf@gnu.org> X-Qmailux-2.08st: added fake MIME-Version header MIME-Version: 1.0 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 42555 Cc: 42555@debbugs.gnu.org, 42555-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On Sat Sep 19, 2020 at 4:49 PM CEST, Ludovic Court=C3=A8s wrote: > Hi Jakub, > > Jakub K=C4=85dzio=C5=82ka skribis: > > > 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. > > Nice! Now=E2=80=99s a good time to get that patch in on =E2=80=98core-upd= ates=E2=80=99. Thanks. Patch pushed (with a small hiccup...) > > [1]: https://stackoverflow.com/a/52555093 > > Perhaps we can omit this one. In general, I think it=E2=80=99s safer to r= efer > to =E2=80=9Cprimary sources=E2=80=9D 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.h= tml > > [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 =E2=80=98--strip-all=E2=80=99 before, but that wa= s > 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=C4=85dzio=C5=82ka From unknown Wed Aug 20 05:15:52 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 18 Oct 2020 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator