From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 s/uTNo5ceWJZgwAAbAwnHQ (envelope-from ) for ; Mon, 09 May 2022 20:25:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4A19NY5ceWJvzAAA9RJhRA (envelope-from ) for ; Mon, 09 May 2022 20:25:18 +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 53AFDEA2B for ; Mon, 9 May 2022 20:25:18 +0200 (CEST) Received: from localhost ([::1]:57812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1no84L-0007bd-EF for larch@yhetil.org; Mon, 09 May 2022 14:25:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1no84A-0007b9-7g for help-guix@gnu.org; Mon, 09 May 2022 14:25:06 -0400 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]:55191) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1no848-0008VX-J7 for help-guix@gnu.org; Mon, 09 May 2022 14:25:05 -0400 Received: by mail-wm1-x332.google.com with SMTP id bg25so8842812wmb.4 for ; Mon, 09 May 2022 11:25:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:in-reply-to:references:date:message-id:mime-version :content-transfer-encoding; bh=4W3l0nynavtuWt9W8c7ise+d2yrfHQqfKVRTpzJx1rU=; b=HQJ7Hum5FiWE2fY23+ma4jLfuIfx/IZ80ZEfPtrlbEOuk3fbpyVYHJvDaF5uUM1uqY aKAyfRzDYw6yDgUkWaHV1DwXooimlNzG0DoIhKj8wNepwzFWLPSV/7968WSwZvvztsSR 0+NChWoJ2+sc0Jx8WJc7IQSaEmTdpiiikxbJdc/zuySzIzs9FgX23pknXagSKkgZmRvS qLshflypoB3pJN92MM8HrJMKx/dqNV6oHtaa3rOzTjmC43Qh9u0hqjcKlIQJ+4/ZAHBf htzy5o02DsThtlrAEE9QzK4Y2062cLDplxwbWqnA4v2ZltNR/R8Avy8C+JVHUtBDtfBs 3soA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version:content-transfer-encoding; bh=4W3l0nynavtuWt9W8c7ise+d2yrfHQqfKVRTpzJx1rU=; b=MZ3ApAROLpjegtJf0gvBMjWN+OwNzf0RTXZsRJ8oTvqcSFNl5LjUTGIC9LtvyixCgT DuuoaGpRr/P8lzxjZpFYNNNzBpKsVkUTczEr9rywZo4bZQ0cFS6E/WkSi1Muj9m+0stK chKQPubU4crEhY3s5KSTkSKSvyeLlT7d+7+ahCVwkaN7Lz4u52qB91RWLLDmYcr2SJ2l mD3o+mgl3GPWMJ+ML8LbDx0cqSBn0a5nSRSxiH7urRJ6LgnQZY187SYifRW4BofO82a+ NHsPPjVNL2OZV+wvVQVfwF+oe5OIIsbLJ/6C9V+yn/c832KiUeBU2VQjzS67CRVqeU+I xuug== X-Gm-Message-State: AOAM530EvK+kphel8UFeey/hPSs26V1pPCNSKjZEy5CaBmunn0mKXB4z 59H/Llo8Yopl496AHXlDntH6e0RVrRM= X-Google-Smtp-Source: ABdhPJyp1kmeOotM5iUMFpuMjf2MQ3IpMqEjnb0vOLBhY7VUz8KnBaXhMchAHVN8eSAJTyHvblaWTA== X-Received: by 2002:a7b:c5d6:0:b0:381:4127:84d3 with SMTP id n22-20020a7bc5d6000000b00381412784d3mr23216199wmk.24.1652120702917; Mon, 09 May 2022 11:25:02 -0700 (PDT) Received: from pfiuh07 ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id d7-20020a5d4f87000000b0020c5253d8bfsm11685075wru.11.2022.05.09.11.25.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 11:25:02 -0700 (PDT) From: zimoun To: David Arroyo , help-guix@gnu.org Subject: Re: Defining a toolchain with musl libc In-Reply-To: References: Date: Mon, 09 May 2022 19:09:34 +0200 Message-ID: <87h75y4oq9.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=zimon.toutoune@gmail.com; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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=1652120718; 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: 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=4W3l0nynavtuWt9W8c7ise+d2yrfHQqfKVRTpzJx1rU=; b=knGb1Mq8XhL2499xYlIvVBMsTTdbB+ZmOvSbqRYeidlG1vYscexFHBAoszkKxzxRQUW16I FsBhTRDrNtCA5x2UGoX86zbH314EZFcxJK1cNC+kXKVFLgmBHeJOF3DtyvfSDOm0rX2Ws0 ZbwNJYQ9zhfXiQ8TGeRwN3mloxI0tDQIzSSq3zHzibx4ql1UtTlY2LgsXLbZjcDRZ+EbWz q1q8jSBdnXRXj2AP+Tr84s5V77JTDmRFjFoEKN0k8ROlxKKpiV3q19PyUCJBgi1ia/B9Yd TUGf/G7IRwnU6ZEEN/Wecguk2WTGZyBbN881wysL7U5E7J5LL948XxaG2e5msA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1652120718; a=rsa-sha256; cv=none; b=F+s7Ib+WgVEFxQXkZlLHIwu/L8DHHYPN0Rf0InzSsUwSdEqZnHU1SifIobsxosGF8B2h+u U66HEtutuxUjIojfuydYQbSQG05fOxOvtq2U68B2awOzZI98F+ZGtreLvcBuulyMG/0P9Q l7rYLKIQ+HuCTELYGes+/PtW7vgRKbC/22QNTuu+25EqdKkskkejjT7ZsqOUIPfFmNzZDK xjhRIQyWr7r2Nad38OD4n8h+wIfQv/4JucOLkeN7R7bEaNZF4po/Cxm+eGif4jXU33Jk1m bH6te32SU/C1JysretKjyXNq2BuCWuXpy4RaqjD3aJY2ndikljX3x7sH/DxLig== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HQJ7Hum5; dmarc=pass (policy=none) header.from=gmail.com; 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: -4.00 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=HQJ7Hum5; dmarc=pass (policy=none) header.from=gmail.com; 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: 53AFDEA2B X-Spam-Score: -4.00 X-Migadu-Scanner: scn1.migadu.com X-TUID: A5znxauacbwP Hi, This sounds cool! On Mon, 11 Apr 2022 at 22:34, "David Arroyo" wrote: > $ out=3D$(guix build -L $(pwd) -e '(@ (aqwari packages skaware) execline= -musl)') > $ file $out/bin/fdmove > /gnu/store/82r5ilk3jir7cssmhc8bi87qqj46p29h-execline-2.8.1.0/bin/fdmove:= ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, i= nterpreter /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-li= nux-x86-64.so.2, for GNU/Linux 2.6.32, not stripped >=20=09 > $ guix gc --requisites $out > /gnu/store/720rj90bch716isd8z7lcwrnvz28ap4y-bash-static-5.1.8 > /gnu/store/hxxbjrm4iw6aj203zli6hj4ds1l27s3k-skalibs-2.11.0.0 > /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33 > /gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8 > /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib > /gnu/store/82r5ilk3jir7cssmhc8bi87qqj46p29h-execline-2.8.1.0 > > I don't know how gcc and glibc ended up in there. I tried reading the > code, but I am not familiar enough with it to follow it yet. I think > they may get added as implicit inputs by gnu-build-system, and I might > not be using the package-input-rewriting transform correctly. Maybe =E2=80=9Cguix graph --path=E2=80=9D could help. Well, maybe skalibs = and/or execline retain a reference to bash or bash-minimal which probably drags glibc and gcc. But that does not explain the =E2=80=9Cdynamically linked=E2=80=9C above. > On my second try, I tried to create a GCC+musl toolchain and use that > I tried to create a toolchain like so: > > (define my-toolchain (make-gcc-toolchain gcc musl)) [...] > (package-with-c-toolchain hello my-toolchain) > > This rebuilds the musl package, and gets to the 'patch-source-shebangs > phase of the gcc rebuild, where it fails with the error: [...] > Throw to key `encoding-error' with args `("scm_to_stringn" "cannot conver= t narrow string to output locale" 84 #f #f)'. > builder for `/gnu/store/vnysv6hbb8zwyy8jawy1ayd2nfv38l4y-gcc-musl-1.2.2-1= 0.3.0.drv' failed with exit code 1 > build of /gnu/store/vnysv6hbb8zwyy8jawy1ayd2nfv38l4y-gcc-musl-1.2.2-10.3.= 0.drv failed > View build log at '/var/log/guix/drvs/vn/ysv6hbb8zwyy8jawy1ayd2nfv38l4y-g= cc-musl-1.2.2-10.3.0.drv.bz2'. Well, I do not know if GCC needs some locales from Glibc to build. It is rebuilt because, --8<---------------cut here---------------start------------->8--- (define* (make-gcc-toolchain gcc [...] (let ((gcc (if libc (make-gcc-libc gcc libc) gcc)) --8<---------------cut here---------------end--------------->8--- where =E2=80=99make-gcc-libc=E2=80=99 is defined in (gnu packages base). T= herefore, it is probably not straightforward to use =E2=80=99make-gcc-toolchain=E2=80=99= with musl as libc. 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 packag= e: #: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. Well, I would take this path: rebuild a variant of musl with the wrapper and try to make a C toolchain using this wrapper. Maybe the package musl-cross could be interesting. Cheers, simon