-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
190 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
ARG GH_REPO=ghcr.io/btbn/ffmpeg-builds | ||
FROM $GH_REPO/base:latest | ||
|
||
RUN \ | ||
git clone --filter=blob:none https://github.com/mstorsjo/llvm-mingw /llvm-mingw && cd /llvm-mingw && \ | ||
./build-all.sh --disable-lldb --disable-lldb-mi /opt/llvm-mingw && \ | ||
cd / && \ | ||
rm -rf llvm-mingw | ||
|
||
# LLVM/Clang workarounds | ||
RUN \ | ||
ln -s windows.h /opt/llvm-mingw/generic-w64-mingw32/include/Windows.h | ||
|
||
# Prepare "cross" environment to heavily favour static builds | ||
RUN \ | ||
find /opt/llvm-mingw \ | ||
-name "*.dll" \ | ||
-or -name "*.dll.a" \ | ||
-delete && \ | ||
mkdir /opt/ffbuild | ||
|
||
ENV FFBUILD_TOOLCHAIN=aarch64-w64-mingw32 \ | ||
FFBUILD_RUST_TARGET=aarch64-pc-windows-gnullvm | ||
|
||
RUN \ | ||
rustup default nightly && \ | ||
rustup +nightly component add rust-src && \ | ||
echo "[unstable]\nbuild-std = [\"core\", \"alloc\", \"std\", \"proc_macro\"]\n" > "$CARGO_HOME"/config.toml && \ | ||
echo "[target.$FFBUILD_RUST_TARGET]\nlinker = \"${FFBUILD_TOOLCHAIN}-clang\"\nar = \"${FFBUILD_TOOLCHAIN}-llvm-ar\"\n" >> "$CARGO_HOME"/config.toml | ||
|
||
ADD toolchain.cmake /toolchain.cmake | ||
ADD cross.meson /cross.meson | ||
|
||
ENV PATH="/opt/llvm-mingw/bin:${PATH}" \ | ||
FFBUILD_TARGET_FLAGS="--pkg-config=pkg-config --cross-prefix=${FFBUILD_TOOLCHAIN}- --arch=aarch64 --target-os=mingw32" \ | ||
FFBUILD_CROSS_PREFIX=${FFBUILD_TOOLCHAIN}- \ | ||
FFBUILD_PREFIX=/opt/ffbuild \ | ||
FFBUILD_CMAKE_TOOLCHAIN=/toolchain.cmake \ | ||
PKG_CONFIG=pkg-config \ | ||
PKG_CONFIG_LIBDIR=/opt/ffbuild/lib/pkgconfig:/opt/ffbuild/share/pkgconfig \ | ||
COMPILER_SYSROOT=/opt/llvm-mingw/aarch64-w64-mingw32 \ | ||
CC="${FFBUILD_TOOLCHAIN}-clang" \ | ||
CXX="${FFBUILD_TOOLCHAIN}-clang++" \ | ||
LD="${FFBUILD_TOOLCHAIN}-ld" \ | ||
AR="${FFBUILD_TOOLCHAIN}-llvm-ar" \ | ||
RANLIB="${FFBUILD_TOOLCHAIN}-llvm-ranlib" \ | ||
NM="${FFBUILD_TOOLCHAIN}-nm" \ | ||
DLLTOOL="${FFBUILD_TOOLCHAIN}-dlltool" \ | ||
CFLAGS="-I/opt/ffbuild/include -O2 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong" \ | ||
CXXFLAGS="-I/opt/ffbuild/include -O2 -pipe -D_FORTIFY_SOURCE=2 -fstack-protector-strong" \ | ||
LDFLAGS="-L/opt/ffbuild/lib -O2 -pipe -fstack-protector-strong" \ | ||
STAGE_CFLAGS="" \ | ||
STAGE_CXXFLAGS="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[binaries] | ||
c = 'aarch64-w64-mingw32-clang' | ||
cpp = 'aarch64-w64-mingw32-clang++' | ||
ar = 'aarch64-w64-mingw32-llvm-ar' | ||
ranlib = 'aarch64-w64-mingw32-llvm-ranlib' | ||
strip = 'aarch64-w64-mingw32-strip' | ||
windres = 'aarch64-w64-mingw32-windres' | ||
dlltool = 'aarch64-w64-mingw32-dlltool' | ||
exe_wrapper = ['wine'] | ||
|
||
[properties] | ||
needs_exe_wrapper = true | ||
|
||
[host_machine] | ||
system = 'windows' | ||
cpu_family = 'aarch64' | ||
cpu = 'aarch64' | ||
endian = 'little' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
set(CMAKE_SYSTEM_NAME Windows) | ||
set(CMAKE_SYSTEM_PROCESSOR aarch64) | ||
|
||
set(triple aarch64-w64-mingw32) | ||
|
||
set(CMAKE_C_COMPILER ${triple}-clang) | ||
set(CMAKE_CXX_COMPILER ${triple}-clang++) | ||
set(CMAKE_RC_COMPILER ${triple}-windres) | ||
set(CMAKE_RANLIB ${triple}-llvm-ranlib) | ||
set(CMAKE_AR ${triple}-llvm-ar) | ||
|
||
set(CMAKE_SYSROOT /opt/llvm-mingw/${triple}) | ||
set(CMAKE_FIND_ROOT_PATH /opt/llvm-mingw /opt/llvm-mingw/${triple} /opt/ffbuild) | ||
|
||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.