From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id QAE/IEHROGfZOQEAqHPOHw:P1 (envelope-from ) for ; Sat, 16 Nov 2024 17:07:13 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id QAE/IEHROGfZOQEAqHPOHw (envelope-from ) for ; Sat, 16 Nov 2024 18:07:13 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=NBfhJHEf; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="CZer/yzd"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1731776833; a=rsa-sha256; cv=none; b=RCuEu9X6s3Xa7qzSp3ReWy+LrTVIpIumWocrj15n97/wFa5ncMNuP8t+2Yk79hUtcqjbqK FpJ/aojEXaz16AeD0tKM6yznNOA8eI3UqHgXtHq80XQQssueRZmvIHhm6XDCe7+vYFMuuU UQxGFdQEtSNpQcMPkC1b5ZTJ5nX/KjYDKeoqv8OfPZGiEajoDkg3K7oHth03b4eShrJlbY mfkJp1uJ+tuZmjHZDUxxx7j965P7AY4NqAj6Bs2Mgt6mTRk9srcA50wmikUYe91a2Y7/Mj oGgLquy4BbyFBY8XF17EIEjaAP71+kQ650bphc+NDOfiACNKsvFVsjPWnJxi5Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=NBfhJHEf; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b="CZer/yzd"; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1731776833; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=jjjMitwnSElSq1/pqoO4RXytQ2kcbsaEXswq3CxsvmA=; b=PJTEYy3guUrg8HeDr5Wm9AGYAlnalN2SY0zuUkjTiMWksZAQgapGGbm33JivSFZ/k6nOUV x8UxMRv+TWdM/nHWl2ViNwFckdOWUu7rMcX+9opZ0hZzdEAKCDJrUKTNYZ9hNifI+utJl4 0u1MtCKY1uMLEqBLMzLOgiQ/uxm/QJ69+TX0BxRCuaITALV7NY8XBPOPlByamkcotwbkCI wNuPIDTznLtbi1esMUpwv1THUyW2ObYygsQgUb78MLhAxPiv4YkUzJfWFkJXPnrqzYuuY7 8BT7RpuDzEE03VcJgkhKXp4uE1h/XN/7G52vtyTa/t1lqY8x345cxzWPqYYSfQ== 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 1F1398103D for ; Sat, 16 Nov 2024 18:07:11 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tCMFO-00037T-Hr; Sat, 16 Nov 2024 12:06:10 -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 1tCMFG-00036m-VQ for bug-guix@gnu.org; Sat, 16 Nov 2024 12:06:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tCMFG-000157-Mi for bug-guix@gnu.org; Sat, 16 Nov 2024 12:06:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:MIME-Version:References:From:Date:To:Subject; bh=jjjMitwnSElSq1/pqoO4RXytQ2kcbsaEXswq3CxsvmA=; b=NBfhJHEfWbWbVgAT/dMrlaTV0wEvBpA5ktYSJgHFeB0hRXuY2d3uRCVFTqvGaYT9i3wAyuJyumxfFfxqtGckfkAHr911T+5itNNDFAw0K9apex/9bmjqfeO8HJgcQuvKd2JWH0BjhrxNTRci0kgQ5Tp5n41ran0aQg+OQutWN0wOYP2ylY1XNgclYvZ+MlUYkl1+RnihNo8LZ1k5Z+blrdodQAi4dx6xexlD7wmcJutRINmpLGRyuy+gH1lQIqJJQ9MpatWoufsS5PPtLefvpN1M9fMUIkEfsjcZseTxw5vxpJUJbHkRYguiAgr6uBZQPapkkkBoWtSx+AhUqnAHeA==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tCMFF-000526-U4; Sat, 16 Nov 2024 12:06:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#74217: Bootstrapping Zig with no Binary Blobs Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org, Ekaitz Zarraga Resent-Date: Sat, 16 Nov 2024 17:06:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74217 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Hilton Chain Cc: Motiejus =?UTF-8?Q?Jak=C5=A1tys?= , =?UTF-8?Q?No=C3=A9?= Lopez , dan , Ekaitz Zarraga , 74217@debbugs.gnu.org Received: via spool by 74217-submit@debbugs.gnu.org id=B74217.173177670719035 (code B ref 74217); Sat, 16 Nov 2024 17:06:01 +0000 Received: (at 74217) by debbugs.gnu.org; 16 Nov 2024 17:05:07 +0000 Received: from localhost ([127.0.0.1]:54593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCMEM-0004wu-Ii for submit@debbugs.gnu.org; Sat, 16 Nov 2024 12:05:07 -0500 Received: from mail-wm1-f48.google.com ([209.85.128.48]:46101) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tCMEJ-0004ux-Bb for 74217@debbugs.gnu.org; Sat, 16 Nov 2024 12:05:05 -0500 Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4315baa51d8so14837655e9.0 for <74217@debbugs.gnu.org>; Sat, 16 Nov 2024 09:05:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1731776642; x=1732381442; darn=debbugs.gnu.org; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=jjjMitwnSElSq1/pqoO4RXytQ2kcbsaEXswq3CxsvmA=; b=CZer/yzd9ADLxWbjtPr0x+As506EOtJn/XGQoFAuM3ELAZ0vpui2GkuBxjn14uTN/6 xYb0YJhiPSf1Ry1wVn1ugakOGGNmHuaorUjpg0Q9hZ658LqqI5cmnitv9hToL1AGzeCh pOa7+F2MluIs7Z1ABDojB2BlVkVF34pS+ecf2bKUVE045lb6KS3OVnxJOiLoOJjMa8K6 eLa70JxU9aihntIXVF1plfOkKf0csBlCvnNsl+f1H3RhzhxcQ8XWjOK5TCBnIQIecbpm Fz9+opNnXnw6zChh3uJgBXP9JoM4Hsi/Ox1u8N9hU36SW0kjEI5yTuP6lIZJS5e7RUnV pUlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731776642; x=1732381442; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=jjjMitwnSElSq1/pqoO4RXytQ2kcbsaEXswq3CxsvmA=; b=F6k2M/x3zy7IldS5SdNttQDAwAGTT+3oOZdl68ft2pTv33bCuVmNO+S6Dujx8mVpqs Ud5Zy2BEYMNkPm1FRxwmm5uJ4mdERcHudXRYCaJmG9jNfVh408kiu7hlfHrISwHXbTUO eHoDROU8UTboFeaR6hCIJQmWpiPCc9H6F1/ygONmASgYysAZAYZwcnTtKKuCQt4u1h8u bi27LpCIsSPau5xMW4LvF7KztmsXuo/Qo2LFH/KaCF5z+kIlJ9E358fX4ShgLnXcao+n pUnVvjNU6DuVK8Aqhvh6VDH9voV/Adv8W2jtdsMj7wno7FG5NX8va31KWY+3jjyjRSXA Ylgw== X-Gm-Message-State: AOJu0Yzj3v2rY79+FAVvKuU0fgMBDHmy8Ivoh8QflirNyuWR0c0Qyj0Q HEjzV8itYU2nZerXXGf3HI+mrpHWXkCJ5m6uF/4yaqxD/4plsSTB X-Google-Smtp-Source: AGHT+IFJHHi+TwHcrNPHwPKmrDnlh2bebj0by44FuzGfWdWJld2bxtY7/DnnvSR8/uQ+RJjUDRBMRg== X-Received: by 2002:a05:6000:18af:b0:37d:4ef1:1820 with SMTP id ffacd0b85a97d-38225a91e80mr5668385f8f.40.1731776642218; Sat, 16 Nov 2024 09:04:02 -0800 (PST) Received: from localhost ([31.210.180.118]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3822eb34170sm3774311f8f.11.2024.11.16.09.04.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Nov 2024 09:04:01 -0800 (PST) Date: Sat, 16 Nov 2024 19:03:59 +0200 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Hilton Chain , 74217@debbugs.gnu.org, Motiejus =?UTF-8?Q?Jak=C5=A1tys?= , =?UTF-8?Q?No=C3=A9?= Lopez , dan , Ekaitz Zarraga References: <87ldxngjy4.wl-hako@ultrarare.space> <878qtmvh2i.wl-hako@ultrarare.space> <877c96vd3u.wl-hako@ultrarare.space> <874j4auz7j.wl-hako@ultrarare.space> <87v7wqtbjq.wl-hako@ultrarare.space> <878qtl5g55.wl-hako@ultrarare.space> <87jzd47enj.wl-hako@ultrarare.space> <87iksn7jnk.wl-hako@ultrarare.space> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="I7I5RvsaNhwjmeFO" Content-Disposition: inline In-Reply-To: <87iksn7jnk.wl-hako@ultrarare.space> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.68 X-Spam-Score: -4.68 X-Migadu-Queue-Id: 1F1398103D X-Migadu-Scanner: mx12.migadu.com X-TUID: b0p8sW3aYr5C --I7I5RvsaNhwjmeFO Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Nov 16, 2024 at 02:54:55PM +0800, Hilton Chain wrote: > On Fri, 15 Nov 2024 22:30:40 +0800, > Hilton Chain wrote: > > > > I have locally made the "use-system-paths" patch larger so that Zig can= really > > honor "CROSS_" environment variables. > > > > The next issue is cross building with pkg-config. Zig only invokes > > "pkg-config", but we don't have a "pkg-config" with search path for tar= get > > inputs. I can add a pkg-config-for-zig to workaround this, and then...= It's > > dynamic linker path, I'll look into it soon. I tried adding pkg-config-for-build as a work-around but it wasn't enough without touching the zig compiler's source too, which I didn't attempt yesterday. > Adding a file with content like the following and passing --libc to > zig works, RUNPATH is correct and no need to set CC then. >=20 > --8<---------------cut here---------------start------------->8--- > include_dir=3D/gnu/store/dfx90sc16nphh6bd07sjyri6x4s51zni-glibc-cross-aar= ch64-linux-gnu-2.39/include > sys_include_dir=3D/gnu/store/dfx90sc16nphh6bd07sjyri6x4s51zni-glibc-cross= -aarch64-linux-gnu-2.39/include > crt_dir=3D/gnu/store/dfx90sc16nphh6bd07sjyri6x4s51zni-glibc-cross-aarch64= -linux-gnu-2.39/lib > msvc_lib_dir=3D > kernel32_lib_dir=3D > gcc_dir=3D > --8<---------------cut here---------------end--------------->8--- Is this the layout of the file expected? That doesn't look too hard to create in the build-system if necessary. > For cross builds interpreter path like /lib/ld-linux-aarch64.so.1 is used= in > output binary, I'll find a way to fix it. I was going to say to take a look at gcc-2.95, where we point all the linkers for all the architectures to whatever the target architecture is, but that won't work here since we have 1 zig binary and it can compile for any architecture. I'm going to suggest against adding a cross-libc for all the different architectures as an input, that would be crazy. (ins)efraim@3900XT ~/workspace/zig$ git grep 'ld-linux-aarch64.so.1' lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h:#define LD_LINUX_AA= RCH64_SO "ld-linux-aarch64.so.1" lib/libc/include/aarch64-linux-gnu/gnu/lib-names-lp64.h:#define LD_SO = "ld-linux-aarch64.so.1" lib/std/Build.zig:/// that contains the path `aarch64-linux-gnu/lib/ld-linu= x-aarch64.so.1`. lib/std/Target.zig: .aarch64 =3D> init("/lib/ld-linux-aarch6= 4.so.1"), Binary file stage1/zig1.wasm matches Would it be possible to change the init("/path/to/ld.so") part to the zig equivalent of (search-input-file inputs "/path/to/ld.so"), and then when it is used from Guix the cross-libc will already be in the PATH and therefore findable from zig's search through the vector=C2=B9 of the paths inside PATH? =C2=B9 I know it's not true but in my mind a vector and an array are the sa= me thing. > > Also for reproducibility, bin/zig is the only file differs and here's t= he diff, > > I don't know about this part so I currently have no idea on fixing it. >=20 > This seem to be an upstream issue, Zig is reproducible only on the same m= achine. > I'll verify it and report to upstream. --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --I7I5RvsaNhwjmeFO Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmc40HwACgkQQarn3Mo9 g1FDKBAAsOjAtHrgqW3V3e2O+kURryk4zOC+D7b18vVDbz4vygQnJ5ysG2lAZyXl 8X/C9Yzffu5LAwXZbW2cS+HZXi+URXLxzfXwXblxGhGd0C6Qc/FK5N6K+loCnG7p R628weaFJuvQuGouu+0oa99wgmQjAYBYq5n+laPCvw6BOx5lAIilBjJcPk6Qf892 PId6I0P6TPs+MxRrWuKpVpMPh2/Su5PnH10qcHW3zSAQ81z08lvYGSBQB1y1ZLik 2/obfqjHhVz7HV4WTN/ysyqkot0JH5r1tG0RWwB0IGooX8audRG6anZiyHzKYpp8 h45JVbeIAgiFL20ka92GS4nXGxDeToJEDCpPFctDWCvnHwbYXa2v9aHVx+liJyTw +WAwMKKQ713LaNQVMaFvlSg5frTKLwqzw6r7MIVMZqakm4z9HbqH2i+uYPkNAwWc CMHvWEidwA7+KNQ7cAlb1Fx79e/dt7nopNw4Tcmqw8QT/uPd6sgg2kOjlWKmFDTY mgSWa0g5BwSLmQjuVUae7SkveOG5F2fu6QIymwQnvyXJqvNR8DK3SyCj/HiGYEP/ OcEvhnH000QUEiXp/DNdFH5cBrqFmzfxhhz5eEE3I87rJUb0UnR5sgCR4G75M/8b 0vheaTxUnSy0QRe1iu9ev5kEcdkTfpJRRz1+S170Oi2rX2lgLiA= =Fqzp -----END PGP SIGNATURE----- --I7I5RvsaNhwjmeFO--