On Thu, 08 Jun 2023 at 19:22:02 -0400, nick black wrote:
> Simon McVittie left as an exercise for the reader:
> >   Debian-style multiarch or Fedora/Arch-style multilib is a much, much
> 
> this is at least the second time you've drawn this distinction
> in this thread. for anyone else who, like me, was uneasy with
> their understanding of the concept

Sorry, I spend a lot of my work time immersed in this sort of thing and
how it differs between distributions, so I tend to forget that most
developers are able to stick to one distro and don't need to know this!

I think this is important background knowledge for anyone who wants to
change how we handle architectures that are generally used as a foreign
architecture, particularly i386.

> https://wiki.debian.org/ToolChain/Cross#Multiarch_vs_Multilib

That's talking about the different gcc toolchains, but I actually meant
the difference in how libraries are packaged, which is a slightly separate
concept but tends to go together.

Readers of this thread are hopefully all familiar with Debian
multiarch, where the linker (both runtime and compile-time) searches
/{usr/,}lib/x86_64-linux-gnu, /{usr/,}lib/i386-linux-gnu or equivalent
non-x86 paths, as appropriate for the architecture, and we install shared
libraries to those paths. The dynamic string token ${LIB} (see ld.so(8))
expands to lib/x86_64-linux-gnu or similar.

Fedora and its relatives (RHEL, CentOS and so on) use the directory
layout described by LSB/FHS, in which i386 libraries are installed into
/usr/lib and x86_64 libraries into /usr/lib64 (a "libQUAL" directory
using FHS terminology), and the runtime and compile-time linkers search
those paths as appropriate for the architecture. They install most
libraries for x86_64 only, from packages like glib2-*.x86_64.rpm, into
/usr/lib64. A subset of libraries (enough to support Wine and legacy i386
binaries) are also available for i386, from packages lke glib2-*.i686.rpm,
into /usr/lib. The dynamic string token ${LIB} expands to lib64 or lib
as appropriate.

Arch Linux and its relatives (Manjaro and so on) use the reverse of
Fedora's layout: they mostly install x86_64 libraries from packages like
glib2-*-x86_64.pkg.tar.zst into /usr/lib, and a subset of libraries are
also available for i386, from packages like lib32-glib2-*-x86_64.pkg.tar.zst,
installing into /usr/lib32. ${LIB} expands to lib or lib32 as appropriate.

Other distributions *usually* match one of those families (often the same
as Fedora, for example openSUSE and Gentoo seem to match that), but there
are exceptions, like Exherbo which sets the ${prefix} to /usr/GNU_TUPLE for
each architecture, resulting in libraries in /usr/GNU_TUPLE/lib.

Debian *mostly* uses multiarch, but we still have a small subset of
packages that install a library of a different architecture to the libQUAL
directories, for use with multilib compilers. On x86_64 they're named like
lib32stdc++6_*_amd64.deb and follow the Arch-like directory layout with a
lib32 directory, while on i386 they're named like lib64stdc++6_*_i386.deb
and follow the Fedora-like layout with a lib64 directory.

    smcv

Reply via email to