I have a buildroot project in which I want to add a library compiled with pascal. The reason for this is that it is a custom library and porting it to C is too much work at this point. I am compiling it for a raspberry pi CM3. How it currently works:
- I have compiled the library
libcustom.so
on an raspberry pi (raspbian). - In buildroot I download the library from a git repository.
Now the problem I have is that the program that used this library cannot find the library (although it is in the /usr/lib/ folder). Using the ldd
command I got the following output:
$ ldd /usr/lib/libcustom.so
checking sub-depends for 'not found'
checking sub-depends for 'not found'
checking sub-depends for 'not found'
ld-linux-armhf.so.3 => not found (0x00000000)
libdl.so.2 => not found (0x00000000)
libc.so.6 => not found (0x00000000)
not a dynamic executable
By checking the output given by the same command on the system where I compiled the library helped me to resolve which sub-depends were missing. Since the architecture of both the systems is the same I figured that to test what is missing I could simply copy the libraries from the compilation system to the buildroot system. (libraries that were missing were libc.so.6
,libdl.so.2
and lib-linux-armhf.so.3
). Now ldd
gives me the following:
$ ldd /usr/lib/libcustom.so
checking sub-depends for '/lib/ld-linux-armhf.so.3'
checking sub-depends for '/usr/lib/libdl.so.2'
checking sub-depends for '/usr/lib/libc.so.6'
/lib/ld-linux-armhf.so.3 (0x76fc2000)
linux-vdso.so.1 (0x7ef00000)
checking sub-depends for '/usr/lib/libc.so.6'
/lib/ld-linux-armhf.so.3 (0x76ee8000)
linux-vdso.so.1 (0x7efeb000)
/lib/ld-linux-armhf.so.3 => /lib/ld-linux-armhf.so.3 (0x00000000)
libc.so.6 => /usr/lib/libc.so.6 (0x00000000)
/lib/ld-linux-armhf.so.3 => /lib/ld-linux-armhf.so.3 (0x00000000)
The custom library is still not working (and the ldd still points to empty (0x00000000) libraries.
I have been searching around a bit however there are still two things that I do not understand:
- Why is the above solution not working? The libraries are the same architecture but as ldd points out above, some libraries still cannot be properly found.
- How can I include libraries in buildroot? I have been searching for this and found how to add custom packages, but I am still clueless about how to add specific libraries (such as the one I have added by hand).