Enable shared linux programs (EXPERIMENTAL)

This commit is contained in:
BtbN
2021-05-13 17:35:45 +02:00
parent 368897e4b2
commit 8df6a4b92d
4 changed files with 12 additions and 19 deletions

View File

@ -21,22 +21,14 @@ ffbuild_dockerbuild() {
}
ffbuild_ldflags() {
if [[ $VARIANT == *shared* ]]; then
#if [[ $TARGET == *64* ]]; then
# echo "-Wl,--dynamic-linker=/lib64/ld-linux-x86-64.so.2"
#else
# echo "-Wl,--dynamic-linker=/lib/ld-linux.so.2"
#fi
return 0
else
if [[ $VARIANT != *shared* ]]; then
echo "-pie -fPIE -static"
fi
}
ffbuild_configure() {
# Any dynamic executables linked against musl need its dynamic loader to run
# Thus it's impossible to build both the libraries and the programs, since
# with shared libs, the programs need to be dynamic, and in turn needs the musl
# dynamic loader at runtime.
[[ $VARIANT == *shared* ]] && echo --disable-programs
if [[ $VARIANT == *shared* ]]; then
# Can't escape hell
echo --extra-ldexeflags=\'-Wl,-rpath='\\\\\\\$\\\$ORIGIN'\\ -Wl,-rpath='\\\\\\\$\\\$ORIGIN/../lib'\'
fi
}