mailing list of musl libc
 help / color / mirror / code / Atom feed
* Re: [musl] Question: How can I mix 32-bit and 64-bit musl headers?
       [not found] <90A0B2B2-14B8-442B-A9D1-2CB9F55051D1@gmail.com>
@ 2024-12-21 18:24 ` lollol222gg
  2024-12-23  9:25   ` Rich Felker
  0 siblings, 1 reply; 5+ messages in thread
From: lollol222gg @ 2024-12-21 18:24 UTC (permalink / raw)
  To: musl

This is something I have already done with the libs (/lib{arch} symlinked to /lib/{arch target}).

Just need to know if there is a default way to have arch based include directories that LLVM Clang will pickup without patching. If I can't escape patching Clang that won't be the end of the world for me.

Sent from my iPhone

> On Dec 21, 2024, at 7:22 AM, lollol222gg@gmail.com wrote:
> 
> This is something I have already done with the libs (/lib{arch} symlinked to /lib/{arch target}).
> 
> Just need to know if there is a default way to have arch based include directories that LLVM Clang will pickup without patching. If I can't escape patching Clang that won't be the end of the world for me.
> 
> Sent from my iPhone
> 
>>> On Dec 21, 2024, at 1:32 AM, Rich Felker <dalias@libc.org> wrote:
>>> 
>>> On Fri, Dec 20, 2024 at 09:22:00AM +0100, Markus Wichmann wrote:
>>> Am Thu, Dec 19, 2024 at 07:42:00PM -0500 schrieb William Pickard:
>>>> So I'm trying to create my own Linux distribution where musl and LLVM are
>>>> the primary libc, libc++ and compiler instead of gcc/glibc but I ran into
>>>> an issue where bits/alltypes.h is 32-bit specific when trying to compile
>>>> LLVM libc++ suite for 64-bit.
>>>> 
>>>> Is there a specific way I should be installing headers for the 32-bit
>>>> version?
>>> 
>>> musl does not support multilib in any way. The issue you are reporting
>>> sounds like musl is detecting the wrong architecture, because the
>>> alltypes.h is generated for the target architecture. I'm guessing you
>>> are building it the wrong way somehow, and I don't know how, because the
>>> normal "./configure && make && sudo make install" does the right thing.
>> 
>> musl fully supports multiarch, just not the gcc multilib directory
>> layout with a shared include dir. The gcc layout is not compatible
>> with third-party libraries that install headers generated for the
>> particular system, so it's flawed to begin with, and it also doesn't
>> work with how musl treats archs as separate.
>> 
>> If you want to do multiarch with musl, just ensure your toolchain for
>> each arch (treating 32-bit and 64-bit as independent archs) uses its
>> own separate include and library paths. The ld-musl-*.so.1 files all
>> go in /lib (they very intentionally have different names for each arch
>> and subarch variant) and each needs a corresponding ld-musl-*.path
>> file in /etc telling it where to look for shared libs for that arch.
>> 
>> Rich

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [musl] Question: How can I mix 32-bit and 64-bit musl headers?
  2024-12-21 18:24 ` [musl] Question: How can I mix 32-bit and 64-bit musl headers? lollol222gg
@ 2024-12-23  9:25   ` Rich Felker
  0 siblings, 0 replies; 5+ messages in thread
From: Rich Felker @ 2024-12-23  9:25 UTC (permalink / raw)
  To: lollol222gg; +Cc: musl

On Sat, Dec 21, 2024 at 01:24:39PM -0500, lollol222gg@gmail.com wrote:
> This is something I have already done with the libs (/lib{arch}
> symlinked to /lib/{arch target}).
> 
> Just need to know if there is a default way to have arch based
> include directories that LLVM Clang will pickup without patching. If
> I can't escape patching Clang that won't be the end of the world for
> me.

clang is natively a universal cross compiler, so it must have some
mechanism for configuring the include and library paths for the target
you select. But I don't regularly use it, just occasionally for
experimentation, so hopefully someone else can fill in the details on
how.

Rich



> > On Dec 21, 2024, at 7:22 AM, lollol222gg@gmail.com wrote:
> > 
> > This is something I have already done with the libs (/lib{arch} symlinked to /lib/{arch target}).
> > 
> > Just need to know if there is a default way to have arch based include directories that LLVM Clang will pickup without patching. If I can't escape patching Clang that won't be the end of the world for me.
> > 
> > Sent from my iPhone
> > 
> >>> On Dec 21, 2024, at 1:32 AM, Rich Felker <dalias@libc.org> wrote:
> >>> 
> >>> On Fri, Dec 20, 2024 at 09:22:00AM +0100, Markus Wichmann wrote:
> >>> Am Thu, Dec 19, 2024 at 07:42:00PM -0500 schrieb William Pickard:
> >>>> So I'm trying to create my own Linux distribution where musl and LLVM are
> >>>> the primary libc, libc++ and compiler instead of gcc/glibc but I ran into
> >>>> an issue where bits/alltypes.h is 32-bit specific when trying to compile
> >>>> LLVM libc++ suite for 64-bit.
> >>>> 
> >>>> Is there a specific way I should be installing headers for the 32-bit
> >>>> version?
> >>> 
> >>> musl does not support multilib in any way. The issue you are reporting
> >>> sounds like musl is detecting the wrong architecture, because the
> >>> alltypes.h is generated for the target architecture. I'm guessing you
> >>> are building it the wrong way somehow, and I don't know how, because the
> >>> normal "./configure && make && sudo make install" does the right thing.
> >> 
> >> musl fully supports multiarch, just not the gcc multilib directory
> >> layout with a shared include dir. The gcc layout is not compatible
> >> with third-party libraries that install headers generated for the
> >> particular system, so it's flawed to begin with, and it also doesn't
> >> work with how musl treats archs as separate.
> >> 
> >> If you want to do multiarch with musl, just ensure your toolchain for
> >> each arch (treating 32-bit and 64-bit as independent archs) uses its
> >> own separate include and library paths. The ld-musl-*.so.1 files all
> >> go in /lib (they very intentionally have different names for each arch
> >> and subarch variant) and each needs a corresponding ld-musl-*.path
> >> file in /etc telling it where to look for shared libs for that arch.
> >> 
> >> Rich

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [musl] Question: How can I mix 32-bit and 64-bit musl headers?
  2024-12-20  8:22 ` Markus Wichmann
@ 2024-12-21  6:32   ` Rich Felker
  0 siblings, 0 replies; 5+ messages in thread
