From 00e663018392edf10f75b62be0b1663eca5c1c63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Mon, 21 Nov 2016 09:22:04 +0000 Subject: [PATCH] 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. --- main/gcc/APKBUILD | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD index 3396796f5f7..bf70b921f22 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 }