Skip to content

Commit

Permalink
Fix cross-compilation by compiling zlib from source (#425)
Browse files Browse the repository at this point in the history
  • Loading branch information
leszko authored Oct 17, 2024
1 parent fe5aff1 commit ffde232
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion install_ffmpeg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ if [[ "$BUILDARCH" == "amd64" && "$BUILDOS" == "linux" && "$GOARCH" == "arm64" &
export STRIP="llvm-strip-14"
export AR="llvm-ar-14"
export RANLIB="llvm-ranlib-14"
export CFLAGS="--target=aarch64-linux-gnu"
export LDFLAGS="--target=aarch64-linux-gnu"
EXTRA_CFLAGS="--target=aarch64-linux-gnu -I/usr/local/cuda_arm64/include $EXTRA_CFLAGS"
EXTRA_LDFLAGS="-fuse-ld=lld --target=aarch64-linux-gnu -L/usr/local/cuda_arm64/lib64 $EXTRA_LDFLAGS"
EXTRA_FFMPEG_FLAGS="$EXTRA_FFMPEG_FLAGS --arch=aarch64 --enable-cross-compile --cc=clang --strip=llvm-strip-14"
EXTRA_FFMPEG_FLAGS="$EXTRA_FFMPEG_FLAGS --arch=aarch64 --enable-cross-compile --cc=clang-14 --strip=llvm-strip-14"
HOST_OS="--host=aarch64-linux-gnu"
fi

Expand Down Expand Up @@ -153,6 +155,16 @@ if [[ ! -e "$ROOT/x264" ]]; then
make -j$NPROC install-lib-static
fi

if [[ ! -e "$ROOT/zlib-1.2.11" ]]; then
cd "$ROOT"
curl -o zlib-1.2.11.tar.gz https://zlib.net/fossils/zlib-1.2.11.tar.gz
tar xf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix="$ROOT/compiled" --static
make -j$NPROC
make -j$NPROC install
fi

if [[ "$GOOS" == "linux" && "$BUILD_TAGS" == *"debug-video"* ]]; then
sudo apt-get install -y libnuma-dev cmake
if [[ ! -e "$ROOT/x265" ]]; then
Expand Down

0 comments on commit ffde232

Please sign in to comment.