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

@ -2,8 +2,9 @@
Static Windows Builds of ffmpeg master and latest release branch.
EXPERIMENTAL Linux-Builds. Do not expect everything to work on them, specially anything that involved loading dynamic libs at runtime.
Shared Linux builds come without the programs (hopefully just for now), since they won't run without musl.
EXPERIMENTAL Linux-Builds. Do not expect everything to work on them, specially anything that involves loading dynamic libs at runtime.
Shared Linux builds need musl installed to run the programs. YMMV when trying to use the libraries.
Please report any issues you encounter with those builds!
## Auto-Builds

View file

@ -57,8 +57,8 @@ docker run --rm -i "${UIDARGS[@]}" -v $PWD/ffbuild:/ffbuild "$IMAGE" bash -s <<E
cd ffmpeg
git checkout $GIT_BRANCH
./configure --prefix=/ffbuild/prefix --pkg-config-flags="--static" \$FFBUILD_TARGET_FLAGS $FF_CONFIGURE --extra-cflags="$FF_CFLAGS" --extra-cxxflags="$FF_CXXFLAGS" --extra-ldflags="$FF_LDFLAGS" --extra-libs="$FF_LIBS"
make -j\$(nproc)
./configure --prefix=/ffbuild/prefix --pkg-config-flags="--static" \$FFBUILD_TARGET_FLAGS $FF_CONFIGURE --extra-cflags='$FF_CFLAGS' --extra-cxxflags='$FF_CXXFLAGS' --extra-ldflags='$FF_LDFLAGS' --extra-libs='$FF_LIBS'
make -j\$(nproc) V=1
make install install-doc
EOF

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
}

View file

@ -4,8 +4,8 @@ package_variant() {
IN="$1"
OUT="$2"
# mkdir -p "$OUT"/bin
# cp "$IN"/bin/* "$OUT"/bin
mkdir -p "$OUT"/bin
cp "$IN"/bin/* "$OUT"/bin
mkdir -p "$OUT"/lib
cp -a "$IN"/lib/*.so* "$OUT"/lib