diff options
author | Christophe Lyon <christophe.lyon@linaro.org> | 2018-10-28 17:17:30 +0000 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@linaro.org> | 2018-10-29 13:11:10 +0000 |
commit | b0afd1b1d3c7a5ece424eec0b58e6d21f63e714c (patch) | |
tree | 92818ce66c8693cc23efe21de8447a018040a526 | |
parent | 582cd050de07ddea502ea3591be233aa7411111b (diff) |
spec2xxx-config: Add support for $sysroot/usr/lib*
New releases built by Arm ship runtime libraries in different places
compared to previous releases. In addition to $sysroot/lib and
$sysroot/lib64, they also use $sysroot/usr/lib and possibly
$sysroot/usr/lib64 (the latter in aarch64 toolchains only).
Add all the possibilities so that the scripts can cope with old and
new releases.
Maybe the Arm releases layout can be changed to match watch previous
releases used?
Change-Id: I4324523f7bbc3cc59176d18da600bd04031ae14a
-rwxr-xr-x | spec2xxx-config | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/spec2xxx-config b/spec2xxx-config index 751c38b..9a48939 100755 --- a/spec2xxx-config +++ b/spec2xxx-config @@ -221,17 +221,24 @@ case "$mfpu:$hw_fpu" in esac if [ x"$sysroot" != x"" ]; then + # Depending on how they are built, some releases use + # $sysroot/usr/lib and $sysroot/usr/lib64, in addition to + # $sysroot/lib and $sysroot/lib64. We need to add all of them to + # the paths; adding non-existing dirs is safe (they are skipped). + # If $sysroot/lib64 exists, scan it. If it doesn't exist, don't - # include it in the list otherwise find fails and the script + # include it in the list otherwise 'find' fails and the script # exits. if [ -d "$sysroot/lib64" ]; then ldso="$(find "$sysroot/lib" "$sysroot/lib64" -name "ld-*.so")" - rpath64="-Wl,-rpath=$sysroot/lib64" - libpath="$sysroot/lib:$sysroot/lib64" + rpath64="-Wl,-rpath=$sysroot/lib64 -Wl,-rpath=$sysroot/usr/lib64" + # Start libpath64 with ':' so that it can be appended to the + # other components + libpath64=":$sysroot/lib64:$sysroot/usr/lib64" else ldso="$(find "$sysroot/lib" -name "ld-*.so")" rpath64="" - libpath="$sysroot/lib" + libpath64="" fi if [ "x$ldso" = "x" ]; then echo "ERROR: Could not find ld-*.so under $sysroot/lib or $sysroot/lib64" @@ -243,7 +250,7 @@ if [ x"$sysroot" != x"" ]; then exit 1 fi cc_flags="-Wl,-dynamic-linker=$ldso -Wl,-rpath=$sysroot/lib ${rpath64} $cc_flags" - getconf_prog="$ldso --library-path $libpath $sysroot/usr/bin/getconf" + getconf_prog="$ldso --library-path $sysroot/lib:$sysroot/usr/lib$libpath64 $sysroot/usr/bin/getconf" else getconf_prog=getconf fi |