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 ms0.migadu.com with LMTPS id gK4uEaxvnWEeTQAAgWs5BA (envelope-from ) for ; Tue, 23 Nov 2021 23:48:12 +0100 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 aArlDKxvnWHHWwAAB5/wlQ (envelope-from ) for ; Tue, 23 Nov 2021 22:48:12 +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 8FE742CF64 for ; Tue, 23 Nov 2021 23:48:11 +0100 (CET) Received: from localhost ([::1]:33836 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mpeaA-0004Mu-2k for larch@yhetil.org; Tue, 23 Nov 2021 17:48:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpea3-0004Mk-38 for guix-patches@gnu.org; Tue, 23 Nov 2021 17:48:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40890) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mpea2-0003cc-D6 for guix-patches@gnu.org; Tue, 23 Nov 2021 17:48:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mpea2-0000R1-4N for guix-patches@gnu.org; Tue, 23 Nov 2021 17:48:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52066] [PATCH, core-updates-frozen, RFC] Fix static guile on aarch64 Resent-From: Pierre Langlois Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 23 Nov 2021 22:48:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52066 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52066@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16377076341484 (code B ref -1); Tue, 23 Nov 2021 22:48:01 +0000 Received: (at submit) by debbugs.gnu.org; 23 Nov 2021 22:47:14 +0000 Received: from localhost ([127.0.0.1]:52436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpeZG-0000Ns-0l for submit@debbugs.gnu.org; Tue, 23 Nov 2021 17:47:14 -0500 Received: from lists.gnu.org ([209.51.188.17]:35494) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mpeZB-0000Nh-Ip for submit@debbugs.gnu.org; Tue, 23 Nov 2021 17:47:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpeZB-0004Kc-9f for guix-patches@gnu.org; Tue, 23 Nov 2021 17:47:09 -0500 Received: from mout.gmx.net ([212.227.17.20]:46577) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mpeZ8-0003ZE-Qf for guix-patches@gnu.org; Tue, 23 Nov 2021 17:47:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1637707623; bh=P3XNZtcTEzjpFZjlAiCWNkYwmaD5Bc0VlU0C8vicMWM=; h=X-UI-Sender-Class:From:To:Subject:Date; b=IMuVUoNi+JN8V5Dl1Ryp6pmTyoOH+72r8slGMlhus3Fhz1dKA9B788Vi8P0i6Soxw B0jFWnJoFz1QjVx7zLz/58kCs0Zc2NUooLsZTs1aT8ubgx/ULnoxFoDqQ3NJoXC+Wm Rozh0MgkZ484TUL41MwzYYiufyO3tAhiAojVoPoE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from labiere ([82.69.64.142]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MyKHc-1mQQcE3lc4-00yenu for ; Tue, 23 Nov 2021 23:47:03 +0100 User-agent: mu4e 1.6.10; emacs 27.2 From: Pierre Langlois Date: Tue, 23 Nov 2021 21:22:31 +0000 Message-ID: <878rxeebh6.fsf@gmx.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:kJyZaaKbtMQ8oWXrfb2wRpp0sJjb7EKXp9eF6QgLD4kBK3AyEjZ SshzooRSocLtM1JybesaWu6TvRd/Vr7ZxM3P0WErnm4qWTPBC62CSpSeR6i5vRtO2ZXCBqX Y3lLFeIJxup/+53Yy9TNDBeZN3hXNgaMDzOHua1QjN39AKc83yRP/huI6DwBoExDffSF93y QhtH+mFYJ8z8A9Uig6TQA== X-UI-Out-Filterresults: notjunk:1;V03:K0:ID7vJ/sa7Y0=:ZznK03hwXFiNfZ5c8rBta6 5JylDDCVqTk5IG4GThLQI3vQn7p8t8H4xEzxidCC97PLTQvnmiWUJNEqHDosbRru7UM7lmLMe UfZmEwsGMTAbwkED/sDwNVsNoQsTVVdbZRwvhY95pR4n3ERnCLGPzq5ajQK3JH4sCWRaWVYiT MBIexX7d6TCEhTGlE38yVm0D+hiw13zJXAi1vz58w0wv4z5HtOyVxi+sPFDp1NwSv6+Yw0f8p dPMZ7G87LQ9YUr6lHSMep7CE7GPJuwoD8Md/h6CXiib5PhrGdPtncLjZTqVDqu2G4jpxBX74Y j7A1VeHFC8nDvS8ePwHRXMf5n6ZgAT1WeDj6ZMlnasK0iz/7UXjPY7/rlP3o4b7ln8ZXTlDO7 7Naf7fd6nSloEILWZPHfpGj45Qp59QGtUOG9Nb6SB+7dAPFlZ7m+VuRujnRM9ihDi8qvj3Kzm prwqcmxJpttlEv2rncXxeoX/hLYmw9fUo0OtHNOgXhTJLaR88sd6yyFM6KGOxA6aUBAY9yD/e pQTaZAm4KYjrxRy5y8VMjXDQU/1Tkkr+YI25Rj9MNjl13LjfU0Gabstxoa2kxJwHrc8wPXlQB cU+Z64qDWslt4bTbfzzOb+ETfyhgtNftUFQSLdEC61xAnxsP2fx03NuIRtUw+65VOrSGsqJJ8 f7uc4zN45WLHtDASe1yijDpnQedY6uIRtQg1PtohNrovI3dwQPG2dOlQn22dkskmTKxD+YbEs 46N/odpMats+5d1xtXu0Ll+03Bb5yQ4lb8adI/98Om4NTMjTE44P+iEmi1tzJXqIdJN12Vtco BW+ZLVzEKZxPWJW0sjJ7hy0SPrwi6bUx59tP2BV0ymiGPnIXt9nVW0781gKjgPIyG3CM3KZdV WCRA/um+NtDlOJ2WQQSHSJXi0pYDTshnKUAlcZsAJXrc1K5DCXFEw7HllLrQcmRlGK+MqJhBD 7HeDtgslIAGRb2FhB1JZ3AK+wCnHKrmbt8wG7CJ9kIwNE9xRUpL787SMqg5hGVJCjMzfZURHc X7ovA2mF+xRscV7YbkPmKKlBQOP2KIN2sEz99tiBnhBQ8ibFbGKxaML2pk2bv5GkIS1S8ADMZ iSSIFgYoQ3WQdc= Received-SPF: pass client-ip=212.227.17.20; envelope-from=pierre.langlois@gmx.com; helo=mout.gmx.net 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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1637707691; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post:dkim-signature; bh=HfWSVb16BKVuSG97GOfc9SXPTDpg0znkQsZUOOvbcLs=; b=ge8OQv8AgTQfpFeU9c+23MxMoVo2k+kS0FfB50YASr6YerPkbiUf2sqpYtNx60UGIZL4P+ oqwBJOc4a7V+rXyuKuDcFMcw92KgbqhdX3Q1Te5wN9AtXTLQ8fpD0M4tg6Drv318bZIaDF TyoVxnfgI2Liw/nEIHII/qeX9MYdoCVILYA4TjGXrNIX0kQLg1AqW5+LNlu2jLupEayPAv EWuWw3diCymUvUh77c5RxHdfElAhUjwno7P7x1czIiXmRD86kTagjz3NgMwAqoW7u2SL06 YnSsYPV9NF893YU5rPfTieOVOnxmcNDZ1lmZomW8eZr4nNqAmvYK0ZS8sa0CEA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1637707692; a=rsa-sha256; cv=none; b=PqwUBi+1BQqwtSN/r3EosfGIaN94k0vzKifPfbDQ80NJNI9Irkl8oy+LI9+ObeRpnvb4Q9 AikJ1vQWqBahXD4RImSTSU1dh2wTpgrUjiPWOeaUR5TpZyuR69NAHbXH2q8vkmIafZHsiB 13AMVeGSOLu4hLPChaGIwAmjWO0+8DE4Q2LJ7ErvWifImc3eMzJIzQdzydBGDUtSHCLa5k q3Upmr9xZJg76qfNKZoY/Qt0hBDkyM8cGT1pUjpQeki4H+Of4F3+J2BUX0QvX+h/6kdpRE oDXSKeLvbAV8rCGQyZHH4dglozq+NQ3bVD0A79YS4rXJOOClWVY881YJLrgY9Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=IMuVUoNi; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=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-Migadu-Spam-Score: -1.59 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmx.net header.s=badeba3b8450 header.b=IMuVUoNi; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmx.com (policy=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-Migadu-Queue-Id: 8FE742CF64 X-Spam-Score: -1.59 X-Migadu-Scanner: scn1.migadu.com X-TUID: WWvLScrpLNwG --=-=-= Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" --==-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi Guix! With the recent call for testing on core-updates-frozen I thought I'd test my router configuration on the RockPro64 and I saw that building the stripped static guile for initrd didn't build. I found a fix but I'm not 100% sure it's correct, so beware, here's my debugging session! %guile-static-stripped fails to build as such: =2D-8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix build -e '(@ (gnu packages make-bootstrap) %guile-sta= tic-stripped)' ... Backtrace: 1 (primitive-load "/gnu/store/gz31w23fjaipnm9c9hzw6p8s619?") In guix/build/utils.scm: 761:6 0 (invoke "/gnu/store/9rwp8z98xdllih5rzf2ncq25xhnkgcvq-g?" ?) guix/build/utils.scm:761:6: In procedure invoke: ERROR: 1. &invoke-error: program: "/gnu/store/9rwp8z98xdllih5rzf2ncq25xhnkgcvq-guile-static-st= ripped-3.0.7/bin/guile" arguments: ("--version") exit-status: 127 term-signal: #f stop-signal: #f =2D-8<---------------cut here---------------end--------------->8--- The stripped guile crashes, and if we check it, it's actually not a static binary! So when stripping out store references we break it of course: =2D-8<---------------cut here---------------start------------->8--- $ file /gnu/store/9rwp8z98xdllih5rzf2ncq25xhnkgcvq-guile-static-stripped-3.= 0.7/bin/guile /gnu/store/9rwp8z98xdllih5rzf2ncq25xhnkgcvq-guile-static-stripped-3.0.7/bin= /guile: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /gnu/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee= -glibc-2.33/lib/ld-linux-aarch64.so.1, for GNU/Linux 2.6.32, stripped ^^^^^^^^ Oups :-) =2D-8<---------------cut here---------------end--------------->8--- The root of the issue seems to be that the make-guile-static procedure isn't actually producing a static binary on aarch64. Digging into it more, we do pass the -all-static flag to libtool, but the gcc command doesn't actually do any static linking: =2D-8<---------------cut here---------------start------------->8--- /tmp/guix-build-guile-static-3.0.7.drv-0/guile-3.0.7$ make V=3D1 ... ../libtool --tag=3DCC --mode=3Dlink gcc -std=3Dgnu11 -pthread -Wall -Wmi= ssing-prototypes -Wpointer-arith -fno-strict-aliasing -fwrapv -fvisibility= =3Dhidden -g -O2 -all-static -pthread -ldl -o guile guile-guile.o libguile-= 3.0.la -ldl -lcrypt -lm libtool: link: gcc -std=3Dgnu11 -pthread -Wall -Wmissing-prototypes -Wpoint= er-arith -fno-strict-aliasing -fwrapv -fvisibility=3Dhidden -g -O2 -pthread= -o guile guile-guile.o ./.libs/libguile-3.0.a -L/gnu/store/3539zsmc939g1r= 9g3r02bpy0m1b9v9c8-libgc-8.0.4/lib -L/gnu/store/sn95w7yk9qwxhw74l590606y53p= f5mkf-libffi-3.3/lib /gnu/store/3539zsmc939g1r9g3r02bpy0m1b9v9c8-libgc-8.0.= 4/lib/libgc.a -lpthread /gnu/store/sn95w7yk9qwxhw74l590606y53pf5mkf-libffi-= 3.3/lib/libffi.a -lunistring -ldl -lcrypt -lm -pthread =2D-8<---------------cut here---------------end--------------->8--- And if we try and do a static link anyway, it doens't work because of missing references related to atomic ops. My guess is that libtool tried to statically link, and fell back to dynamic linking when that didn't work, I'm not so sure. =2D-8<---------------cut here---------------start------------->8--- /tmp/guix-build-guile-static-3.0.7.drv-0/guile-3.0.7/libguile$ gcc -std=3Dg= nu11 -pthread -Wall -Wmissing-prototypes -Wpointer-arith -fno-strict-aliasi= ng -fwrapv -fvisibility=3Dhidden -g -O2 -pthread -o guile guile-guile.o ./= .libs/libguile-3.0.a -L/gnu/store/3539zsmc939g1 r9g3r02bpy0m1b9v9c8-libgc-8.0.4/lib -L/gnu/store/sn95w7yk9qwxhw74l590606y53= pf5mkf-libffi-3.3/lib /gnu/store/3539zsmc939g1r9g3r02bpy0m1b9v9c8-libgc-8.0= .4/lib/libgc.a -lpthread /gnu/store/sn95w7yk9qwxhw74l590606y53pf5mkf-libffi= -3.3/lib/libffi.a -lunistring -ldl -lcrypt -lm -p thread -static=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ld: ./.libs/libguile-3.0.a(libguile_3.0_la-dynl.o): in function `scm_dlopen= ':=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 /tmp/guix-build-guile-static-3.0.7.drv-0/guile-3.0.7/libguile/dynl.c:78: wa= rning: Using 'dlopen' in statically linked applications requires at runtime= the shared libraries from the glibc version used for linking=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20 ld: ./.libs/libguile-3.0.a(libguile_3.0_la-posix.o): in function `scm_tmpna= m':=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 /tmp/guix-build-guile-static-3.0.7.drv-0/guile-3.0.7/libguile/posix.c:1611:= warning: the use of `tmpnam' is dangerous, better use `mkstemp'=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20 ld: /gnu/store/b05hb686wamq78d5jzpisns9xdx6nkp2-glibc-2.33-static/lib/libc.= a(abort.o): in function `abort':=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 (.text.unlikely+0x34): undefined reference to `__aarch64_cas4_acq'=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 ld: (.text.unlikely+0xa0): undefined reference to `__aarch64_swp4_rel'=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 ld: (.text.unlikely+0xe4): undefined reference to `__aarch64_cas4_acq'=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20 ld: /gnu/store/b05hb686wamq78d5jzpisns9xdx6nkp2-glibc-2.33-static/lib/libpt= hread.a(pthread_create.o):(.text+0x5c): undefined reference to `__aarch64_c= as4_acq'=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ld: /gnu/store/b05hb686wamq78d5jzpisns9xdx6nkp2-glibc-2.33-static/lib/libpt= hread.a(pthread_create.o):(.text+0x1fc): undefined reference to `__aarch64_= cas4_acq'=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ld: /gnu/store/b05hb686wamq78d5jzpisns9xdx6nkp2-glibc-2.33-static/lib/libpt= hread.a(pthread_create.o):(.text+0x29c): undefined reference to `__aarch64_= cas4_acq'=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 ... =2D-8<---------------cut here---------------end--------------->8--- Doing more digging, I found a reference to a similar issue here: https://bugzilla.redhat.com/show_bug.cgi?id=3D1830472#c1, this looks related to the -moutline-atomics option that's enabled by default with GCC 10. But we're building guile with GCC 7 so it was a bit confusing. However, glibc here is actually built with the default GCC 10, and if we change that then it works! =2D-8<---------------cut here---------------start------------->8--- =2D-- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -85,6 +85,9 @@ (define glibc-for-bootstrap `(cons* "--disable-nscd" "--disable-build-nscd" "--enable-static-nss" ,flags)))) + (native-inputs + `(("gcc" ,gcc-7) + ,@(package-native-inputs base))) =20 ;; Remove the 'debug' output to allow bit-reproducible builds (when = the ;; 'debug' output is used, ELF files end up with a .gnu_debuglink, w= hich =2D-8<---------------cut here---------------end--------------->8--- I'm not 100% sure what's going on, there seems to be an incompatiblity between GCC 7 and 10, but I don't know if this is a bug or if it's working as intended. I have a feeling statically linking the libc with different compiler version might just not be supported, but it works in practise a lot of the time. Does this make sense? Do you think the following patch would be the right way to fix this? Thanks! Pierre --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmGdb2UYHHBpZXJyZS5s YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31UQGQH/iLPGyFADQ5f3fCC/A8waA2Z N0kDe1PCST69FGjwOX8QZSgL25dl+QmEduiZ2/Zz+sKQRMc7cBkfHkW/HtUvII6i KwwCUjR52Z2g3OxPosnbFo9EZkhDgXFGsg8BtmPmjmY+hHKw9rJPIWw7yUmZrk0a +YL1tAYu/eFvORZSLrEP+95wZqqS8kSNGSEN7iC6kMaGeb1xCuJOH2Cv5bA1D0He 7QidpDr9HVe47sqk6PYOhmCxm8/wrnIL6Hj0T3J7WrByhWLWFmb1hexuCrBEmz+G FB11vS38ZGPMe3RN+ojrfaDxXmUJPlT7X6ax9n4QNChw4ljBLrS3rHQQYiM+Llc= =aeET -----END PGP SIGNATURE----- --==-=-=-- --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-gnu-glibc-for-bootstrap-Build-with-GCC-7.patch Content-Transfer-Encoding: quoted-printable =46rom c1f61c161b3f5f7e8430c4925b0785d3819e255e Mon Sep 17 00:00:00 2001 From: Pierre Langlois Date: Tue, 23 Nov 2021 22:41:20 +0000 Subject: [PATCH] gnu: glibc-for-bootstrap: Build with GCC 7. * gnu/packages/make-bootstrap.scm (glibc-for-bootstrap)[native-inputs]: Add gcc-7. =2D-- gnu/packages/make-bootstrap.scm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap= .scm index 267adde48c..d8f1f0eb1e 100644 =2D-- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -86,6 +86,12 @@ (define glibc-for-bootstrap "--enable-static-nss" ,flags)))) + ;; Make sure to build glibc with the same compiler version with the= rest + ;; of the bootstrap. Otherwise it fails to statically link on aarc= h64. + (native-inputs + `(("gcc" ,gcc-7) + ,@(package-native-inputs base))) + ;; Remove the 'debug' output to allow bit-reproducible builds (when= the ;; 'debug' output is used, ELF files end up with a .gnu_debuglink, = which ;; includes a CRC of the corresponding debugging symbols; those sym= bols =2D- 2.34.0 --=-=-=--