I don't know your system, but in similiar cases I use a handmade
script lsexposym, which searches in some standard dirs for
a given name in libs. It works with find, nm, grep and so on.
Call it with the names you search for and it outputs the
libs which export the symbols you gave on the command line.
By default libs are searched in /usr/lib and /lib and recursively in
all sub dirs of the both.
On my system it gives:
klaus@a64a:~ > lsexposym getaddrinfo gai_strerror inet_ntop freeaddrinfo stderr
Suche nach Symbol getaddrinfo
getaddrinfo gefunden in /usr/lib/libc.a:
Textsegment (Code): getaddrinfo
getaddrinfo gefunden in /usr/lib/libanl.a:
Textsegment (Code): getaddrinfo_a
getaddrinfo gefunden in /usr/lib/xen/libc.a:
Textsegment (Code): getaddrinfo
getaddrinfo gefunden in /usr/lib/xen/libanl.a:
Textsegment (Code): getaddrinfo_a
Suche nach Symbol gai_strerror
gai_strerror gefunden in /usr/lib/libc.a:
Textsegment (Code): gai_strerror
gai_strerror gefunden in /usr/lib/xen/libc.a:
Textsegment (Code): gai_strerror
Suche nach Symbol inet_ntop
inet_ntop gefunden in /usr/lib/libc.a:
Textsegment (Code): inet_ntop
inet_ntop gefunden in /usr/lib/xen/libc.a:
Textsegment (Code): inet_ntop
Suche nach Symbol freeaddrinfo
freeaddrinfo gefunden in /usr/lib/libc.a:
Textsegment (Code): freeaddrinfo
freeaddrinfo gefunden in /usr/lib/xen/libc.a:
Textsegment (Code): freeaddrinfo
Suche nach Symbol stderr
stderr gefunden in /usr/lib/libcrypto.a:
Textsegment (Code): OPENSSL_stderr
stderr gefunden in /usr/lib/libc.a:
Data (initialized): _IO_2_1_stderr_
Data (initialized): _IO_stderr
Data (initialized): stderr
stderr gefunden in /usr/lib/xen/libc.a:
Data (initialized): _IO_2_1_stderr_
Data (initialized): _IO_stderr
Data (initialized): stderr
stderr gefunden in /usr/lib/libdbus-1.a:
Textsegment (Code): _dbus_pipe_is_stdout_or_stderr
|
Note:
- "Suche nach Symbol ..." means "searching for symbol ..."
- "... gefunden in ..." means "... found in ..."
I append lsexposym so you might search on your Linux if you like.
Unfortunately it is commented in german and outputs in german too,
but perhaps you might find it useful now or later.
----
My assumption is you use the wrong dirs. On your command line
you say "-L/usr/lib". This will use the libs for your running system.
For cross compiling you will have the libs to be used in the
system you compile for probably not in /usr/lib but in
something like /usr/lib/arm... or anywhere else.
If the libs for cross compiling are in a dir beneath /usr/lib
then lsexposym will find them.
If not use "lsexposym -p /some/other/dir getaddrinfo..." to
search in /some/other/dir additionally or use
"lsexposym -p - -p /some/other/dir getaddrinfo..." to search
only in /some/other/dir.