This repo contains the source code to build a library called librockchip_mpp that is necessary to access the video processing unit of Rockchip SoCs. The library is a dependency of this FFmpeg fork that enables hardware video acceleration on the rockchip platform. I try to build a static version of this FFmpeg fork and therefore need to build a static version of librockchip_mpp. However, the rockchip mpp repo just builds a shared library.
Therefore I tried to change the CMakeLists.txt files of the repo. I deleted some unit tests that are not necessary to build the library, deleted a library for legacy rockchip SoCs (librockchip_vpu), and tried to change the build process from shared to static. I uploaded my changes here. And here you can see the diffs of my fork vs the original repo.
The most important file is mpp/CMakelists.txt. Here the librockchip_mpp library gets added. Before it was a shared library, I changed that to static.
However, the librockchip_mpp.a I receive after compiling contains lots of undefined references, for example this function (executed from the build directory):
# nm mpp/librockchip_mpp.a | grep mpp_frame_deinit
U mpp_frame_deinit
Which is weird, because the function is defined in this static library called libmpp_base.a:
# nm mpp/base/libmpp_base.a | grep mpp_frame_deinit
U mpp_frame_deinit
00000000000001b0 T mpp_frame_deinit
And in the file mpp/CMakelists.txt I call target_link_libraries this way (${MPP_STATIC} refers to the librockchip_mpp.a library I try to correctly build, mpp_base refers to the libmpp_base.a library that always was a static library and works correctly I think):
target_link_libraries(${MPP_STATIC} mpp_codec mpp_hal mpp_vproc ${ASAN_LIB}
${BEGIN_WHOLE_ARCHIVE} mpp_base ${END_WHOLE_ARCHIVE})
So why is this symbol undefined?
I spent a lot time in the past few weeks and tried everything that I found online, but I wasn't able to build a working static librockchip_mpp.a library. I hope that someone who is more familiar with CMake than me is kind enough to help me get it working.