Build error cross-compiling for aarch64 with nasm
I'm maintaining the ffmpeg
package for Synology NAS using the spksrc framework https://github.com/SynoCommunity/spksrc
x264 is currently compiled for multiple archs successfully (armv5-7-8,ppc,x86_64,i686). x86_64 & i686 does have asm enabled using latest nasm compiler.
x264 for aarch64 is currently compiled with --disable-asm
option. When enabling asm (e.g. removing --disable-asm
) for aarch64 builds I get:
/home/spksrc/ffmpeg5/spksrc/toolchain/syno-aarch64-7.1/work/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math -I/home/spksrc/ffmpeg5/spksrc/toolchain/syno-aarch64-7.1/work/aarch64-unknown-linux-gnu/aarch64-unknown-linux-gnu/sysroot/usr/include -I/home/spksrc/ffmpeg5/spksrc/cross/x264/work-aarch64-7.1/install//usr/local/x264/include -Wall -I. -I. -std=gnu99 -D_GNU_SOURCE -fPIC -fomit-frame-pointer -fno-tree-vectorize -fvisibility=hidden -DX264_API_EXPORTS -c common/aarch64/predict-c.c -o common/aarch64/predict-c-10.o -DHIGH_BIT_DEPTH=1 -DBIT_DEPTH=10
/home/spksrc/ffmpeg5/spksrc/native/nasm/work-native/install/usr/local/bin/nasm -I. -I. -c -DSTACK_ALIGNMENT=16 -DPIC -o common/aarch64/bitstream-a-8.o common/aarch64/bitstream-a.S -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
nasm: error: unrecognised option `-c'
make[3]: *** [Makefile:306: common/aarch64/bitstream-a-8.o] Error 1
Depending on the Synology Linux DSM version the gcc cross-compiler is either 4.9.2/7.5 or 8.5. In any case the issue remains the same.
Build options are:
CONFIGURE_ARGS = --enable-shared
CONFIGURE_ARGS += --enable-pic
CONFIGURE_ARGS += --disable-opencl
CONFIGURE_ARGS += --prefix=$(INSTALL_PREFIX)
CONFIGURE_ARGS += --cross-prefix=$(TC_PATH)$(TC_PREFIX)
CONFIGURE_ARGS += --host=aarch64-linux
Configuration is the following:
platform: AARCH64
byte order: little-endian
system: LINUX
cli: yes
libx264: internal
shared: yes
static: no
bashcompletion: no
asm: yes
interlaced: yes
avs: yes
lavf: no
ffms: no
mp4: no
gpl: yes
thread: posix
opencl: no
filters: crop select_every
lto: no
debug: no
gprof: no
strip: no
PIC: yes
bit depth: all
chroma format: all