aboutsummaryrefslogtreecommitdiffstats
path: root/main/gcc/APKBUILD
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-11-21 09:22:04 +0000
committerTimo Teräs <timo.teras@iki.fi>2016-11-21 09:23:28 +0000
commit00e663018392edf10f75b62be0b1663eca5c1c63 (patch)
tree87b9e0e0d4e26ceea024069fc788d5628c11efe4 /main/gcc/APKBUILD
parent9162ccbae91ac9182ae538d070b4837052d546a5 (diff)
downloadaports-00e663018392edf10f75b62be0b1663eca5c1c63.tar.gz
aports-00e663018392edf10f75b62be0b1663eca5c1c63.tar.bz2
aports-00e663018392edf10f75b62be0b1663eca5c1c63.tar.xz
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.
Diffstat (limited to 'main/gcc/APKBUILD')
-rw-r--r--main/gcc/APKBUILD10
1 files changed, 10 insertions, 0 deletions
diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD
index 3396796f5f..bf70b921f2 100644
--- a/main/gcc/APKBUILD
+++ b/main/gcc/APKBUILD
@@ -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
}