diff --git a/README.md b/README.md index 5bc2ea5..19930c2 100644 --- a/README.md +++ b/README.md @@ -52,11 +52,8 @@ Available targets: The linuxarm64 target will not build some dependencies due to lack of arm64 (aarch64) architecture support or cross-compiling restrictions. -* `libx11` and dependencies: libx11 and its dependencies don't seem to support cross-compiling. -* `SDL`: Because it depends on libx11. * `davs2` and `xavs2`: aarch64 support is broken. * `libmfx` and `libva`: Library for Intel QSV, so there is no aarch64 support. -* `ffplay` binary: Because it depends on libx11 and SDL. Available: * `gpl` Includes all dependencies, even those that require full GPL instead of just LGPL. diff --git a/scripts.d/45-x11/40-libx11.sh b/scripts.d/45-x11/40-libx11.sh index 2de5c4b..23016dc 100755 --- a/scripts.d/45-x11/40-libx11.sh +++ b/scripts.d/45-x11/40-libx11.sh @@ -5,7 +5,6 @@ LIBX11_COMMIT="3a30ada60c5217ada37b143b541c8e6f6284c7fa" ffbuild_enabled() { [[ $TARGET != linux* ]] && return -1 - [[ $TARGET == linuxarm64 ]] && return -1 return 0 } @@ -28,6 +27,12 @@ ffbuild_dockerbuild() { --enable-ipv6 ) + if [[ $TARGET == linuxarm64 ]]; then + myconf+=( + --disable-malloc0returnsnull + ) + fi + if [[ $TARGET == linux* ]]; then myconf+=( --host="$FFBUILD_TOOLCHAIN" diff --git a/scripts.d/45-x11/50-libxext.sh b/scripts.d/45-x11/50-libxext.sh index 3d7006a..721c255 100755 --- a/scripts.d/45-x11/50-libxext.sh +++ b/scripts.d/45-x11/50-libxext.sh @@ -5,7 +5,6 @@ LIBXEXT_COMMIT="47904063048fa6ef6e8e16219ddef4d14d5d9a4b" ffbuild_enabled() { [[ $TARGET != linux* ]] && return -1 - [[ $TARGET == linuxarm64 ]] && return -1 return 0 } @@ -26,6 +25,12 @@ ffbuild_dockerbuild() { --without-lint ) + if [[ $TARGET == linuxarm64 ]]; then + myconf+=( + --disable-malloc0returnsnull + ) + fi + if [[ $TARGET == linux* ]]; then myconf+=( --host="$FFBUILD_TOOLCHAIN" diff --git a/scripts.d/45-x11/50-libxfixes.sh b/scripts.d/45-x11/50-libxfixes.sh index 7c5f6d3..693f3dd 100755 --- a/scripts.d/45-x11/50-libxfixes.sh +++ b/scripts.d/45-x11/50-libxfixes.sh @@ -5,7 +5,6 @@ LIBXFIXES_COMMIT="6fe3bd64dd82f704ed91478acb4c99ab5c00be16" ffbuild_enabled() { [[ $TARGET != linux* ]] && return -1 - [[ $TARGET == linuxarm64 ]] && return -1 return 0 } diff --git a/scripts.d/45-x11/50-libxi.sh b/scripts.d/45-x11/50-libxi.sh index 8d12604..d4a205c 100755 --- a/scripts.d/45-x11/50-libxi.sh +++ b/scripts.d/45-x11/50-libxi.sh @@ -5,7 +5,6 @@ LIBXI_COMMIT="f24d7f43ab4d97203e60677a3d42e11dbc80c8b4" ffbuild_enabled() { [[ $TARGET != linux* ]] && return -1 - [[ $TARGET == linuxarm64 ]] && return -1 return 0 } @@ -22,6 +21,12 @@ ffbuild_dockerbuild() { --with-pic ) + if [[ $TARGET == linuxarm64 ]]; then + myconf+=( + --disable-malloc0returnsnull + ) + fi + if [[ $TARGET == linux* ]]; then myconf+=( --host="$FFBUILD_TOOLCHAIN" diff --git a/scripts.d/45-x11/50-libxinerama.sh b/scripts.d/45-x11/50-libxinerama.sh index bd94cb8..50b72fd 100755 --- a/scripts.d/45-x11/50-libxinerama.sh +++ b/scripts.d/45-x11/50-libxinerama.sh @@ -5,7 +5,6 @@ LIBXINERAMA_COMMIT="c5187f076d16601c15c59c5a2f05c0513d9f042b" ffbuild_enabled() { [[ $TARGET != linux* ]] && return -1 - [[ $TARGET == linuxarm64 ]] && return -1 return 0 } @@ -22,6 +21,12 @@ ffbuild_dockerbuild() { --with-pic ) + if [[ $TARGET == linuxarm64 ]]; then + myconf+=( + --disable-malloc0returnsnull + ) + fi + if [[ $TARGET == linux* ]]; then myconf+=( --host="$FFBUILD_TOOLCHAIN" diff --git a/scripts.d/45-x11/50-libxrender.sh b/scripts.d/45-x11/50-libxrender.sh index 8d2c475..7e3f6bf 100755 --- a/scripts.d/45-x11/50-libxrender.sh +++ b/scripts.d/45-x11/50-libxrender.sh @@ -5,7 +5,6 @@ LIBXRENDER_COMMIT="bce0618839fc33f44edd8b5498b8e33d167806ff" ffbuild_enabled() { [[ $TARGET != linux* ]] && return -1 - [[ $TARGET == linuxarm64 ]] && return -1 return 0 } @@ -22,6 +21,12 @@ ffbuild_dockerbuild() { --with-pic ) + if [[ $TARGET == linuxarm64 ]]; then + myconf+=( + --disable-malloc0returnsnull + ) + fi + if [[ $TARGET == linux* ]]; then myconf+=( --host="$FFBUILD_TOOLCHAIN" diff --git a/scripts.d/45-x11/50-libxscrnsaver.sh b/scripts.d/45-x11/50-libxscrnsaver.sh index c227c4d..e07aa3f 100755 --- a/scripts.d/45-x11/50-libxscrnsaver.sh +++ b/scripts.d/45-x11/50-libxscrnsaver.sh @@ -5,7 +5,6 @@ LIBXSCRNSAVER_COMMIT="aa9fd5061d0a8832480ad0c1acc9d2e864e807f4" ffbuild_enabled() { [[ $TARGET != linux* ]] && return -1 - [[ $TARGET == linuxarm64 ]] && return -1 return 0 } @@ -22,6 +21,12 @@ ffbuild_dockerbuild() { --with-pic ) + if [[ $TARGET == linuxarm64 ]]; then + myconf+=( + --disable-malloc0returnsnull + ) + fi + if [[ $TARGET == linux* ]]; then myconf+=( --host="$FFBUILD_TOOLCHAIN" diff --git a/scripts.d/45-x11/50-libxxf86vm.sh b/scripts.d/45-x11/50-libxxf86vm.sh index bb13de9..b03ac76 100755 --- a/scripts.d/45-x11/50-libxxf86vm.sh +++ b/scripts.d/45-x11/50-libxxf86vm.sh @@ -5,7 +5,6 @@ LIBXXF86VM_COMMIT="7f43cd2a905e7b93b83c9ce81dabb768f6fa2bc7" ffbuild_enabled() { [[ $TARGET != linux* ]] && return -1 - [[ $TARGET == linuxarm64 ]] && return -1 return 0 } @@ -22,6 +21,12 @@ ffbuild_dockerbuild() { --with-pic ) + if [[ $TARGET == linuxarm64 ]]; then + myconf+=( + --disable-malloc0returnsnull + ) + fi + if [[ $TARGET == linux* ]]; then myconf+=( --host="$FFBUILD_TOOLCHAIN" diff --git a/scripts.d/45-x11/60-libglvnd.sh b/scripts.d/45-x11/60-libglvnd.sh index c112b95..dbf1e62 100755 --- a/scripts.d/45-x11/60-libglvnd.sh +++ b/scripts.d/45-x11/60-libglvnd.sh @@ -5,7 +5,6 @@ GLVND_COMMIT="8e5f0f16467cc8ce870789d9a5b6a2c3f58921c9" ffbuild_enabled() { [[ $TARGET != linux* ]] && return -1 - [[ $TARGET == linuxarm64 ]] && return -1 return 0 } diff --git a/scripts.d/45-x11/60-libxcursor.sh b/scripts.d/45-x11/60-libxcursor.sh index 7718117..4a11470 100755 --- a/scripts.d/45-x11/60-libxcursor.sh +++ b/scripts.d/45-x11/60-libxcursor.sh @@ -5,7 +5,6 @@ LIBXCURSOR_COMMIT="27adb16027fa99d83818a0ed9f6623cb03f0c574" ffbuild_enabled() { [[ $TARGET != linux* ]] && return -1 - [[ $TARGET == linuxarm64 ]] && return -1 return 0 } diff --git a/scripts.d/45-x11/60-libxrandr.sh b/scripts.d/45-x11/60-libxrandr.sh index 463d327..43b727f 100755 --- a/scripts.d/45-x11/60-libxrandr.sh +++ b/scripts.d/45-x11/60-libxrandr.sh @@ -5,7 +5,6 @@ LIBXRANDR_COMMIT="55dcda4518eda8ae03ef25ea29d3c994ad71eb0a" ffbuild_enabled() { [[ $TARGET != linux* ]] && return -1 - [[ $TARGET == linuxarm64 ]] && return -1 return 0 } @@ -22,6 +21,12 @@ ffbuild_dockerbuild() { --with-pic ) + if [[ $TARGET == linuxarm64 ]]; then + myconf+=( + --disable-malloc0returnsnull + ) + fi + if [[ $TARGET == linux* ]]; then myconf+=( --host="$FFBUILD_TOOLCHAIN" diff --git a/scripts.d/45-x11/60-libxv.sh b/scripts.d/45-x11/60-libxv.sh index 3eb0107..8b9b00f 100755 --- a/scripts.d/45-x11/60-libxv.sh +++ b/scripts.d/45-x11/60-libxv.sh @@ -5,7 +5,6 @@ LIBXV_COMMIT="03a6f599d060591a9a7cd8558bd2143a1c7c70d7" ffbuild_enabled() { [[ $TARGET != linux* ]] && return -1 - [[ $TARGET == linuxarm64 ]] && return -1 [[ $ADDINS_STR == *4.4* ]] && return -1 return 0 } @@ -24,6 +23,12 @@ ffbuild_dockerbuild() { --without-lint ) + if [[ $TARGET == linuxarm64 ]]; then + myconf+=( + --disable-malloc0returnsnull + ) + fi + if [[ $TARGET == linux* ]]; then myconf+=( --host="$FFBUILD_TOOLCHAIN" diff --git a/scripts.d/50-rav1e.sh b/scripts.d/50-rav1e.sh index dc44132..d0a604f 100755 --- a/scripts.d/50-rav1e.sh +++ b/scripts.d/50-rav1e.sh @@ -25,11 +25,7 @@ ffbuild_dockerbuild() { ) fi - # For some reason, RUSTFLAGS, CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER, - # and .cargo/config.toml can't work, so have to put a symbolic link - if [[ $TARGET == linuxarm64 ]]; then - ln -s /opt/ct-ng/bin/aarch64-ffbuild-linux-gnu-gcc /opt/ct-ng/bin/aarch64-linux-gnu-gcc - fi + export CC="${FFBUILD_CROSS_PREFIX}gcc" cargo cinstall "${myconf[@]}" } diff --git a/scripts.d/50-sdl.sh b/scripts.d/50-sdl.sh index da02c12..642abf3 100755 --- a/scripts.d/50-sdl.sh +++ b/scripts.d/50-sdl.sh @@ -4,7 +4,6 @@ SDL_REPO="https://github.com/libsdl-org/SDL.git" SDL_COMMIT="0a93ac129475ab3ce11af95969f767d60e98233a" ffbuild_enabled() { - [[ $TARGET == linuxarm64 ]] && return -1 return 0 } diff --git a/scripts.d/50-vidstab.sh b/scripts.d/50-vidstab.sh index e9326e4..27e4955 100755 --- a/scripts.d/50-vidstab.sh +++ b/scripts.d/50-vidstab.sh @@ -15,12 +15,18 @@ ffbuild_dockerbuild() { mkdir build && cd build - local disable_sse2="" + local mycmake=( + -DBUILD_SHARED_LIBS=OFF + -DUSE_OMP=ON + ) + if [[ $TARGET == *arm64 ]]; then - disable_sse2=-DSSE2_FOUND=FALSE + mycmake+=( + -DSSE2_FOUND=FALSE + ) fi - cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" -DBUILD_SHARED_LIBS=OFF -DUSE_OMP=ON $disable_sse2 .. + cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" "${mycmake[@]}" .. make -j$(nproc) make install