From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 0BgpEVPANmfwBQEAe85BDQ:P1 (envelope-from ) for ; Fri, 15 Nov 2024 03:30:27 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id 0BgpEVPANmfwBQEAe85BDQ (envelope-from ) for ; Fri, 15 Nov 2024 04:30:27 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=IyTc88iW; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=JMCo05nT; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1731641427; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: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=6Mq9+ppCakrVMdYu8JFDb4WcTH0cVE9/6ApziTd8MIA=; b=Ub7MVd4rYzGBctCE+FGXeXf7v1W0PlPXZL7niy2qrHO57iP7WLAQhxU8sO6MXfD7b/hfx/ e5FOCSswRKVBmn0FhCnqxAOewI2/6DrXeZyxYbaZIhjx7FA4+plPuoYIi3A/vbrc0f7yXE h90umv8+lX2WLBqJraef/IQD/8E6yhCTc2BKQlmFX+x5s2qhsggSpNvNLNu3knbUhNnjvV PidBX2y2kJQB9e28g4Q1Evxc0mppn9pGvXDlTx51PTqlbGMW0Bam06e1bMOMK9V+W/ErgI RkGoI+9KCpVusa2URMXq2/R/9Qd1DlO4ql/SQhAa7y9Dvm2C8szPNY86Vbw25w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=IyTc88iW; dkim=fail ("headers rsa verify failed") header.d=ultrarare.space header.s=dkim header.b=JMCo05nT; 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"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1731641427; a=rsa-sha256; cv=none; b=JdzFbQqlQvjp1jEjwr96QBe2HMxhC5K1Qh8eWh6l1pZL4GW9YOM2iScW4+ICmmjFv8bS0m AiiOhDrJIJJ9EAyVql9deYmhNy6nXUrbu84vQHOEM0wtunnRikSOk8djdDHwzRNOdEckt4 ixlEPc0ozLYDFeAfBl2MHAC/iCRwcBsS5GAFqzQRbSdf4NUab+EH6pdVnbkz1gruANPu52 +dtt9Uhxc/LHbpQleA6d97dJ7s8Z5hCtPWAmXJPC7Cdj2GbHmTd5/vnp7hoox9oAA/8KOw tcO0KpVf/WRFxqiZjPzRHnR4bTCKG4uNWV7xXZcY+yTXKqjZX4ihw0/v1QpaEA== 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 A668A8A327 for ; Fri, 15 Nov 2024 04:30:26 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBn24-0007BD-TS; Thu, 14 Nov 2024 22:30:04 -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 1tBn23-0007Aw-88 for bug-guix@gnu.org; Thu, 14 Nov 2024 22:30: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 1tBn22-0004Xo-V9 for bug-guix@gnu.org; Thu, 14 Nov 2024 22:30:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:From:Date:To:Subject; bh=6Mq9+ppCakrVMdYu8JFDb4WcTH0cVE9/6ApziTd8MIA=; b=IyTc88iWGrP2dHSCO8GYKfyBKnUd7l344snmKRWyCyHgNTXhUXtwm4A+7xttjlNTPIPug/Kv4L81lOAirbC3hz8O+zl5Uhaflfm0dryFl8An6ZGLcCYHNRdbI9OjPw3E+vmyMwHiND+GnenU+Y4B6Ix83xZmRh+2Yo0Z56ggOhnLXBr/rB4Dq4lc5qeP2yHKExyRgUh7VE1wsTotKGiyuS+T6HRYDtJqF5ECDUI+XQli3jkIMOYKZOYko1v9G+FCG5xy6QSHBGcfLSPlE8xTbDa5AHliytCTtWgVuT0K8n+Ij6Xs45K+iqRevoYuUPoAtAIwPkr07dBrFCV/HampLQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tBn21-0003gx-V2; Thu, 14 Nov 2024 22:30:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#74217: Bootstrapping Zig with no Binary Blobs Resent-From: Hilton Chain Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org, Ekaitz Zarraga Resent-Date: Fri, 15 Nov 2024 03:30: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: 74217@debbugs.gnu.org Cc: Motiejus =?UTF-8?Q?Jak=C5=A1tys?= , =?UTF-8?Q?No=C3=A9?= Lopez , dan , Efraim Flashner , Ekaitz Zarraga Received: via spool by 74217-submit@debbugs.gnu.org id=B74217.173164137414128 (code B ref 74217); Fri, 15 Nov 2024 03:30:01 +0000 Received: (at 74217) by debbugs.gnu.org; 15 Nov 2024 03:29:34 +0000 Received: from localhost ([127.0.0.1]:48003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBn1Z-0003fo-Td for submit@debbugs.gnu.org; Thu, 14 Nov 2024 22:29:34 -0500 Received: from mail.boiledscript.com ([144.168.59.46]:49010) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBn1Y-0003fZ-1p for 74217@debbugs.gnu.org; Thu, 14 Nov 2024 22:29:32 -0500 Date: Fri, 15 Nov 2024 11:29:10 +0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ultrarare.space; s=dkim; t=1731641364; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6Mq9+ppCakrVMdYu8JFDb4WcTH0cVE9/6ApziTd8MIA=; b=JMCo05nTt3Y8vzMEIcTgT0h40UK51IARRURJcnWI5qPRlVDkrBkR/A4g9jcXI52uSdam0Y /MXtrV05XW3zBLcRZ/thvdiwI1godE4KnIyGk4b2R6HKwJC65E2oKoxmODxE9JnnDoZvQh SK1VXVWIevKscX2E/aKk+L0Op4yfpXCM4/y6TrCwY/+JTv2MHmLdweLfSPsPii54qgxd3l /xN8QE9Rx+ykbmauywV4K0ViSG9lwOmtrxOq7H4XK0PeV1RuucdmxpJlqv3FuiBBsmVy0P VbHbA3sMV3a3l9E12bsFrGv2HzEUkBZq3wsgqVPoR8yopmNO2kSBCwPIFz5nfQ== Message-ID: <878qtl5g55.wl-hako@ultrarare.space> In-Reply-To: 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> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: -- 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: , Reply-to: Hilton Chain From: Hilton Chain via Bug reports for GNU Guix Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Scanner: mx11.migadu.com X-Migadu-Spam-Score: 0.09 X-Spam-Score: 0.09 X-Migadu-Queue-Id: A668A8A327 X-TUID: hcFlm5buCdWH On Thu, 14 Nov 2024 17:41:04 +0800, Efraim Flashner wrote: > > [1 ] > On Thu, Nov 14, 2024 at 05:22:17PM +0800, Hilton Chain wrote: > > 2. Pass libc to Zig's linker > > This was the behavior in 0.9, but changed due to issue on macOS[1]. (b= tw, our > > CPLUS_INCLUDE_PATH also has issue with macOS target[2]). RUNPATH for g= libc was > > missing because of this, since it's the linker handling each-lib-rpath. > > > > Since we do not support macOS anyway, can we restore this behavior? > > At worst I could see adding a comment that it would likely break future > macOS cross-compiles. I don't see an issue with either putting it back > unconditionally or trying to make it conditional based on > (%current-system) or the contents of (%current-target-system). Bad news: Zig 0.12 changed[1] behavior of each_lib_rpath, it won't filter libraries now. Good news: Thanks to this diff, I know how to add libc to RUNPATH now :) Another forced push, I have ensured consistent behavior for (CROSS_)?LIBRARY_PATH and added libc RUNPATH without restoring the behavior passing '-lc' to linker. Who said not going to implement a ld-wrapper within Zig? :P Fortunately it was already there :) BTW, adding pkg-config to native-inputs works for ncdu. > > I also have concern for Zig's relying on /usr/bin/env (Zig uses an ELF = file to > > find dynamic linker, env is chosen for it's well-known). We have patch= ed this > > reference, not sure if it will cause issue for cross-building Zig. > > We use search-input-file in the replacement, so it should choose the > cross-binutils for the replacement /bin/env, so it shouldn't be a > problem. On Thu, 14 Nov 2024 17:47:23 +0800, Motiejus Jak=B9tys wrote: > > This file is only consulted when `-target=3Dnative`. I.e. when it needs > to compile for the host. If target is specified, it will not consult > that file. > > Just verified with zig 0.13.0: > > $ strace -f -e openat zig cc hello.c -o hello |& grep -w env > openat(AT_FDCWD, > "/nix/store/sf6y4arqcm100rnnl3dhpg732i774zp6-coreutils-9.5/bin/env", > O_RDONLY|O_NOCTTY|O_CLOEXEC) =3D 5 > $ strace -f -e openat zig cc -target x86_64-linux-gnu.2.32 hello.c -o > hello |& grep -w env > $ Thanks! Then it should be in inputs. I don't want to add coreutils to it,= so I patched reference of /usr/bin/env to clang++ (it's both in inputs and RUNPA= TH) instead. --- [1]: https://github.com/ziglang/zig/commit/852e7e24b5f15b489463bdabb0039e2a= 424e5ee6