diff options
author | Gunnar Beutner <gunnar@beutner.name> | 2021-04-25 08:42:41 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-25 10:14:50 +0200 |
commit | 5b69e8d2c67cf9c05dac61393edaaa0a363993aa (patch) | |
tree | 3cccaade28a00bdc9a3cc2da4a80b7118ffd504c /Ports/libjpeg/package.sh | |
parent | e6953d14d8e9f430e70071e23b6ad3f4f440d0de (diff) | |
download | serenity-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/libjpeg/package.sh')
-rwxr-xr-x | Ports/libjpeg/package.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Ports/libjpeg/package.sh b/Ports/libjpeg/package.sh index fd17c70dd8..eaec025364 100755 --- a/Ports/libjpeg/package.sh +++ b/Ports/libjpeg/package.sh @@ -8,6 +8,6 @@ workdir="jpeg-$version" install() { run make DESTDIR=${SERENITY_INSTALL_ROOT} $installopts install - ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libjpeg.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libjpeg.a -Wl,--no-whole-archive + ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libjpeg.so -Wl,-soname,libjpeg.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libjpeg.a -Wl,--no-whole-archive rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/libjpeg.la } |