Skip to contentSkip to conversation

sysroot support in toolchain, use correct pathes in staging_dir

PATCH New Bernhard Fischer 2 participants 5 messages Apr 10, 2007 – Jun 20, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sysroot support in toolchain, use correct pathes in staging_dir

Hi,

This is a heads-up that i mean to correct the pathes to includes and libs in the staging dir as suggested in bug
http://busybox.net/bugs/view.php?id=1290
Doing so is ment to ease moving the staging-dir (and it's cross-compiler) to a different machine for re-use.

The theory of operation is that we aim to keep the positions of "normal" desktop machines for the directory layout and also build the toolchain with full sysroot-support to avoid trouble with hardcoded search pathes to headers and libraries.

A preliminary incarnation which only takes care of gcc-4.x is here:

http://uclibc.org/~aldot/buildroot.mine.cow.20070406-1957.diff.bz2
(134688 Bytes)
diffstat:

 toolchain/sstrip/sstrip.mk                             |   10 
 toolchain/binutils/binutils.mk                         |   38 
 toolchain/gcc/gcc-uclibc-3.x.mk                        |    6 
 toolchain/gcc/gcc-uclibc-4.x.mk                        |  451 
 toolchain/uClibc/uclibc.mk                             |   65 
 Config.in                                              |   27 
 package/ncurses/ncurses.mk                             |   38 
 package/openssh/openssh.mk                             |   10 
 package/openssl/openssl.mk                             |   55 
 package/m4/m4.mk                                       |   11 
 package/mpfr/mpfr.mk                                   |   47 
 package/ltrace/ltrace-svn-20070406.01.autoreconf.patch | 5948 +++++
 package/ltrace/ltrace.mk                               |   37 
 package/ltrace/ltrace-svn-20070406.00.patch            |19000 +++++++++++++++++
 package/Makefile.in                                    |   54 
 package/zlib/zlib.mk                                   |   56 
 package/gmp/gmp.mk                                     |   49 
 Makefile                                               |    7 
 18 files changed, 25681 insertions(+), 228 deletions(-)

The ltrace patch is not strictly related to the patch but i had to pickup the latest version of it locally, fwiw.

#1 lore raw

PATCH 1/1 sysroot support in toolchain, use correct pathes in staging_dir

Bernhard Fischer kirjoitti:

Quoted 7 lines

Hi,

This is a heads-up that i mean to correct the pathes to includes and libs in the staging dir as suggested in bug
http://busybox.net/bugs/view.php?id=1290
Doing so is ment to ease moving the staging-dir (and it's cross-compiler) to a different machine for re-use.

What was the original purpose of putting all headers under /include anyway?

-- Heikki Lindholm

#2 lore raw

PATCH 1/1 sysroot support in toolchain, use correct pathes in staging_dir

Quoted 10 lines · Heikki Lindholm

Bernhard Fischer kirjoitti:

Quoted 7 lines

Hi,

This is a heads-up that i mean to correct the pathes to includes and libs in the staging dir as suggested in bug
http://busybox.net/bugs/view.php?id=1290
Doing so is ment to ease moving the staging-dir (and it's cross-compiler) to a different machine for re-use.

What was the original purpose of putting all headers under /include anyway?

I don't know. Could be that the intention was to keep the cross-compiler dir hierarchy as flat as possible. The fact that usr/lib is symlinked to lib would also hint at that, so initially there was, perhaps, only packages being installed into /

We would have to ask eric, but i don't see any benefit at all for this layout of the staging dir.

Folks that want to do away with /usr on their targets can easily symlink /usr/* down to ../ if they feel like, but that proposed patch doesn't touch the target layout much (IIRC).

#3 lore raw

PATCH 1/1 sysroot support in toolchain, use correct pathes in staging_dir

In reply to Bernhard Fischer
Quoted 13 lines · Bernhard Fischer

Hi,

This is a heads-up that i mean to correct the pathes to includes and libs in the staging dir as suggested in bug
http://busybox.net/bugs/view.php?id=1290
Doing so is ment to ease moving the staging-dir (and it's cross-compiler) to a different machine for re-use.

The theory of operation is that we aim to keep the positions of "normal" desktop machines for the directory layout and also build the toolchain with full sysroot-support to avoid trouble with hardcoded search pathes to headers and libraries.

Quoted 4 lines

A preliminary incarnation which only takes care of gcc-4.x is here:

http://uclibc.org/~aldot/buildroot.mine.cow.20070406-1957.diff.bz2
(134688 Bytes)

updated patch is here:
http://uclibc.org/~aldot/buildroot.mine.cow.20070515-1321.diff.bz2

I converted a few more packages to install their files into the proper place.
gcc-3.x support is (still) not done, 4.x works fine. Anyone willing to fix gcc-3.x?

#4 lore raw

PATCH 1/1 sysroot support in toolchain, use correct pathes in staging_dir

Quoted 19 lines · Bernhard Fischer
Quoted 13 lines · Bernhard Fischer

Hi,

This is a heads-up that i mean to correct the pathes to includes and libs in the staging dir as suggested in bug
http://busybox.net/bugs/view.php?id=1290
Doing so is ment to ease moving the staging-dir (and it's cross-compiler) to a different machine for re-use.

The theory of operation is that we aim to keep the positions of "normal" desktop machines for the directory layout and also build the toolchain with full sysroot-support to avoid trouble with hardcoded search pathes to headers and libraries.

Quoted 4 lines

A preliminary incarnation which only takes care of gcc-4.x is here:

http://uclibc.org/~aldot/buildroot.mine.cow.20070406-1957.diff.bz2
(134688 Bytes)

Quoted 7 lines

updated patch is here:
http://uclibc.org/~aldot/buildroot.mine.cow.20070515-1321.diff.bz2

I converted a few more packages to install their files into the proper place.
gcc-3.x support is (still) not done, 4.x works fine. Anyone willing to fix gcc-3.x?

I have applied this big patch as r18864.

A few notes:
- gcc-3.4.6 builds (tested against i386 and x86_64) but doesn not have sysroot support (for obvious reasons).
- gcc-4.x now have sysroot support
Now you should be able to move your cross-compiler to a different machine, with a completely different location (only staging_dir/* should be kept intact.)
- separation of /usr/lib and /lib in the staging_dir; These should be kept as closely to a "normal" filesystem-layout as possible. If you do not want usr, then symlink it according to your needs manually.
- the kernel headers are now fully copied to the staging area. This fixes e.g. x86_64 and potentially other parts that previously failed to find some kernel-internal headers.

The patch was tested against gcc-3.4.6 with binutils-2.17 and 2.17.50.0.16; for the gcc-4 series, gcc-4.2.0 was used.

It is possible that some packages now fail to install properly. These need to fix their installation prefix to distinguish between usr/lib and lib/ properly.