Gentoo Archives: gentoo-amd64

From: Beso <givemesugarr@×××××.com>
To: gentoo-amd64@l.g.o
Subject: [gentoo-amd64] linking problems
Date: Sat, 13 Dec 2008 19:22:04
Message-Id: d257c3560812131122y1b0f41cbx886df58071c3140f@mail.gmail.com
1 hi,
2
3 i'm now doing some hard work around on optimizing some packages while
4 testing out -Wl, --no-undefined and forced --Wl, --as-needed on
5 my world set. as i predicted i found out quite a lot of packages that
6 don't link in the correct way. an example is apr-util. i've started to
7 work
8 on it and found out that for some unknown reason it wants to link
9 against itself when compiling the odbc parts. here's the interesting
10 part of
11 the build:
12
13 /bin/sh /usr/bin/libtool --silent --mode=compile
14 x86_64-pc-linux-gnu-gcc -pthread -Os -march=native
15 -mno-tls-direct-seg-refs -mmmx -msse3 -pipe -fomit-frame-pointer
16 -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE
17 -I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include
18 -I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include/private
19 -I/usr/include/postgresql/libpq-4 -I/usr/include/mysql -I/usr/include
20 -I/usr/include/apr-1 -I/usr/include/db4.5 -o dbd/apr_dbd.lo -c
21 dbd/apr_dbd.c && touch dbd/apr_dbd.lo
22 /bin/sh /usr/bin/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc
23 -pthread -Os -march=native -mno-tls-direct-seg-refs -mmmx -msse3
24 -pipe -fomit-frame-pointer -Wl,--no-undefined,-O1
25 -Wl,--enable-new-dtags -Wl,--sort-common -s -L/usr/lib64 -release 1
26 -module -rpath /usr/lib64/apr-util-1 -o dbd/apr_dbd_pgsql.la
27 dbd/apr_dbd_pgsql.lo -L/usr/lib64 -lpq -lapr-1
28 x86_64-pc-linux-gnu-gcc -E -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT
29 -D_GNU_SOURCE
30 -I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include
31 -I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include/private
32 -I/usr/include/postgresql/libpq-4 -I/usr/include/mysql -I/usr/include
33 -I/usr/include/apr-1 -I/usr/include/db4.5 exports.c | grep
34 "ap_hack_" | sed -e 's/^.*[)]\(.*\);$/\1/' >> aprutil.exp
35 /bin/sh /usr/bin/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc
36 -pthread -Os -march=native -mno-tls-direct-seg-refs -mmmx -msse3
37 -pipe -fomit-frame-pointer -Wl,--no-undefined,-O1
38 -Wl,--enable-new-dtags -Wl,--sort-common -s -L/usr/lib64 -release 1
39 -module -rpath /usr/lib64/apr-util-1 -o dbd/apr_dbd_mysql.la
40 dbd/apr_dbd_mysql.lo -Wl,--no-undefined,-O1 -Wl,--enable-new-dtags
41 -Wl,--sort-common -s -rdynamic -L/usr/lib64/mysql -L/usr/lib64
42 -lmysqlclient_r -Wl,--no-undefined,-O1 -Wl,--enable-new-dtags
43 -Wl,--sort-common -s -rdynamic -L/usr/lib64/mysql -lmysqlclient_r -lz
44 -lpthread -lcrypt -lnsl -lm -lpthread -L/usr/lib64 -lssl -lcrypto
45 -lapr-1
46 x86_64-pc-linux-gnu-gcc -E -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT
47 -D_GNU_SOURCE
48 -I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include
49 -I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include/private
50 -I/usr/include/postgresql/libpq-4 -I/usr/include/mysql -I/usr/include
51 -I/usr/include/apr-1 -I/usr/include/db4.5 export_vars.c | sed -e
52 's/^\#[^!]*//' | sed -e '/^$/d' >> aprutil.exp
53 /bin/sh /usr/bin/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc
54 -pthread -Os -march=native -mno-tls-direct-seg-refs -mmmx -msse3
55 -pipe -fomit-frame-pointer -Wl,--no-undefined,-O1
56 -Wl,--enable-new-dtags -Wl,--sort-common -s -L/usr/lib64 -release 1
57 -module -rpath /usr/lib64/apr-util-1 -o dbd/apr_dbd_sqlite3.la
58 dbd/apr_dbd_sqlite3.lo -lsqlite3 -lapr-1
59 /bin/sh /usr/bin/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc
60 -pthread -Os -march=native -mno-tls-direct-seg-refs -mmmx -msse3
61 -pipe -fomit-frame-pointer -Wl,--no-undefined,-O1
62 -Wl,--enable-new-dtags -Wl,--sort-common -s -L/usr/lib64 -release 1
63 -module -rpath /usr/lib64/apr-util-1 -o dbd/apr_dbd_odbc.la
64 dbd/apr_dbd_odbc.lo -L/usr/lib64 -lodbc -L/usr/lib64 -lodbc -lapr-1
65 /bin/sh /usr/bin/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc
66 -pthread -Os -march=native -mno-tls-direct-seg-refs -mmmx -msse3
67 -pipe -fomit-frame-pointer -Wl,--no-undefined,-O1
68 -Wl,--enable-new-dtags -Wl,--sort-common -s -L/usr/lib64 -release 1
69 -module -rpath /usr/lib64/apr-util-1 -o ldap/apr_ldap.la
70 ldap/apr_ldap_init.lo ldap/apr_ldap_option.lo ldap/apr_ldap_rebind.lo
71 -lldap -llber -lapr-1
72 /bin/sh /usr/bin/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc
73 -pthread -Os -march=native -mno-tls-direct-seg-refs -mmmx -msse3
74 -pipe -fomit-frame-pointer -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT
75 -D_GNU_SOURCE
76 -I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include
77 -I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include/private
78 -I/usr/include/postgresql/libpq-4 -I/usr/include/mysql -I/usr/include
79 -I/usr/include/apr-1 -I/usr/include/db4.5 -version-info 3:4:3
80 -Wl,--no-undefined,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s -o
81 libaprutil-1.la -rpath /usr/lib64 buckets/apr_buckets_pipe.lo
82 buckets/apr_buckets_flush.lo buckets/apr_buckets_alloc.lo
83 buckets/apr_buckets_pool.lo buckets/apr_buckets_socket.lo
84 buckets/apr_buckets_heap.lo buckets/apr_buckets_simple.lo
85 buckets/apr_buckets_file.lo buckets/apr_buckets.lo
86 buckets/apr_buckets_mmap.lo buckets/apr_buckets_eos.lo
87 buckets/apr_brigade.lo buckets/apr_buckets_refcount.lo
88 crypto/apr_sha1.lo crypto/uuid.lo crypto/getuuid.lo crypto/apr_md5.lo
89 crypto/apr_md4.lo dbm/apr_dbm.lo dbm/apr_dbm_berkeleydb.lo
90 dbm/apr_dbm_gdbm.lo dbm/apr_dbm_ndbm.lo dbm/apr_dbm_sdbm.lo
91 dbm/sdbm/sdbm_pair.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo
92 dbm/sdbm/sdbm_lock.lo encoding/apr_base64.lo hooks/apr_hooks.lo
93 ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo misc/apr_reslist.lo
94 misc/apu_version.lo misc/apr_date.lo misc/apr_rmm.lo misc/apr_queue.lo
95 misc/apu_dso.lo misc/apr_thread_pool.lo memcache/apr_memcache.lo
96 uri/apr_uri.lo xml/apr_xml.lo strmatch/apr_strmatch.lo xlate/xlate.lo
97 dbd/apr_dbd.lo -luuid -lrt -lcrypt -lpthread -ldl -L/usr/lib64
98 -lgdbm -ldb-4.5 -lexpat /usr/lib64/libapr-1.la -luuid -lrt -lcrypt
99 -lpthread -ldl
100 dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_datum_get':
101 apr_dbd_sqlite3.c:(.text+0x1b5): undefined reference to
102 `apr_bucket_pool_create'
103 dbd/.libs/apr_dbd_sqlite3.o: In function
104 `dbd_sqlite3_select_internal':
105 apr_dbd_sqlite3.c:(.text+0x4a3): undefined reference to
106 `apr_dbd_mutex_unlock'
107 apr_dbd_sqlite3.c:(.text+0x4b2): undefined reference to
108 `apr_dbd_mutex_lock'
109 dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_pbselect':
110 apr_dbd_sqlite3.c:(.text+0x690): undefined reference to
111 `apr_dbd_mutex_lock'
112 apr_dbd_sqlite3.c:(.text+0x6d0): undefined reference to
113 `apr_dbd_mutex_unlock'
114 dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_pselect':
115 apr_dbd_sqlite3.c:(.text+0x7dd): undefined reference to
116 `apr_dbd_mutex_lock'
117 apr_dbd_sqlite3.c:(dbd/.libs/apr_dbd_pgsql.o: In function
118 `dbd_pgsql_datum_get':
119 apr_dbd_pgsql.c:(.text+0x300): undefined reference to
120 `apr_bucket_pool_create'
121 collect2: ld returned 1 exit status
122 .text+0x81d): undefined reference to `apr_dbd_mutex_unlock'
123 dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_query_internal':
124 make[1]: *** [dbd/apr_dbd_pgsql.la] Error 1
125 make[1]: *** Waiting for unfinished jobs....
126 apr_dbd_sqlite3.c:(.text+0x91a): undefined reference to
127 `apr_dbd_mutex_unlock'
128 apr_dbd_sqlite3.c:(.text+0x929): undefined reference to
129 `apr_dbd_mutex_lock'
130 dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_pbquery':
131 apr_dbd_sqlite3.c:(.text+0x984): undefined reference to
132 `apr_dbd_mutex_lock'
133 apr_dbd_sqlite3.c:(.text+0x9ba): undefined reference to
134 `apr_dbd_mutex_unlock'
135 dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_pquery':
136 apr_dbd_sqlite3.c:(.text+0xaa3): undefined reference to
137 `apr_dbd_mutex_lock'
138 apr_dbd_sqlite3.c:(.text+0xad9): undefined reference to
139 `apr_dbd_mutex_unlock'
140 dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_prepare':
141 apr_dbd_sqlite3.c:(.text+0xbb5): undefined reference to
142 `apr_dbd_mutex_lock'
143 apr_dbd_sqlite3.c:(.text+0xc40): undefined reference to
144 `apr_dbd_mutex_unlock'
145 dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_select':
146 apr_dbd_sqlite3.c:(.text+0xc95): undefined reference to
147 `apr_dbd_mutex_lock'
148 apr_dbd_sqlite3.c:(.text+0xcf1): undefined reference to
149 `apr_dbd_mutex_unlock'
150 dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_query':
151 apr_dbd_sqlite3.c:(.text+0xd6b): undefined reference to
152 `apr_dbd_mutex_lock'
153 apr_dbd_sqlite3.c:(.text+0xdce): undefined reference to
154 `apr_dbd_mutex_unlock'
155 collect2: ld returned 1 exit status
156 make[1]: *** [dbd/apr_dbd_sqlite3.la] Error 1
157 dbd/.libs/apr_dbd_mysql.o: In function `dbd_mysql_datum_get':
158 apr_dbd_mysql.c:(.text+0x1a7): undefined reference to
159 `apr_bucket_alloc'
160 apr_dbd_mysql.c:(.text+0x1c0): undefined reference to
161 `apr_bucket_free'
162 apr_dbd_mysql.c:(.text+0x1cd): undefined reference to
163 `apr_bucket_alloc'
164 apr_dbd_mysql.c:(.text+0x1ea): undefined reference to
165 `apr_bucket_shared_make'
166 apr_dbd_mysql.c:(.text+0x2b3): undefined reference to
167 `apr_bucket_pool_create'
168 dbd/.libs/apr_dbd_mysql.o: In function `lob_bucket_destroy':
169 apr_dbd_mysql.c:(.text+0x2fc): undefined reference to
170 `apr_bucket_shared_destroy'
171 dbd/.libs/apr_dbd_mysql.o: In function `lob_bucket_read':
172 apr_dbd_mysql.c:(.text+0x3c3): undefined reference to
173 `apr_bucket_pool_make'
174 apr_dbd_mysql.c:(.text+0x3d6): undefined reference to
175 `apr_bucket_alloc'
176 apr_dbd_mysql.c:(.text+0x405): undefined reference to
177 `apr_bucket_free'
178 dbd/.libs/apr_dbd_mysql.o: In function `lob_bucket_destroy':
179 apr_dbd_mysql.c:(.text+0x309): undefined reference to
180 `apr_bucket_free'
181 dbd/.libs/apr_dbd_mysql.o:(.data.rel.ro+0x20): undefined reference to
182 `apr_bucket_setaside_notimpl'
183 dbd/.libs/apr_dbd_mysql.o:(.data.rel.ro+0x28): undefined reference to
184 `apr_bucket_shared_split'
185 dbd/.libs/apr_dbd_mysql.o:(.data.rel.ro+0x30): undefined reference to
186 `apr_bucket_shared_copy'
187 collect2: ld returned 1 exit status
188 make[1]: *** [dbd/apr_dbd_mysql.la] Error 1
189 dbd/.libs/apr_dbd_odbc.o: In function `odbc_lob_bucket_destroy':
190 apr_dbd_odbc.c:(.text+0x2b0): undefined reference to `apr_bucket_shared_destroy'
191 dbd/.libs/apr_dbd_odbc.o: In function `odbc_lob_bucket_read':
192 apr_dbd_odbc.c:(.text+0x321): undefined reference to `apr_bucket_alloc'
193 apr_dbd_odbc.c:(.text+0x3fc): undefined reference to `apr_bucket_alloc'
194 apr_dbd_odbc.c:(.text+0x42a): undefined reference to `apr_bucket_free'
195 apr_dbd_odbc.c:(.text+0x481): undefined reference to `apr_bucket_free'
196 apr_dbd_odbc.c:(.text+0x491): undefined reference to `apr_bucket_heap_make'
197 dbd/.libs/apr_dbd_odbc.o: In function `odbc_datum_get':
198 apr_dbd_odbc.c:(.text+0x73d): undefined reference to `apr_bucket_alloc'
199 apr_dbd_odbc.c:(.text+0x74d): undefined reference to `apr_bucket_alloc'
200 apr_dbd_odbc.c:(.text+0x758): undefined reference to `apr_bucket_eos_create'
201 apr_dbd_odbc.c:(.text+0x77b): undefined reference to `apr_bucket_free'
202 apr_dbd_odbc.c:(.text+0x7a2): undefined reference to `apr_bucket_shared_make'
203 dbd/.libs/apr_dbd_odbc.o: In function `odbc_init':
204 apr_dbd_odbc.c:(.text+0x29b1): undefined reference to `apu_version'
205 dbd/.libs/apr_dbd_odbc.o: In function `odbc_lob_bucket_setaside':
206 apr_dbd_odbc.c:(.text+0x57): undefined reference to
207 `apr_bucket_setaside_notimpl'
208 dbd/.libs/apr_dbd_odbc.o: In function `odbc_lob_bucket_destroy':
209 apr_dbd_odbc.c:(.text+0x2bd): undefined reference to `apr_bucket_free'
210 dbd/.libs/apr_dbd_odbc.o:(.data.rel.ro+0x128): undefined reference to
211 `apr_bucket_shared_split'
212 dbd/.libs/apr_dbd_odbc.o:(.data.rel.ro+0x130): undefined reference to
213 `apr_bucket_shared_copy'
214 collect2: ld returned 1 exit status
215 make[1]: *** [dbd/apr_dbd_odbc.la] Error 1
216 make[1]: Leaving directory
217 `/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4'
218 make: *** [all-recursive] Error 1
219
220 as you can see i've added the -lapr-1 library to be able to have more
221 undefined symbols go away. the problem
222 is that the symbols that are still undefined are present in
223 libaprutil-1 (which is itself as you can see from the
224 following output).
225
226 # nm -D --defined-only /usr/lib64/libaprutil-1.so | egrep
227 'apr_bucket_shared_copy'
228 # 000000000000c695 T apr_bucket_shared_copy
229
230 now, from my knowledge these should be fixed inside the includes,
231 which is there. the thing that i don't understand
232 is why the linker finds these symbols undefined. i don't have so much
233 knowledge about linker functionality so i'm
234 asking out for some help on the matter.
235 thanks.
236
237 --
238 dott. ing. beso