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/libvorbis | |
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/libvorbis')
-rwxr-xr-x | Ports/libvorbis/package.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Ports/libvorbis/package.sh b/Ports/libvorbis/package.sh index 37511b308c..fd08758474 100755 --- a/Ports/libvorbis/package.sh +++ b/Ports/libvorbis/package.sh @@ -8,10 +8,10 @@ depends=libogg install() { run make DESTDIR=${SERENITY_INSTALL_ROOT} $installopts install - ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbis.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbis.a -Wl,--no-whole-archive -logg + ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbis.so -Wl,-soname,libvorbis.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbis.a -Wl,--no-whole-archive -logg rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbis.la - ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbisenc.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbisenc.a -Wl,--no-whole-archive -lvorbis + ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbisenc.so -Wl,-soname,libvorbisenc.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbisenc.a -Wl,--no-whole-archive -lvorbis rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbisenc.la - ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbisfile.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbisfile.a -Wl,--no-whole-archive -lvorbis + ${CC} -shared -o ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbisfile.so -Wl,-soname,libvorbisfile.so -Wl,--whole-archive ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbisfile.a -Wl,--no-whole-archive -lvorbis rm -f ${SERENITY_INSTALL_ROOT}/usr/local/lib/libvorbisfile.la } |