From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4Et5LcypeWL6MwAAbAwnHQ (envelope-from ) for ; Tue, 10 May 2022 01:54:52 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 8FZULcypeWJMKQAAauVa8A (envelope-from ) for ; Tue, 10 May 2022 01:54:52 +0200 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 6101B17994 for ; Tue, 10 May 2022 01:54:51 +0200 (CEST) Received: from localhost ([::1]:49536 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1noDDG-0003fe-CQ for larch@yhetil.org; Mon, 09 May 2022 19:54:50 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noDD6-0003fU-Hi for help-guix@gnu.org; Mon, 09 May 2022 19:54:40 -0400 Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:49849) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noDD4-0003xs-3V for help-guix@gnu.org; Mon, 09 May 2022 19:54:40 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id E0ED7320095F; Mon, 9 May 2022 19:54:34 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute3.internal (MEProxy); Mon, 09 May 2022 19:54:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aqwari.net; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1652140474; x= 1652226874; bh=qwgSPfU04PeaZEgO6CQTp8L5obIK7hgg0OEf55ObLgM=; b=k 9eikJimUGREsHHHFbc/o2dfhulXa+9j3bu6JTwTVEqsizKkw5h/ZXRr7L3IKG8Q3 VJnk8REurZ9wvAJCyDL2F39dL1tadOV3LYHzvl6QVaFNOFYjbluv1fH9zoD/+3H1 nuIr+5fadEWGempf3glxGDHAEW8sprJJAIFPOYTXKr+1Rha8Frx0cW7c0grkfVXP z/DeNB+mpawU7sMAjUUcYwxHc34XaTYGYraO3QEYmb4eYdtlIAIypRzn5mn7N1Ae ulhtikTRByCPKz9qjoU9pCgp7pB68xlzvUJJkTrw1fj5lrNLPByT1owvIrzjawnN WzhO6MkdK7pHBMU8Faz7w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1652140474; x=1652226874; bh=qwgSPfU04PeaZ EgO6CQTp8L5obIK7hgg0OEf55ObLgM=; b=AjowjAzzQmFSkF4+6JRyui0FvVQQ6 n9KBI/d741QpAk6GMxLe9bHR0qHhZhoBYckY72WLedL1HbKtMaetIOh/55rRb11d 53puUQXQRC2yMeX6pW8RkhC+nHJQ8cVomegEnmpMvNw6rkaJ7vxPdhiairn16Sm8 dakHDpHxfIKJZL+rg5el1yaXJ2pGzeYSaim2vrzjf0fi3dCyT032nxZ/OC9iIZ2m TuvY8cqrjFVaXabsfGKDhUYRpQ7lMnxaUQZfyGCFiDWl7iYhz/qIY7H0NtK1jKRj gGyalekYEkskIrKK5Cd+cXCenw5fGYL5Sl0agIhycImKwRSPafnOe5gaA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedrgedtgddvjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvfevufgtgfesth hqredtreerjeenucfhrhhomhepfdffrghvihguucetrhhrohihohdfuceouggrvhhiuges rghqfigrrhhirdhnvghtqeenucggtffrrghtthgvrhhnpedujeegteffvefhhfejteekue eiudfhhefhvedvheethefhffekvdehhefhkeegieenucffohhmrghinhepshhrrdhhthen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegurghvih gusegrqhifrghrihdrnhgvth X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 30C0415A007F; Mon, 9 May 2022 19:54:34 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.7.0-alpha0-591-gfe6c3a2700-fm-20220427.001-gfe6c3a27 Mime-Version: 1.0 Message-Id: <253ea756-2eb5-44fc-9f83-d27b3d0db005@www.fastmail.com> In-Reply-To: <87h75y4oq9.fsf@gmail.com> References: <87h75y4oq9.fsf@gmail.com> Date: Mon, 09 May 2022 19:54:13 -0400 From: "David Arroyo" To: help-guix@gnu.org Cc: zimoun Subject: Re: Defining a toolchain with musl libc Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=64.147.123.21; envelope-from=david@aqwari.net; helo=wout5-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-guix@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+larch=yhetil.org@gnu.org Sender: "Help-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1652140492; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=qwgSPfU04PeaZEgO6CQTp8L5obIK7hgg0OEf55ObLgM=; b=CSX/OFFlCh8WUClpdd9wIacvuOseOwxr8ZV6G064K1I3xebflF2O24yTmVsi7A33WV0otU XMKGXOI/i3rlIFxqo5b1yHLOp7nMu2IXEB0yTqMekeKdsrTfzZvUg8vQIO3qgjXeFlgzMy mQdE3WxRMArciQLKadtCQK4AbmXfEBg7fclfCv/r31G7Xxf+Dd/c3ASqnsbAzA5+gHmoNf v7FXVySWjg1+nv0+5FlM+6WfZGeq7i8iltvIM0vU7ytcCIrH2fPOyZX9IHYiG4QXJKy+nl KsgqXB6JbdzvgkFaApm3zzTaRrguYqui4sQin3rN7X9JnuhUjSYDAiCpi8Ls7A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652140492; a=rsa-sha256; cv=none; b=j2g1JbEH0UmS/R6LXGSpj7OkOLmJ+0DohaIYb9gweYrmTW3tjxwM1nPU8mmHATgiEju/6b 8j+9Px7n1+1Cfjcpy2YjhpU3ssJgXKcKbfmsP9iHXjN/pkaXFXwb3t11Ytq7hieMX0OEeb Syl6i2xq/cJU/ghTgrdMdmTulLO529wbpx6iZLCGsB5FhvbtNiG/CABt9gUfvCNmBzTrkk Eh1uicnnocIrrrroNvAywrAbIfUOY/WrxY7/3KRO06TZC7ZwJu7fRuFPDSu45KRwGwQO6B ovSVHYZTqzwmj9oyM4Oi4g+iP7MVswTPuxugwMDph6FCpVEIZv18J86MqpzRow== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=aqwari.net header.s=fm1 header.b="k 9eikJi"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=AjowjAzz; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 2.11 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=aqwari.net header.s=fm1 header.b="k 9eikJi"; dkim=fail ("headers rsa verify failed") header.d=messagingengine.com header.s=fm1 header.b=AjowjAzz; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "help-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="help-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 6101B17994 X-Spam-Score: 2.11 X-Migadu-Scanner: scn1.migadu.com X-TUID: s+773RSf+Z+D Hi Simon, thanks for your reply! I must confess that I started this thread with an XY problem; my problem= was with execline binaries segfaulting after I performed a pivot_root o= peration. I don't fully recall why, but I suspected the segfault occurre= d when execv() tried to load and/or use a dynamic library. I was trying= to verify this theory by statically linking execline and trying to repr= oduce the crash. But since then there some updates to the glibc package and I cannot repr= oduce the issue anymore. I could try to go back with the time-machine an= d reproduce again but it's not urgent for me anymore. On Mon, May 9, 2022, at 13:09, zimoun wrote: > On Mon, 11 Apr 2022 at 22:34, "David Arroyo" wrote: > Maybe =E2=80=9Cguix graph --path=E2=80=9D could help. Well, maybe ska= libs and/or > execline retain a reference to bash or bash-minimal which probably dra= gs > glibc and gcc. That is a nifty tool, I didn't know about the `--path` option. Unfortuna= tely it didn't seem to work here, I tried the following from the root of= my channel repo: $ guix graph --path --type=3Dbag-emerged -L $(pwd) -e '(@ (aqwari packa= ges skaware) execline-musl-static)' glibc guix graph: error: no path from 'execline-musl-static@2.8.1.0' to 'glib= c@2.33' However, if I render the full `--type=3Dbag-emerged` graph, massive as i= t is, glibc is clearly present and referenced by dozens of other nodes. = There are too many edges for me to trace each one, but it looks like the= path you predicted from execline -> bash-minimal -> glibc is there. > Note that usually musl comes from a wrapper around gcc, named > =E2=80=99musl-gcc=E2=80=99. It is specifically disabled by the musl p= ackage: > > #:configure-flags > (list "--disable-gcc-wrapper"))) > > I do not know why. Maybe because at the time of commit > ce728f70e5ef8783a28652e382c2c9f61c7b4c06, it was not necessary or maybe > because the license of musl is incompatible with the one of GCC. Newer versions of GCC actually have an `-mmusl` flag and allow for target triplets include `-musl-`, which appear to accomplish something similar.= In fact, in a separate project this G-expression worked well for compil= ing a single C file with musl, statically: https://git.sr.ht/~droyo/guix-channel/tree/640fe1b4eabe9a3aaa4b532c0ed71= e7abb74dae8/item/aqwari/namespace.scm#L288-299 > Well, I would take this path: rebuild a variant of musl with the wrapp= er > and try to make a C toolchain using this wrapper. This sounds like a reasonable approach. The only potential issue I see i= s this option in mus-gcc's spec file: *link: -dynamic-linker /lib/ld-musl-x86_64.so.1 -nostdlib %{shared:-shared} %{= static:-static} %{rdynamic:-export-dynamic} but I'm not producing dynamically linked binaries anyway. While this is = not urgent for me anymore, I'm still interested and I will probably try = this in the next few weeks. > Maybe the package musl-cross could be interesting. I will take a look. Initially I was put off because that package hard-co= des its own gcc, linux headers, and binutils versions rather than tracki= ng the common packages. But it could be good inspiration. Thanks again! David