D
D
dimonkoz2017-05-14 17:29:50
linux
dimonkoz, 2017-05-14 17:29:50

How to solve linking problems when cross-compiling under ARM using GN and Ninja?

We are trying to make a video stream using WebRTC. AllWinner video source on ARM, which successfully streams video in H264 using Software compression, but eats a lot of resources. When trying to compress with a hardware codec, problems occur.
There are ready-made .so libs for AllWinner to work with the encoder. When trying to put them in a Ninja file, the assembly for ARM on Ubuntu is fine. But when running on AllWinner, it drops out:

./peerconnection_client: symbol lookup error: /usr/local/lib/cedarx/libvencoder.so: undefined symbol: SecureMemAdapterOpen

If you run nm -D ./libvencoder.so, then the SecureMemAdapterOpen method is labeled U. SecureMemAdapterOpen itself is in another libMemAdapter.so pluggable. If you do not specify libMemAdapter.so as a lib when building at all, then the project is not built at all:
/usr/local/lib/cedarx/libvencoder.so: error: undefined reference to 'MemAdapterClose'
/usr/local/lib/cedarx/libvencoder.so: error: undefined reference to 'MemAdapterGetPhysicAddress'
/usr/local/lib/cedarx/libvencoder.so: error: undefined reference to 'MemAdapterGetPhysicAddressCpu'
/usr/local/lib/cedarx/libvencoder.so: error: undefined reference to 'MemAdapterOpen'
/usr/local/lib/cedarx/libvencoder.so: error: undefined reference to 'MemAdapterPalloc'
/usr/local/lib/cedarx/libvencoder.so: error: undefined reference to 'SecureMemAdapterClose'
/usr/local/lib/cedarx/libvencoder.so: error: undefined reference to 'MemAdapterGetVirtualAddress'
/usr/local/lib/cedarx/libvencoder.so: error: undefined reference to 'MemAdapterPfree'
/usr/local/lib/cedarx/libvencoder.so: error: undefined reference to 'SecureMemAdapterOpen'
/usr/local/lib/cedarx/libvencoder.so: error: undefined reference to 'MemAdapterFlushCache'

Question 1. If the SecureMemAdapterOpen implementation is not in libvencoder.so, how does the build process for ARM on Ubuntu behave? Is the path of all dependencies that can be used in the share library checked?
Question 2. If possible, how can I add the used .so files directly to GN files so that it creates a ninja file for the build (maybe we didn’t take into account something by entering the dependencies into ninja manually)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dimonkoz, 2017-05-19
@dimonkoz

1. The problem was solved by adding a .h file with the prototype of at least one function from .so. The linker manages not to grab the library if it is not used directly from the code, but their other
.so

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question