Preparing etch toolchain for future multiarch

This page lists what had to be done on the toolchain side to implement multiarch. And has a very useful reference on how the paths changed.

Binutils

Binutils has to look for libraries in /lib/$(host triplet) and /usr/lib/$(host triplet), in addition to the standard paths on the architecture.

Patch

GCC

GCC has already support for multiarch include paths (even in etch).

It looks into /usr/include/$(host triplet) and /usr/local/include/$(host triplet), in addition to the standard paths on the architecture.

GNU libc

glibc has already support for multiarch libraries paths (even in etch).

ld.so looks into /lib/$(host triplet) and /usr/lib/$(host triplet), in addition to the standard paths on the architecture.

The libc6 and libc6-dev should also be splitted, in order to make multiple versions for different architectures to be installable at the same time. That basically means that these two packages should only contain libraries.

Multiarch paths

Current 'lenny' paths

.
|-- bin
|-- emul
|   `-- ia32-linux
|-- lib
|   `-- x86_64-linux-gnu
|-- lib32 -> /emul/ia32-linux/lib
|-- lib64 -> /lib
|-- sbin
`-- usr
    |-- arm-linux-gnu
    |   |-- bin
    |   |-- include
    |   `-- lib
    |-- arm-linux-gnueabi
    |   |-- bin
    |   |-- include
    |   `-- lib
    |-- bin
    |-- include
    |-- lib
    |-- lib32 -> /emul/ia32-linux/usr/lib
    |-- lib64 -> lib
    |-- sbin
    `-- x86_64-linux-gnu

Multiarch proposal paths

.
|-- bin
|-- lib
|   |-- arm-linux-gnu
|   |   `-- foo.so
|   `-- mips-linux-gnu
|       `-- foo.so
|-- sbin
`-- usr
    |-- bin
    |-- include
    |   |-- mips-linux-gnu
    |   |   `-- bar.h
    |   `-- arm-linux-gnueabi
    |       `-- bar.h
    |-- lib
    |   |-- mips-linux-gnu
    |   |   `-- foo.so
    |   `-- arm-linux-gnueabi
    |       `-- foo.so
    `-- sbin

Multicross sysroot proposal paths (/opt)

.
|-- bin
|-- lib
|   |-- arm-linux-gnu
|   |   `-- foo.so
|   `-- mips-linux-gnu
|       `-- foo.so
|-- sbin
|-- usr
|   |-- bin
|   |-- include
|   |-- lib
|   |   |-- mips-linux-gnu
|   |   |   `-- foo.so
|   |   `-- arm-linux-gnueabi
|   |       `-- foo.so
|   `-- sbin
`-- opt
    |-- emdebian-mips-linux-gnu
    |   |-- bin
    |   |-- lib
    |   |   `-- mips-linux-gnu (or symlink?)
    |   |       `-- foo.so
    |   |-- sbin
    |   `-- usr
    |       |-- bin
    |       |-- include
    |       |   `-- bar.h
    |       |-- lib
    |       |   `-- mips-linux-gnu (or symlink?)
    |       |       `-- foo.so
    |       `-- sbin
    `-- maemo-arm-linux-gnueabi
        |-- bin
        |-- lib
        |   `-- arm-linux-gnueabi (or symlink?)
        |       `-- foo.so
        |-- sbin
        `-- usr
            |-- bin
            |-- include
            |   `-- bar.h
            |-- lib
            |   `-- arm-linux-gnueabi (or symlink?)
            |       `-- foo.so
            `-- sbin


CategoryEmdebian