c - 在 ARM 64 位平台上编译 x264 时出错
问题描述
我在Debian 10 (Buster) 系统上编译的相同 x264 源代码没有问题,但在 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)
Make,发生错误,详细信息在错误中。
配置后添加文件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
推荐阅读
- javascript - 有 2 个 Spotify api 调用,如何将它们放入 1 个 Promise.all?
- python - 熊猫提取细胞的某些部分
- java - 如何识别特定对象字节偏移值并直接从序列化二进制文件中提取?
- django - 如何在 django celery 中读取 .env 文件
- c++ - 如何在 MFC 中对每个 CPropertyPage 进行 OnInitDialog?
- swift - SwiftUI:导航链接到 TabView 中的 DetailView 崩溃
- linux - Selinux 对 Kubernetes 和容器的影响
- mysql - 夜班如何先进后出
- python - 获取正文主元素 Selenium 中子元素的长度
- go - Golang EmbeddedEntity 到数据存储