Skip to content

Commit

Permalink
Cross-compile to armhf
Browse files Browse the repository at this point in the history
  • Loading branch information
lalinsky committed Jan 26, 2020
1 parent 8ef82a6 commit 5c4b451
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@ jobs:
arch:
- x86_64
- i686
- armhf
env:
ARCH: ${{ matrix.arch }}
steps:
- uses: actions/checkout@v1
- name: Install dependencies
run: sudo apt-get install nasm gcc-multilib
run: sudo apt-get install nasm
- name: Install i686 cross-compile dependencies
run: sudo apt-get install gcc-multilib
if: matrix.arch == 'i686'
- name: Install armhf cross-compile dependencies
run: sudo apt-get install gcc-multilib-arm-linux-gnueabihf
if: matrix.arch == 'armhf'
- name: Build
run: |
mkdir artifacts
Expand Down Expand Up @@ -92,6 +99,10 @@ jobs:
with:
name: ffmpeg-linux-i686
path: artifacts/
- uses: actions/download-artifact@v1
with:
name: ffmpeg-linux-armhf
path: artifacts/
- uses: actions/download-artifact@v1
with:
name: ffmpeg-windows-x86_64
Expand Down
24 changes: 23 additions & 1 deletion build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,29 @@ case $ARCH in
i686)
FFMPEG_CONFIGURE_FLAGS+=(--cc="gcc -m32")
;;
x86_64|armhf)
armhf*)
FFMPEG_CONFIGURE_FLAGS+=(
--enable-cross-compile
--cross-prefix=arm-linux-gnueabihf-
--target-os=linux
--arch=arm
)
case $ARCH in
armhf-rpi2)
FFMPEG_CONFIGURE_FLAGS+=(
--cpu=cortex-a7
--extra-cflags='-fPIC -mcpu=cortex-a7 -mfloat-abi=hard -mfpu=neon-vfpv4 -mvectorize-with-neon-quad'
)
;;
armhf-rpi3)
FFMPEG_CONFIGURE_FLAGS+=(
--cpu=cortex-a53
--extra-cflags='-fPIC -mcpu=cortex-a53 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mvectorize-with-neon-quad'
)
;;
esac
;;
x86_64)
;;
*)
echo "Unknown architecture"
Expand Down

0 comments on commit 5c4b451

Please sign in to comment.