From: Rich Felker @ 2024-12-21  6:32 UTC (permalink / raw)
  To: Markus Wichmann; +Cc: musl, William Pickard

On Fri, Dec 20, 2024 at 09:22:00AM +0100, Markus Wichmann wrote:
> Am Thu, Dec 19, 2024 at 07:42:00PM -0500 schrieb William Pickard:
> > So I'm trying to create my own Linux distribution where musl and LLVM are
> > the primary libc, libc++ and compiler instead of gcc/glibc but I ran into
> > an issue where bits/alltypes.h is 32-bit specific when trying to compile
> > LLVM libc++ suite for 64-bit.
> >
> > Is there a specific way I should be installing headers for the 32-bit
> > version?
> 
> musl does not support multilib in any way. The issue you are reporting
> sounds like musl is detecting the wrong architecture, because the
> alltypes.h is generated for the target architecture. I'm guessing you
> are building it the wrong way somehow, and I don't know how, because the
> normal "./configure && make && sudo make install" does the right thing.

musl fully supports multiarch, just not the gcc multilib directory
layout with a shared include dir. The gcc layout is not compatible
with third-party libraries that install headers generated for the
particular system, so it's flawed to begin with, and it also doesn't
work with how musl treats archs as separate.

If you want to do multiarch with musl, just ensure your toolchain for
each arch (treating 32-bit and 64-bit as independent archs) uses its
own separate include and library paths. The ld-musl-*.so.1 files all
go in /lib (they very intentionally have different names for each arch
and subarch variant) and each needs a corresponding ld-musl-*.path
file in /etc telling it where to look for shared libs for that arch.

Rich

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [musl] Question: How can I mix 32-bit and 64-bit musl headers?
  2024-12-20  0:42 William Pickard
@ 2024-12-20  8:22 ` Markus Wichmann
  2024-12-21  6:32   ` Rich Felker
  0 siblings, 1 reply; 5+ messages in thread
From: Markus Wichmann @ 2024-12-20  8:22 UTC (permalink / raw)
  To: musl; +Cc: William Pickard

Am Thu, Dec 19, 2024 at 07:42:00PM -0500 schrieb William Pickard:
> So I'm trying to create my own Linux distribution where musl and LLVM are
> the primary libc, libc++ and compiler instead of gcc/glibc but I ran into
> an issue where bits/alltypes.h is 32-bit specific when trying to compile
> LLVM libc++ suite for 64-bit.
>
> Is there a specific way I should be installing headers for the 32-bit
> version?

musl does not support multilib in any way. The issue you are reporting
sounds like musl is detecting the wrong architecture, because the
alltypes.h is generated for the target architecture. I'm guessing you
are building it the wrong way somehow, and I don't know how, because the
normal "./configure && make && sudo make install" does the right thing.

Ciao,
Markus

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [musl] Question: How can I mix 32-bit and 64-bit musl headers?
@ 2024-12-20  0:42 William Pickard
  2024-12-20  8:22 ` Markus Wichmann
  0 siblings, 1 reply; 5+ messages in thread
From: William Pickard @ 2024-12-20  0:42 UTC (permalink / raw)
  To: musl

[-- Attachment #1: Type: text/plain, Size: 331 bytes --]

So I'm trying to create my own Linux distribution where musl and LLVM are
the primary libc, libc++ and compiler instead of gcc/glibc but I ran into
an issue where bits/alltypes.h is 32-bit specific when trying to compile
LLVM libc++ suite for 64-bit.

Is there a specific way I should be installing headers for the 32-bit
version?

[-- Attachment #2: Type: text/html, Size: 381 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-12-23  9:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <90A0B2B2-14B8-442B-A9D1-2CB9F55051D1@gmail.com>
2024-12-21 18:24 ` [musl] Question: How can I mix 32-bit and 64-bit musl headers? lollol222gg
2024-12-23  9:25   ` Rich Felker
2024-12-20  0:42 William Pickard
2024-12-20  8:22 ` Markus Wichmann
2024-12-21  6:32   ` Rich Felker

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).