This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: crosstool switching to /lib + /usr/lib ?


Kai Ruottu wrote:
Daniel Kegel <dank@kegel.com> wrote:
it looks like supporting x86_64 means using --with-sysroot, and
that means the libraries built by crosstool will be split
between /lib and /usr/lib instead of being just in /lib as they
were before, at least for x86_64.

I have recently built all my own glibcs as if they were for the native platform and copied the prebuilt glibcs 'as is' from the '.rpm's and '.deb's. So they have always these '/lib' and '/usr/lib' plus all kind of weird stuff in 'sbin', 'libexec' etc. subdirs...

OK, so at least Kai won't mind the split, as he's already coping with it...


 I think this issue about "how-to-symlink" was at least partially
discussed recently but maybe it didn't become clear that it is not
"nuclear science" ...

A better name for all this might be "brain salad surgery" :-)


 Maybe the only extra symlinks needed in the sysroot'ed cross-tools
were those for libc.so.6 and ld-linux*.so.2, and for the multilib'ed
'32' subdirectory:

/home1/host-x86_64-linux/usr/lib64 > l 32 libc.so.6 ld-linux*
lrwxrwxrwx    1 root     root            6 Dec 17 18:15 32 -> ../lib
lrwxrwxrwx    1 root     root           32 Dec 17 18:01 ld-linux-x86-64.so.2 -> ../../lib64/ld-linux-x86-64.so.2
lrwxrwxrwx    1 root     root           21 Dec 19 00:16 libc.so.6 -> ../../lib64/libc.so.6

/home1/host-x86_64-linux/usr/lib64 > cd 32

/home1/host-x86_64-linux/usr/lib > l libc.so.6 ld-linux*
lrwxrwxrwx    1 root     root           23 Dec 17 17:12 ld-linux.so.2 -> ../../lib/ld-linux.so.2
lrwxrwxrwx    1 root     root           19 Dec 17 17:12 libc.so.6 -> ../../lib/libc.so.6

A native x86_64-linux-gnu install doesn't have these symlinks from '/usr/lib' to '/lib'.

'Normalize' scripts like:

/home1/host-x86_64-linux/usr/bin > cat fix-64bit-symlinks.sh
ln -f -s ../../lib64/ld-linux.so.2 ld-linux.so.2
> ...
ln -f -s ../../lib64/libutil.so.1 libutil.so

(these were only for the 'minimal' C libraries)

were required to fix the symlinks in the original SuSE 9.0 glibcs.
Quite equivalent script with '../../lib' was required to fix the
symlinks in the 32-bit SuSE 9.0 glibc-2.3.2.

 The '-rpath-link' required for the '32' multilib is of course a nuisance
when the 64-bit default libs will be found automagically...
>  As seen, using the '--with-sysroot' wasn't at all obligatory, but maybe the
> X11, GUI-toolkits etc. extra stuff would require for instance a '-L/usr/X11R6/lib'
> working in the cross case too...
> ...  But how to automatize all this with a script has been
> left out. In this x86_64 case the sanity in the self built glibcs is also unsolved.
> One can build and use them in the previous scheme, but whether the produced binaries
> will then run on SuSE 9.0 or on the x86_64 ES-models from RedHat and SuSE, is more
> or less unclear.

Yeah, I guess you're right, with enough symlinks and maybe -rpath-link,
you can make x86 -> x86_64 work without --with-sysroot.
I'm trying to avoid those measures, though, since I really do want the
executables I produce to run properly on SuSE and RedHat.
And I think I've finally got an automated script that builds it all
properly.  I'll know more once I get an x86_64 box to test with.
- Dan

------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]