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:
1 | klaus@a64a:~ > lsexposym getaddrinfo gai_strerror inet_ntop freeaddrinfo stderr
|
2 | Suche nach Symbol getaddrinfo
|
3 |
|
4 | getaddrinfo gefunden in /usr/lib/libc.a:
|
5 | Textsegment (Code): getaddrinfo
|
6 |
|
7 |
|
8 | getaddrinfo gefunden in /usr/lib/libanl.a:
|
9 | Textsegment (Code): getaddrinfo_a
|
10 |
|
11 |
|
12 | getaddrinfo gefunden in /usr/lib/xen/libc.a:
|
13 | Textsegment (Code): getaddrinfo
|
14 |
|
15 |
|
16 | getaddrinfo gefunden in /usr/lib/xen/libanl.a:
|
17 | Textsegment (Code): getaddrinfo_a
|
18 |
|
19 | Suche nach Symbol gai_strerror
|
20 |
|
21 | gai_strerror gefunden in /usr/lib/libc.a:
|
22 | Textsegment (Code): gai_strerror
|
23 |
|
24 |
|
25 | gai_strerror gefunden in /usr/lib/xen/libc.a:
|
26 | Textsegment (Code): gai_strerror
|
27 |
|
28 | Suche nach Symbol inet_ntop
|
29 |
|
30 | inet_ntop gefunden in /usr/lib/libc.a:
|
31 | Textsegment (Code): inet_ntop
|
32 |
|
33 |
|
34 | inet_ntop gefunden in /usr/lib/xen/libc.a:
|
35 | Textsegment (Code): inet_ntop
|
36 |
|
37 | Suche nach Symbol freeaddrinfo
|
38 |
|
39 | freeaddrinfo gefunden in /usr/lib/libc.a:
|
40 | Textsegment (Code): freeaddrinfo
|
41 |
|
42 |
|
43 | freeaddrinfo gefunden in /usr/lib/xen/libc.a:
|
44 | Textsegment (Code): freeaddrinfo
|
45 |
|
46 | Suche nach Symbol stderr
|
47 |
|
48 | stderr gefunden in /usr/lib/libcrypto.a:
|
49 | Textsegment (Code): OPENSSL_stderr
|
50 |
|
51 |
|
52 | stderr gefunden in /usr/lib/libc.a:
|
53 | Data (initialized): _IO_2_1_stderr_
|
54 | Data (initialized): _IO_stderr
|
55 | Data (initialized): stderr
|
56 |
|
57 |
|
58 | stderr gefunden in /usr/lib/xen/libc.a:
|
59 | Data (initialized): _IO_2_1_stderr_
|
60 | Data (initialized): _IO_stderr
|
61 | Data (initialized): stderr
|
62 |
|
63 |
|
64 | stderr gefunden in /usr/lib/libdbus-1.a:
|
65 | 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.