From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id SC9WMoL+ZV8NeAAA0tVLHw (envelope-from ) for ; Sat, 19 Sep 2020 12:50:10 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id qEAqLoL+ZV93DwAAB5/wlQ (envelope-from ) for ; Sat, 19 Sep 2020 12:50:10 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 594B0940237 for ; Sat, 19 Sep 2020 12:50:10 +0000 (UTC) Received: from localhost ([::1]:52596 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kJcJc-0001Nh-Qi for larch@yhetil.org; Sat, 19 Sep 2020 08:50:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44560) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kJcJW-0001NT-2z for guix-patches@gnu.org; Sat, 19 Sep 2020 08:50:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34261) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kJcJV-0008WN-Ow for guix-patches@gnu.org; Sat, 19 Sep 2020 08:50:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kJcJV-0006pL-NT for guix-patches@gnu.org; Sat, 19 Sep 2020 08:50:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42555] [PATCH v2 core-updates] build-system/gnu: strip with --strip-unneeded Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 19 Sep 2020 12:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42555 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Cc: 42555@debbugs.gnu.org Received: via spool by 42555-submit@debbugs.gnu.org id=B42555.160051979826230 (code B ref 42555); Sat, 19 Sep 2020 12:50:01 +0000 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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?Q?K=C4=85dzio=C5=82ka?="'s 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: csLo15t5WBgK 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.