To simplify the sysroot generation for cross compiling, I generate a tar file with relative symbolic links.
If I print the tar context with
tar tvf sysroot-libc6-dev.tar
then I get the correct result:
lrw-r--r-- jens/jens 1 2018-03-30 23:42 usr/lib/x86_64-linux-gnu/libBrokenLocale.so -> ../../../lib/x86_64-linux-gnu/libBrokenLocale.so.1
lrw-r--r-- jens/jens 1 2018-03-30 23:42 usr/lib/x86_64-linux-gnu/libanl.so -> ../../../lib/x86_64-linux-gnu/libanl.so.1
lrw-r--r-- jens/jens 1 2018-03-30 23:42 usr/lib/x86_64-linux-gnu/libcidn.so -> ../../../lib/x86_64-linux-gnu/libcidn.so.1
If I unpack the tar archive with
tar xvf sysroot-libc6-dev.tar
then the symlinks are absolute, this is a mess, because then the sysroot directory points to my host machine and cross compile will not work.
ls -al
lrwxrwxrwx 1 jens jens 33 Jan 14 11:39 libanl.so -> /lib/x86_64-linux-gnu/libanl.so.1
lrwxrwxrwx 1 jens jens 42 Jan 14 11:39 libBrokenLocale.so -> /lib/x86_64-linux-gnu/libBrokenLocale.so.1
lrwxrwxrwx 1 jens jens 34 Jan 14 11:39 libcidn.so -> /lib/x86_64-linux-gnu/libcidn.so.1
The purpose of the script is to keep everything relative, also the linker scripts, e.g. libc.so will be patched to relative links.
Thanks in advance
Jens Riebold