项目场景:
libx264,交叉编译,安装步骤网上都能搜得到(解压,配置,编译),问题出现在make编译时,会报“v4si”的错误,在网上搜索到的结果,都不太明确如何解决,今天遇到了顺便写一下解决方法:
问题描述
直接看报错信息:
gcc -Wno-maybe-uninitialized -Wshadow -O3 -ffast-math -Wall -I. -I. -std=gnu99 -D_GNU_SOURCE -fPIC -fomit-frame-pointer -fno-tree-vectorize -fvisibility=hidden -c filters/video/cache.c -o filters/video/cache-8.o -DHIGH_BIT_DEPTH=0 -DBIT_DEPTH=8
In file included from ./common/common.h:811:0,
from filters/video/cache.c:28:
./common/rectangle.h: In function ‘x264_macroblock_cache_rect’:
./common/rectangle.h:84:9: error: unknown type name ‘v4si’; did you mean ‘__v4si’?
v4si v16 = {v,v,v,v};
^~~~
__v4si
./common/rectangle.h:84:23: warning: excess elements in scalar initializer
v4si v16 = {v,v,v,v};
^
./common/rectangle.h:84:23: note: (near initialization for ‘v16’)
./common/rectangle.h:84:25: warning: excess elements in scalar initializer
v4si v16 = {v,v,v,v};
^
./common/rectangle.h:84:25: note: (near initialization for ‘v16’)
./common/rectangle.h:84:27: warning: excess elements in scalar initializer
v4si v16 = {v,v,v,v};
^
./common/rectangle.h:84:27: note: (near initialization for ‘v16’)
./common/rectangle.h:86:9: error: can’t convert a value of type ‘int’ to vector type ‘__vector(4) float’ which has different size
M128( d+s*0+0 ) = (__m128)v16;
^~~~
./common/rectangle.h:87:9: error: can’t convert a value of type ‘int’ to vector type ‘__vector(4) float’ which has different size
M128( d+s*1+0 ) = (__m128)v16;
^~~~
./common/rectangle.h:89:9: error: can’t convert a value of type ‘int’ to vector type ‘__vector(4) float’ which has different size
M128( d+s*2+0 ) = (__m128)v16;
^~~~
./common/rectangle.h:90:9: error: can’t convert a value of type ‘int’ to vector type ‘__vector(4) float’ which has different size
M128( d+s*3+0 ) = (__m128)v16;
^~~~
Makefile:284: recipe for target 'filters/video/cache-8.o' failed
make: *** [filters/video/cache-8.o] Error 1
解决方案:
./configure xx (xx是你配置的参数)
配置之后还需要修改config.mak文件信息,如图下所示:
把这个文件所有gcc替换成交叉编译的用的,比如我这里是aarch64-mix210-linux-gcc
保存再make就不会再报这个问题了