Skip to content

Commit

Permalink
Enable shared linux programs (EXPERIMENTAL)
Browse files Browse the repository at this point in the history
  • Loading branch information
BtbN committed May 13, 2021
1 parent 368897e commit 8df6a4b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 19 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 5 additions & 13 deletions scripts.d/99-staticify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
4 changes: 2 additions & 2 deletions variants/linux-install-shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8df6a4b

Please sign in to comment.