main/gcc: expand cross-compiler lib symlinks as linker scripts

This makes gcc to search the actual library from libpath. Needed
because cross-compiler's library is really in --sysroot path.
Alternative is to move the .so files to separate new target arch
specific gcc-dev package. But that'd require musl-dev or build-base
to depend on it, so this is the easy fix around it.
This commit is contained in:
Timo Teräs 2016-11-21 09:22:04 +00:00
parent 9162ccbae9
commit 00e6630183

View File

@ -382,6 +382,16 @@ package() {
rm -rf "$pkgdir"/usr/bin/cc "$pkgdir"/usr/include "$pkgdir"/usr/share
# libcc1 does not depend on target, don't ship it
rm -rf "$pkgdir"/usr/lib/libcc1.so*
# fixup gcc library symlinks to be linker scripts so
# linker finds the libs from relocated sysroot
for so in "$pkgdir"/usr/$CTARGET/lib/*.so; do
if [ -h "$so" ]; then
local _real=$(basename $(readlink "$so"))
rm -f "$so"
echo "GROUP ($_real)" > "$so"
fi
done
fi
}