chromium
chromium copied to clipboard
undefined symbol: ff_avc_parse_nal_units_buf
Hi! Thank you for your HEVC guide. I've tried following, but when I compile the code with autoninja I get the following error:
ninja: Entering directory `out/Default'
[1/85] SOLINK ./libffmpeg.so
FAILED: libffmpeg.so libffmpeg.so.TOC
python "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="nm" --sofile="./libffmpeg.so" --tocfile="./libffmpeg.so.TOC" --output="./libffmpeg.so" -- ../../third_party/llvm-build/Release+Asserts/bin/clang++ -shared -Wl,-Bsymbolic -L gen/third_party/ffmpeg -Wl,--fatal-warnings -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,defs -Wl,--as-needed -fuse-ld=lld -Wl,--icf=all -Wl,--color-diagnostics -m64 -Werror -Wl,-O2 -Wl,--gc-sections -rdynamic -nostdlib++ --sysroot=../../build/linux/debian_sid_amd64-sysroot -L../../build/linux/debian_sid_amd64-sysroot/usr/local/lib/x86_64-linux-gnu -L../../build/linux/debian_sid_amd64-sysroot/lib/x86_64-linux-gnu -L../../build/linux/debian_sid_amd64-sysroot/usr/lib/x86_64-linux-gnu -Wl,-rpath=\$ORIGIN -o "./libffmpeg.so" -Wl,-soname="libffmpeg.so" @"./libffmpeg.so.rsp"
ld.lld: error: undefined symbol: ff_avc_parse_nal_units_buf
>>> referenced by autorename_libavformat_hevc.c
>>> obj/third_party/ffmpeg/ffmpeg_internal/autorename_libavformat_hevc.o:(ff_hevc_annexb2mp4)
ld.lld: error: undefined symbol: ff_avc_parse_nal_units
>>> referenced by autorename_libavformat_hevc.c
>>> obj/third_party/ffmpeg/ffmpeg_internal/autorename_libavformat_hevc.o:(ff_hevc_annexb2mp4)
ld.lld: error: undefined symbol: ff_avc_parse_nal_units_buf
>>> referenced by autorename_libavformat_hevc.c
>>> obj/third_party/ffmpeg/ffmpeg_internal/autorename_libavformat_hevc.o:(ff_isom_write_hvcc)
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
Any help would be appreciated. Thanks!
@adarshdec23: you should understand dependencies.. if you search for ff_avc_parse_nal_units_buf then you see that it's in the file "avformat/avc.c", try to include it
Indeed that was my first try too, if you mean to include the header (.h) file instead of the "c" file. This is the step the causes the issue: `then go to src/third_party/ffmpeg folder and copy:
libavcodec/hevcdec.c to libavcodec/autorename_libavcodec_hevcdec.c
libavformat/hevc.c to libavformat/autorename_libavformat_hevc.c
Since the files are literal copies, this should not happen. When I looked at other similar files (auto_rename*) the usually contain exactly one line, #include "original_file.c". So I tried this out too and it did not work.
@adarshdec23 so are you compile with hevc in the end?
Yes that is what I was trying with autoninja -C out/Default chrome
.
Could the problem be that since the files have been manually copied instead of auto generated, the linker is somehow not picking it up?