[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [RFC] [Cross Toolchain] Multiarch and sysrooted toolchain

Hector Oron <hector.oron@gmail.com> writes:

> Hello,
>  [*]
>   I have been looking lately into making some cross toolchain
> improvements, one of them will be to change to a sysrooted cross
> toolchain, but the current layout we are using by dpkg-cross installs
> relevant bits under:
>  <DIR>/{include,bin,lib,lib64}
>   Mainstream code expects a different layout more LHS compliant,
>  <DIR>/{usr/include,bin,lib,lib64}
>   If anyone cares, how do you feel about changing cross tools layout?
>  [*]
>   Another improvement we want to achive is a fully multiarch support in
> dpkg, that might also affect other tools (not sure).
>    Is there any information arround, maybe LHS, on how to setup <DIR>
> layout?
>    Nowadays we are using non multiarch structure as:
> usr/$arch-linux-gnu
> |-- bin
> |-- include
> |-- lib
> `-- lib64
>    But what it should look like in future? /usr/include/$arch-linux-gnu?
> Would it be reasonable to be using a new layout like:
> usr/include/$arch-linux-gnu

That is already standard on i386/amd64 at least. Many /usr/include/*
files just include the right usr/include/$arch-linux-gnu file
depending on wether __i386__ or __x86_64__ is set. gcc also looks into
those dirs on its own. So yes, do use those.

> |-- bin

All binaries are assumed to do the same thing no matter what
architecture they are compiled for. As such there is no need to have
the same binary compiled for different archs at the same time. Also
any change here would play havock with shebang lines.

> |-- usr/include

Good for architecture independend header files.

> |-- lib
> `-- lib64

Those must remain for at least the ld.so binary. The path is hardcoded
in every elf executable and must remain compatible with other
distributions. There is also lib32.

What you described so far is already the existing layout.

>   I am missing some papers on multiarch, are there any kind of
> information out there.

You are missing the actual multiarch or cross-compile library dirs:

/usr/$arch-linux-gnu/lib  (cross-compile)
/usr/lib/$arch-linux-gnu  (multiarch)

I still haven't heart a good reason why multiarch can't use the
cross-compile dirs as the libraries for each are ment to be
interchangable (and in fact dpkg-cross demonstrates that already).

>   Kind Regards,
>   Héctor Orón


Reply to: