在 ARM 64 位平台上编译 x264 时出错
Error in compiling x264 on ARM 64-bit platform
同样的x264源码我在Debian 10(Buster)系统上编译没有问题,但是在ARM 64位平台上编译不了。为什么?
可能是Makefile有问题,但不知道出在哪里
配置
./configure --disable-asm --enable-shared --host=aarch64-linux
platform: AARCH64
byte order: little-endian
system: LINUX
cli: yes
libx264: internal
shared: yes
static: no
asm: no
interlaced: yes
avs: avxsynth
lavf: no
ffms: no
mp4: no
gpl: yes
thread: posix
opencl: yes
filters: crop select_every
lto: no
debug: no
gprof: no
strip: no
PIC: yes
bit depth: all
chroma format: all
编辑文件config.mak,
SRCPATH=.
prefix=/usr/local
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
libdir=${exec_prefix}/lib
includedir=${prefix}/include
SYS_ARCH=AARCH64
SYS=LINUX
CC=aarch64-linux-gnu-gcc
CFLAGS=-Wno-maybe-uninitialized -Wshadow -O3 -ffast-math -Wall -I. -I$(SRCPATH) -std=gnu99 -
D_GNU_SOURCE -fPIC -fomit-frame-pointer -fno-tree-vectorize
COMPILER=GNU
COMPILER_STYLE=GNU
DEPMM=-MM -g0
DEPMT=-MT
LD=aarch64-linux-gnu-gcc -o
LDFLAGS= -lm -lpthread -ldl
LIBX264=libx264.a
AR=aarch64-linux-gnu-gcc-ar rc
RANLIB=aarch64-linux-gnu-gcc-ranlib
STRIP=aarch64-linux-gnu-strip
INSTALL=install
AS=
ASFLAGS= -I. -I$(SRCPATH) -DSTACK_ALIGNMENT=16 -DPIC
RC=
RCFLAGS=
EXE=
HAVE_GETOPT_LONG=1
DEVNULL=/dev/null
PROF_GEN_CC=-fprofile-generate
PROF_GEN_LD=-fprofile-generate
PROF_USE_CC=-fprofile-use
PROF_USE_LD=-fprofile-use
HAVE_OPENCL=yes
CC_O=-o $@
default: cli
install: install-cli
SOSUFFIX=so
SONAME=libx264.so.157
SOFLAGS=-shared -Wl,-soname,$(SONAME) -Wl,-Bsymbolic
default: lib-shared
install: install-lib-shared
LDFLAGSCLI = -ldl
CLI_LIBX264 = $(LIBX264)
制作,出现错误,详情在error.
配置后添加文件config.h,
#define HAVE_MALLOC_H 1
#define ARCH_X86_64 1
#define SYS_LINUX 1
#define STACK_ALIGNMENT 64
#define HAVE_POSIXTHREAD 1
#define HAVE_CPU_COUNT 1
#define HAVE_THREAD 1
#define HAVE_LOG2F 1
#define HAVE_STRTOK_R 1
#define HAVE_CLOCK_GETTIME 1
#define HAVE_MMAP 1
#define HAVE_THP 1
#define HAVE_AVS 1
#define USE_AVXSYNTH 1
#define HAVE_VECTOREXT 1
#define fseek fseeko
#define ftell ftello
#define HAVE_BITDEPTH8 1
#define HAVE_BITDEPTH10 1
#define HAVE_GPL 1
#define HAVE_INTERLACED 1
#define HAVE_OPENCL (BIT_DEPTH==8)
#define HAVE_ALTIVEC 0
#define HAVE_ALTIVEC_H 0
#define HAVE_MMX 0
#define HAVE_ARMV6 0
#define HAVE_ARMV6T2 0
#define HAVE_NEON 0
#define HAVE_BEOSTHREAD 0
#define HAVE_WIN32THREAD 0
#define HAVE_SWSCALE 0
#define HAVE_LAVF 0
#define HAVE_FFMS 0
#define HAVE_GPAC 0
#define HAVE_LSMASH 0
#define HAVE_X86_INLINE_ASM 0
#define HAVE_AS_FUNC 0
#define HAVE_INTEL_DISPATCHER 0
#define HAVE_MSA 0
#define HAVE_WINRT 0
#define HAVE_VSX 0
#define HAVE_ARM_INLINE_ASM 0
我已经通过运行
解决了
./configure --disable-asm --enable-shared --enable-static
同时修改
ASFLAGS= -I. -I$(SRCPATH) -f elf64 -DSTACK_ALIGNMENT=64
同样的x264源码我在Debian 10(Buster)系统上编译没有问题,但是在ARM 64位平台上编译不了。为什么?
可能是Makefile有问题,但不知道出在哪里
配置
./configure --disable-asm --enable-shared --host=aarch64-linux platform: AARCH64 byte order: little-endian system: LINUX cli: yes libx264: internal shared: yes static: no asm: no interlaced: yes avs: avxsynth lavf: no ffms: no mp4: no gpl: yes thread: posix opencl: yes filters: crop select_every lto: no debug: no gprof: no strip: no PIC: yes bit depth: all chroma format: all
编辑文件config.mak,
SRCPATH=. prefix=/usr/local exec_prefix=${prefix} bindir=${exec_prefix}/bin libdir=${exec_prefix}/lib includedir=${prefix}/include SYS_ARCH=AARCH64 SYS=LINUX CC=aarch64-linux-gnu-gcc CFLAGS=-Wno-maybe-uninitialized -Wshadow -O3 -ffast-math -Wall -I. -I$(SRCPATH) -std=gnu99 - D_GNU_SOURCE -fPIC -fomit-frame-pointer -fno-tree-vectorize COMPILER=GNU COMPILER_STYLE=GNU DEPMM=-MM -g0 DEPMT=-MT LD=aarch64-linux-gnu-gcc -o LDFLAGS= -lm -lpthread -ldl LIBX264=libx264.a AR=aarch64-linux-gnu-gcc-ar rc RANLIB=aarch64-linux-gnu-gcc-ranlib STRIP=aarch64-linux-gnu-strip INSTALL=install AS= ASFLAGS= -I. -I$(SRCPATH) -DSTACK_ALIGNMENT=16 -DPIC RC= RCFLAGS= EXE= HAVE_GETOPT_LONG=1 DEVNULL=/dev/null PROF_GEN_CC=-fprofile-generate PROF_GEN_LD=-fprofile-generate PROF_USE_CC=-fprofile-use PROF_USE_LD=-fprofile-use HAVE_OPENCL=yes CC_O=-o $@ default: cli install: install-cli SOSUFFIX=so SONAME=libx264.so.157 SOFLAGS=-shared -Wl,-soname,$(SONAME) -Wl,-Bsymbolic default: lib-shared install: install-lib-shared LDFLAGSCLI = -ldl CLI_LIBX264 = $(LIBX264)
制作,出现错误,详情在error.
配置后添加文件config.h,
#define HAVE_MALLOC_H 1 #define ARCH_X86_64 1 #define SYS_LINUX 1 #define STACK_ALIGNMENT 64 #define HAVE_POSIXTHREAD 1 #define HAVE_CPU_COUNT 1 #define HAVE_THREAD 1 #define HAVE_LOG2F 1 #define HAVE_STRTOK_R 1 #define HAVE_CLOCK_GETTIME 1 #define HAVE_MMAP 1 #define HAVE_THP 1 #define HAVE_AVS 1 #define USE_AVXSYNTH 1 #define HAVE_VECTOREXT 1 #define fseek fseeko #define ftell ftello #define HAVE_BITDEPTH8 1 #define HAVE_BITDEPTH10 1 #define HAVE_GPL 1 #define HAVE_INTERLACED 1 #define HAVE_OPENCL (BIT_DEPTH==8) #define HAVE_ALTIVEC 0 #define HAVE_ALTIVEC_H 0 #define HAVE_MMX 0 #define HAVE_ARMV6 0 #define HAVE_ARMV6T2 0 #define HAVE_NEON 0 #define HAVE_BEOSTHREAD 0 #define HAVE_WIN32THREAD 0 #define HAVE_SWSCALE 0 #define HAVE_LAVF 0 #define HAVE_FFMS 0 #define HAVE_GPAC 0 #define HAVE_LSMASH 0 #define HAVE_X86_INLINE_ASM 0 #define HAVE_AS_FUNC 0 #define HAVE_INTEL_DISPATCHER 0 #define HAVE_MSA 0 #define HAVE_WINRT 0 #define HAVE_VSX 0 #define HAVE_ARM_INLINE_ASM 0
我已经通过运行
解决了./configure --disable-asm --enable-shared --enable-static
同时修改
ASFLAGS= -I. -I$(SRCPATH) -f elf64 -DSTACK_ALIGNMENT=64