bootlin / toolchains-builder

http://toolchains.free-electrons.com
89 stars 27 forks source link

RHEL6 host support (rpath problem) #4

Closed slightlyunconventional closed 6 years ago

slightlyunconventional commented 6 years ago

Most of the toolchain (gcc, objdump, etc) works great on RHEL6. One exception though is gdb, which can't find libncurses.so.6. (RHEL 6. and CentOS 6. seem to provide only libncurses.so.5.)

However, I see that aarch64--glibc--stable/lib/libncurses.so.6 is actually included, so why isn't it found?

$ chrpath -l aarch64-buildroot-linux-gnu-gdb
aarch64-buildroot-linux-gnu-gdb: RPATH=/tmp/aarch64--glibc--stable/usr/lib

Needless to say, I didn't install my aarch64--glibc--stable toolchain into /tmp. Editing rpath fixes it.

$ chrpath -r '$ORIGIN/../lib' aarch64-buildroot-linux-gnu-gdb
aarch64-buildroot-linux-gnu-gdb: RPATH=/tmp/aarch64--glibc--stable/usr/lib
aarch64-buildroot-linux-gnu-gdb: new RPATH: $ORIGIN/../lib
$ aarch64-buildroot-linux-gnu-gdb
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-pc-linux-gnu --target=aarch64-buildroot-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
/home/hblancha/.gdbinit:99: Error in sourced command file:
Scripting in the "Python" language is not supported in this copy of GDB.
(gdb) 

I guess another alternative is to set LD_LIBRARY_PATH (chrpath is not installed by default, any many of these users lack root permissions), but far better to correct the rpath in the binary.

tpetazzoni commented 6 years ago

This is now fixed, by using "make sdk". The recently released 2018.02-1 bleeding edge toolchains have correct RPATH. The 2018.02-1 stable toolchains were still broken due to a separate mistake in the build logic, but I've just started a build of 2018.02-2 stable toolchains, which hopefully should be complete by the end of the day, and which will fix this problem. Thanks for the report!