unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: David Arroyo <david@aqwari.net>, help-guix@gnu.org
Subject: Re: Defining a toolchain with musl libc
Date: Tue, 10 May 2022 10:00:27 +0200	[thread overview]
Message-ID: <865ymdakbo.fsf@gmail.com> (raw)
In-Reply-To: <253ea756-2eb5-44fc-9f83-d27b3d0db005@www.fastmail.com>

Hi,

On Mon, 09 May 2022 at 19:54, "David Arroyo" <david@aqwari.net> wrote:

> That is a nifty tool, I didn't know about the `--path`
> option. Unfortunately it didn't seem to work here, I tried the
> following from the root of my channel repo:
>
> 	$ guix graph --path --type=bag-emerged -L $(pwd) -e  glibc
> 	guix graph: error: no path from 'execline-musl-static@2.8.1.0' to 'glibc@2.33'

Is ’glibc’ listed by “guix size -e '(@ (aqwari packages skaware) execline-musl-static)'”?


>> Note that usually musl comes from a wrapper around gcc, named
>> ’musl-gcc’.  It is specifically disabled by the musl package:
>>
>>        #: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

Maybe, try the compile the package using this flag and passing the
package musl as native-inputs.


> triplets include `-musl-`, which appear to accomplish something
> similar. In fact, in a separate project this G-expression worked well
> for compiling a single C file with musl, statically: 
>
> https://git.sr.ht/~droyo/guix-channel/tree/640fe1b4eabe9a3aaa4b532c0ed71e7abb74dae8/item/aqwari/namespace.scm#L288-299

Cool!

>
>> Well, I would take this path: rebuild a variant of musl with the wrapper
>> and try to make a C toolchain using this wrapper.
>
> This sounds like a reasonable approach. The only potential issue I see is 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.

Well, from my understanding, we do not have a good story for using the
package transformation ’with-c-toolchain’ with another compiler than GCC
and another C library than Glibc.

And then, another story of static.  For instance, are you able to
produce static binary using the regular C toolchain.

Exploring 2 problem spaces in the same time makes hard to tackle each
individually since they are orthogonal, at first.  IMHO.



Cheers,
simon


      reply	other threads:[~2022-05-10  8:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12  2:34 Defining a toolchain with musl libc David Arroyo
2022-04-12 18:22 ` David Arroyo
2022-05-09 17:09 ` zimoun
2022-05-09 23:54   ` David Arroyo
2022-05-10  8:00     ` zimoun [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=865ymdakbo.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=david@aqwari.net \
    --cc=help-guix@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).