summaryrefslogtreecommitdiff
path: root/Ports/libtiff/package.sh
diff options
context:
space:
mode:
authorGunnar Beutner <gunnar@beutner.name>2021-04-25 08:42:41 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-25 10:14:50 +0200
commit5b69e8d2c67cf9c05dac61393edaaa0a363993aa (patch)
tree3cccaade28a00bdc9a3cc2da4a80b7118ffd504c /Ports/libtiff/package.sh
parente6953d14d8e9f430e70071e23b6ad3f4f440d0de (diff)
downloadserenity-5b69e8d2c67cf9c05dac61393edaaa0a363993aa.zip
Ports: Build shared libraries with -Wl,-soname
Without a SONAME gcc will put the whole library path into executables which link against these libraries: $ readelf -d Root/usr/local/games/openttd Dynamic section at offset 0xf0747c contains 32 entries: Tag Type Name/Value 0x00000001 (NEEDED) [libgcc_s.so] 0x00000001 (NEEDED) [/serenity/Build/i686/Root/usr/local/lib/libpng.so] 0x00000001 (NEEDED) [/serenity/Build/i686/Root/usr/local/lib/libz.so] 0x00000001 (NEEDED) [/serenity/Build/i686/Root/usr/local/lib/liblzma.so] 0x00000001 (NEEDED) [libSDL2-2.0.so.1] 0x00000001 (NEEDED) [libicui18n.so.69] 0x00000001 (NEEDED) [libicuuc.so.69] 0x00000001 (NEEDED) [libicudata.so.69] 0x00000001 (NEEDED) [libpthread.so] 0x00000001 (NEEDED) [libm.so] 0x00000001 (NEEDED) [libc.so] This causes the executable to fail because the dynamic linker tries to find the library in the incorrect path.
Diffstat (limited to 'Ports/libtiff/package.sh')
-rwxr-xr-xPorts/libtiff/package.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/Ports/libtiff/package.sh b/Ports/libtiff/package.sh
index bf802063c2..e6a9b351d0 100755
--- a/Ports/libtiff/package.sh
+++ b/Ports/libtiff/package.sh
@@ -11,7 +11,7 @@ depends="zstd xz"
install() {
run make DESTDIR=${SERENITY_INSTALL_ROOT} $installopts install
- ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiff.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiff.a -Wl,--no-whole-archive -lzstd -llzma
- ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiffxx.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiffxx.a -Wl,--no-whole-archive -lzstd -llzma
+ ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiff.so -Wl,-soname,libtiff.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiff.a -Wl,--no-whole-archive -lzstd -llzma
+ ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiffxx.so -Wl,-soname,libtiffxx.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiffxx.a -Wl,--no-whole-archive -lzstd -llzma
rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiff.la ${SERENITY_INSTALL_ROOT}/usr/local/lib/libtiffxx.la
}