[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Defining a toolchain with musl libc
From: |
zimoun |
Subject: |
Re: Defining a toolchain with musl libc |
Date: |
Tue, 10 May 2022 10:00:27 +0200 |
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