1, android studio使用ffmpeg解码h264编译报错:
third_party/ffmpeg/ffmpeg_internal/videodsp.o: in function `ff_prefetch_aarch64':
(.text+0x10): relocation truncated to fit: R_AARCH64_CONDBR19 against symbol `ff_prefetch_aarch64' defined in .text section in obj/third_party/ffmpeg/ffmpeg_internal/videodsp.o
2,查看相关代码
third_party/ffmpeg/libavcodec/aarch64/videodsp.S
#include "libavutil/aarch64/asm.S"
function ff_prefetch_aarch64, export=1
subs w2, w2, #2
prfm pldl1strm, [x0]
prfm pldl1strm, [x0, x1]
add x0, x0, x1, lsl #1
b.gt X(ff_prefetch_aarch64)
ret
endfunc
3,原因:由于链接器如何将部分分配到地址空间造成的
4,修改以下文件
third_party/ffmpeg/libavcodec/aarch64/videodsp.S:
#include "libavutil/aarch64/asm.S"
function ff_prefetch_aarch64, export=1
subs w2, w2, #2
prfm pldl1strm, [x0]
prfm pldl1strm, [x0, x1]
add x0, x0, x1, lsl #1
b X(ff_prefetch_aarch64)
1:
ret
endfunc