From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 26 15:50:34 2023 Received: (at submit) by debbugs.gnu.org; 26 Jan 2023 20:50:34 +0000 Received: from localhost ([127.0.0.1]:36315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pL9Cb-00039P-IE for submit@debbugs.gnu.org; Thu, 26 Jan 2023 15:50:33 -0500 Received: from lists.gnu.org ([209.51.188.17]:33318) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pL9CZ-00039H-A6 for submit@debbugs.gnu.org; Thu, 26 Jan 2023 15:50:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pL9CW-00081G-R0 for bug-guile@gnu.org; Thu, 26 Jan 2023 15:50:30 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pL9CV-0007vk-65 for bug-guile@gnu.org; Thu, 26 Jan 2023 15:50:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=bTNCTSd5nxo+vb2f1C8/QF3s+34UqyHoaZe3cW3MCHM=; b=kcfUcgYBanLYel 5CmK2AzMECL0+7dqyoz+yCQkQlV6xAertl6Vv/WAtOE5MT/gX4EdQC1zAoXUy/u+2uBGoGuXEJ5eR Z7F+jeslRPqN1knX340ZhBH2xbJWKDqELHwnRtgr2rijxFhpe7tcrv7k1Y619P/ON6Gs3ZpJ/hrsu 9NgEpEGm0edsNiacnAvbTTqVC7uU3e1I9iXUKRk90zui2hC07oi5gceXa20E2P4/VJ2RbL6M6dCK6 JzSE7F43m3qhi8tE9uUdVo0zAIZPz4Ufg3JM+3W0AHtAjRpqTvRfCQGUFUaBnY8BcTTpW046hl0j5 0vdtG0g12N05qwnmllGw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pL9CT-0005pJ-W7 for bug-guile@gnu.org; Thu, 26 Jan 2023 15:50:26 -0500 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guile@gnu.org Subject: [3.0.9] Wrong =?utf-8?B?4oCYQVLigJk=?= value in =?utf-8?Q?=E2=80=98--enable-lto=E2=80=99?= builds X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Septidi 7 =?utf-8?Q?Pluvi=C3=B4se?= an 231 de la =?utf-8?Q?R=C3=A9volution=2C?= jour de l'Amadouvier X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Thu, 26 Jan 2023 21:50:23 +0100 Message-ID: <875yctnhps.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (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: 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 (---) In 3.0.9, =E2=80=98configure --enable-lto=E2=80=99 goes like this: --8<---------------cut here---------------start------------->8--- checking for ar... ar checking the archiver (ar) interface... ar checking for ar... (cached) ar checking for ranlib... ranlib checking for gcc option to enable large file support... none needed configure: autobuild project... GNU Guile configure: autobuild revision... 3.0.9 ./configure: line 8292: hostname: command not found configure: autobuild timestamp... 20230126T203648Z checking whether the compiler supports -flto... yes checking for lto-specific prefix for ar, nm, objcopy, ranlib... gcc checking for gcc-nm... gcc-nm checking for gcc-objcopy... no checking for objcopy... objcopy checking compiler's C standard... c11 --8<---------------cut here---------------end--------------->8--- Notice that there=E2=80=99s no line for =E2=80=98gcc-ar=E2=80=99. =E2=80= =98configure.ac=E2=80=99 reads this: --8<---------------cut here---------------start------------->8--- AC_MSG_CHECKING([for lto-specific prefix for ar, nm, objcopy, ranlib]) if test "$GCC" =3D yes; then TOOLCHAIN_PREFIX=3Dgcc else # Assuming LLVM if not GCC. Probably won't hurt. TOOLCHAIN_PREFIX=3Dllvm fi AC_MSG_RESULT([$TOOLCHAIN_PREFIX]) AC_CHECK_TOOLS([AR], [$TOOLCHAIN_PREFIX-ar ar]) AC_CHECK_TOOLS([NM], [$TOOLCHAIN_PREFIX-nm nm]) AC_CHECK_TOOLS([OBJCOPY], [$TOOLCHAIN_PREFIX-objcopy objcopy]) AC_CHECK_TOOLS([RANLIB], [$TOOLCHAIN_PREFIX-ranlib ranlib]) --8<---------------cut here---------------end--------------->8--- =E2=80=A6 but here the =E2=80=98AR=E2=80=99 and =E2=80=98RANLIB=E2=80=99 bi= ts are omitted, because their value were already computed earlier. Contrast with 3.0.8, where the LTO tool search happened before: --8<---------------cut here---------------start------------->8--- checking dependency style of gcc... gcc3 checking whether the compiler supports -flto... yes checking for lto-specific prefix for ar, nm, objcopy, ranlib... gcc checking for gcc-ar... gcc-ar checking for gcc-nm... gcc-nm checking for gcc-objcopy... no checking for objcopy... objcopy checking for gcc-ranlib... gcc-ranlib checking how to enable C11 support... -std=3Dgnu11 [...] checking for Minix Amsterdam compiler... no checking the archiver (gcc-ar) interface... ar checking for ar... (cached) gcc-ar checking for special C compiler options needed for large files... no --8<---------------cut here---------------end--------------->8--- The effect is that 3.0.9 fails to build when doing a static build as with (@ (gnu packages make-bootstrap) %guile-static-3.0) in Guix: --8<---------------cut here---------------start------------->8--- CCLD libguile-3.0.la ar: libguile_3.0_la-alist.o: plugin needed to handle lto object ranlib: .libs/libguile-3.0.a(libguile_3.0_la-alist.o): plugin needed to han= dle lto object CCLD guile ld: /tmp/guix-build-guile-static-3.0.9.drv-0/ccQkracO.ltrans0.ltrans.o: in = function `inner_main': /tmp/guix-build-guile-static-3.0.9.drv-0/guile-3.0.9/libguile/guile.c:50: u= ndefined reference to `scm_shell' ld: /tmp/guix-build-guile-static-3.0.9.drv-0/ccQkracO.ltrans0.ltrans.o: in = function `main': /tmp/guix-build-guile-static-3.0.9.drv-0/guile-3.0.9/libguile/guile.c:94: u= ndefined reference to `scm_boot_guile' collect2: error: ld returned 1 exit status --8<---------------cut here---------------end--------------->8--- (Notice the =E2=80=9Cplugin needed=E2=80=9D message, due to the fact that w= e=E2=80=99re using =E2=80=98ranlib=E2=80=99 instead of =E2=80=98gcc-ranlib=E2=80=99.) This may be a side effect of aeb22f486139f457ae7fc44c2d931312aaae52d8, which moved =E2=80=98gl_EARLY=E2=80=99 earlier (not surprisingly). Ludo=E2=80=99.