[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-amd64
Subject:    [gentoo-amd64] linking problems
From:       Beso <givemesugarr () gmail ! com>
Date:       2008-12-13 19:22:00
Message-ID: d257c3560812131122y1b0f41cbx886df58071c3140f () mail ! gmail ! com
[Download RAW message or body]

hi,

i'm now doing some hard work around on optimizing some packages while
testing out -Wl, --no-undefined and forced --Wl, --as-needed on
my world set. as i predicted i found out quite a lot of packages that
don't link in the correct way. an example is apr-util. i've started to
work
on it and found out that for some unknown reason it wants to link
against itself when compiling the odbc parts. here's the interesting
part of
the build:

/bin/sh /usr/bin/libtool --silent --mode=compile
x86_64-pc-linux-gnu-gcc -pthread  -Os -march=native
-mno-tls-direct-seg-refs -mmmx -msse3 -pipe -fomit-frame-pointer
-DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT -D_GNU_SOURCE
-I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include
-I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include/private
-I/usr/include/postgresql/libpq-4 -I/usr/include/mysql -I/usr/include
-I/usr/include/apr-1  -I/usr/include/db4.5  -o dbd/apr_dbd.lo -c
dbd/apr_dbd.c && touch dbd/apr_dbd.lo
/bin/sh /usr/bin/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc
-pthread  -Os -march=native -mno-tls-direct-seg-refs -mmmx -msse3
-pipe -fomit-frame-pointer   -Wl,--no-undefined,-O1
-Wl,--enable-new-dtags -Wl,--sort-common -s -L/usr/lib64 -release 1
-module -rpath /usr/lib64/apr-util-1 -o dbd/apr_dbd_pgsql.la
dbd/apr_dbd_pgsql.lo -L/usr/lib64 -lpq -lapr-1
x86_64-pc-linux-gnu-gcc -E -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT
-D_GNU_SOURCE
-I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include
-I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include/private
-I/usr/include/postgresql/libpq-4 -I/usr/include/mysql -I/usr/include
-I/usr/include/apr-1  -I/usr/include/db4.5  exports.c | grep
"ap_hack_" | sed -e 's/^.*[)]\(.*\);$/\1/' >> aprutil.exp
/bin/sh /usr/bin/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc
-pthread  -Os -march=native -mno-tls-direct-seg-refs -mmmx -msse3
-pipe -fomit-frame-pointer   -Wl,--no-undefined,-O1
-Wl,--enable-new-dtags -Wl,--sort-common -s -L/usr/lib64 -release 1
-module -rpath /usr/lib64/apr-util-1 -o dbd/apr_dbd_mysql.la
dbd/apr_dbd_mysql.lo -Wl,--no-undefined,-O1 -Wl,--enable-new-dtags
-Wl,--sort-common -s -rdynamic -L/usr/lib64/mysql        -L/usr/lib64
 -lmysqlclient_r -Wl,--no-undefined,-O1 -Wl,--enable-new-dtags
-Wl,--sort-common -s -rdynamic -L/usr/lib64/mysql -lmysqlclient_r -lz
-lpthread -lcrypt -lnsl -lm -lpthread -L/usr/lib64 -lssl -lcrypto
-lapr-1
x86_64-pc-linux-gnu-gcc -E -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT
-D_GNU_SOURCE
-I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include
-I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include/private
-I/usr/include/postgresql/libpq-4 -I/usr/include/mysql -I/usr/include
-I/usr/include/apr-1  -I/usr/include/db4.5  export_vars.c | sed -e
's/^\#[^!]*//' | sed -e '/^$/d' >> aprutil.exp
/bin/sh /usr/bin/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc
-pthread  -Os -march=native -mno-tls-direct-seg-refs -mmmx -msse3
-pipe -fomit-frame-pointer   -Wl,--no-undefined,-O1
-Wl,--enable-new-dtags -Wl,--sort-common -s -L/usr/lib64 -release 1
-module -rpath /usr/lib64/apr-util-1 -o dbd/apr_dbd_sqlite3.la
dbd/apr_dbd_sqlite3.lo -lsqlite3 -lapr-1
/bin/sh /usr/bin/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc
-pthread  -Os -march=native -mno-tls-direct-seg-refs -mmmx -msse3
-pipe -fomit-frame-pointer   -Wl,--no-undefined,-O1
-Wl,--enable-new-dtags -Wl,--sort-common -s -L/usr/lib64 -release 1
-module -rpath /usr/lib64/apr-util-1 -o dbd/apr_dbd_odbc.la
dbd/apr_dbd_odbc.lo -L/usr/lib64 -lodbc -L/usr/lib64 -lodbc -lapr-1
/bin/sh /usr/bin/libtool --silent --mode=link x86_64-pc-linux-gnu-gcc
-pthread  -Os -march=native -mno-tls-direct-seg-refs -mmmx -msse3
-pipe -fomit-frame-pointer   -Wl,--no-undefined,-O1
-Wl,--enable-new-dtags -Wl,--sort-common -s -L/usr/lib64 -release 1
-module -rpath /usr/lib64/apr-util-1 -o ldap/apr_ldap.la
ldap/apr_ldap_init.lo ldap/apr_ldap_option.lo ldap/apr_ldap_rebind.lo
-lldap -llber -lapr-1
/bin/sh /usr/bin/libtool --silent --mode=link  x86_64-pc-linux-gnu-gcc
-pthread  -Os -march=native -mno-tls-direct-seg-refs -mmmx -msse3
-pipe -fomit-frame-pointer -DHAVE_CONFIG_H -DLINUX=2 -D_REENTRANT
-D_GNU_SOURCE
-I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include
-I/var/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4/include/private
-I/usr/include/postgresql/libpq-4 -I/usr/include/mysql -I/usr/include
-I/usr/include/apr-1  -I/usr/include/db4.5  -version-info 3:4:3
-Wl,--no-undefined,-O1 -Wl,--enable-new-dtags -Wl,--sort-common -s -o
libaprutil-1.la -rpath /usr/lib64 buckets/apr_buckets_pipe.lo
buckets/apr_buckets_flush.lo buckets/apr_buckets_alloc.lo
buckets/apr_buckets_pool.lo buckets/apr_buckets_socket.lo
buckets/apr_buckets_heap.lo buckets/apr_buckets_simple.lo
buckets/apr_buckets_file.lo buckets/apr_buckets.lo
buckets/apr_buckets_mmap.lo buckets/apr_buckets_eos.lo
buckets/apr_brigade.lo buckets/apr_buckets_refcount.lo
crypto/apr_sha1.lo crypto/uuid.lo crypto/getuuid.lo crypto/apr_md5.lo
crypto/apr_md4.lo dbm/apr_dbm.lo dbm/apr_dbm_berkeleydb.lo
dbm/apr_dbm_gdbm.lo dbm/apr_dbm_ndbm.lo dbm/apr_dbm_sdbm.lo
dbm/sdbm/sdbm_pair.lo dbm/sdbm/sdbm.lo dbm/sdbm/sdbm_hash.lo
dbm/sdbm/sdbm_lock.lo encoding/apr_base64.lo hooks/apr_hooks.lo
ldap/apr_ldap_stub.lo ldap/apr_ldap_url.lo misc/apr_reslist.lo
misc/apu_version.lo misc/apr_date.lo misc/apr_rmm.lo misc/apr_queue.lo
misc/apu_dso.lo misc/apr_thread_pool.lo memcache/apr_memcache.lo
uri/apr_uri.lo xml/apr_xml.lo strmatch/apr_strmatch.lo xlate/xlate.lo
dbd/apr_dbd.lo    -luuid -lrt -lcrypt  -lpthread -ldl -L/usr/lib64
-lgdbm -ldb-4.5 -lexpat /usr/lib64/libapr-1.la -luuid -lrt -lcrypt
-lpthread -ldl
dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_datum_get':
apr_dbd_sqlite3.c:(.text+0x1b5): undefined reference to
`apr_bucket_pool_create'
dbd/.libs/apr_dbd_sqlite3.o: In function
`dbd_sqlite3_select_internal':
apr_dbd_sqlite3.c:(.text+0x4a3): undefined reference to
`apr_dbd_mutex_unlock'
apr_dbd_sqlite3.c:(.text+0x4b2): undefined reference to
`apr_dbd_mutex_lock'
dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_pbselect':
apr_dbd_sqlite3.c:(.text+0x690): undefined reference to
`apr_dbd_mutex_lock'
apr_dbd_sqlite3.c:(.text+0x6d0): undefined reference to
`apr_dbd_mutex_unlock'
dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_pselect':
apr_dbd_sqlite3.c:(.text+0x7dd): undefined reference to
`apr_dbd_mutex_lock'
apr_dbd_sqlite3.c:(dbd/.libs/apr_dbd_pgsql.o: In function
`dbd_pgsql_datum_get':
apr_dbd_pgsql.c:(.text+0x300): undefined reference to
`apr_bucket_pool_create'
collect2: ld returned 1 exit status
.text+0x81d): undefined reference to `apr_dbd_mutex_unlock'
dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_query_internal':
make[1]: *** [dbd/apr_dbd_pgsql.la] Error 1
make[1]: *** Waiting for unfinished jobs....
apr_dbd_sqlite3.c:(.text+0x91a): undefined reference to
`apr_dbd_mutex_unlock'
apr_dbd_sqlite3.c:(.text+0x929): undefined reference to
`apr_dbd_mutex_lock'
dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_pbquery':
apr_dbd_sqlite3.c:(.text+0x984): undefined reference to
`apr_dbd_mutex_lock'
apr_dbd_sqlite3.c:(.text+0x9ba): undefined reference to
`apr_dbd_mutex_unlock'
dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_pquery':
apr_dbd_sqlite3.c:(.text+0xaa3): undefined reference to
`apr_dbd_mutex_lock'
apr_dbd_sqlite3.c:(.text+0xad9): undefined reference to
`apr_dbd_mutex_unlock'
dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_prepare':
apr_dbd_sqlite3.c:(.text+0xbb5): undefined reference to
`apr_dbd_mutex_lock'
apr_dbd_sqlite3.c:(.text+0xc40): undefined reference to
`apr_dbd_mutex_unlock'
dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_select':
apr_dbd_sqlite3.c:(.text+0xc95): undefined reference to
`apr_dbd_mutex_lock'
apr_dbd_sqlite3.c:(.text+0xcf1): undefined reference to
`apr_dbd_mutex_unlock'
dbd/.libs/apr_dbd_sqlite3.o: In function `dbd_sqlite3_query':
apr_dbd_sqlite3.c:(.text+0xd6b): undefined reference to
`apr_dbd_mutex_lock'
apr_dbd_sqlite3.c:(.text+0xdce): undefined reference to
`apr_dbd_mutex_unlock'
collect2: ld returned 1 exit status
make[1]: *** [dbd/apr_dbd_sqlite3.la] Error 1
dbd/.libs/apr_dbd_mysql.o: In function `dbd_mysql_datum_get':
apr_dbd_mysql.c:(.text+0x1a7): undefined reference to
`apr_bucket_alloc'
apr_dbd_mysql.c:(.text+0x1c0): undefined reference to
`apr_bucket_free'
apr_dbd_mysql.c:(.text+0x1cd): undefined reference to
`apr_bucket_alloc'
apr_dbd_mysql.c:(.text+0x1ea): undefined reference to
`apr_bucket_shared_make'
apr_dbd_mysql.c:(.text+0x2b3): undefined reference to
`apr_bucket_pool_create'
dbd/.libs/apr_dbd_mysql.o: In function `lob_bucket_destroy':
apr_dbd_mysql.c:(.text+0x2fc): undefined reference to
`apr_bucket_shared_destroy'
dbd/.libs/apr_dbd_mysql.o: In function `lob_bucket_read':
apr_dbd_mysql.c:(.text+0x3c3): undefined reference to
`apr_bucket_pool_make'
apr_dbd_mysql.c:(.text+0x3d6): undefined reference to
`apr_bucket_alloc'
apr_dbd_mysql.c:(.text+0x405): undefined reference to
`apr_bucket_free'
dbd/.libs/apr_dbd_mysql.o: In function `lob_bucket_destroy':
apr_dbd_mysql.c:(.text+0x309): undefined reference to
`apr_bucket_free'
dbd/.libs/apr_dbd_mysql.o:(.data.rel.ro+0x20): undefined reference to
`apr_bucket_setaside_notimpl'
dbd/.libs/apr_dbd_mysql.o:(.data.rel.ro+0x28): undefined reference to
`apr_bucket_shared_split'
dbd/.libs/apr_dbd_mysql.o:(.data.rel.ro+0x30): undefined reference to
`apr_bucket_shared_copy'
collect2: ld returned 1 exit status
make[1]: *** [dbd/apr_dbd_mysql.la] Error 1
dbd/.libs/apr_dbd_odbc.o: In function `odbc_lob_bucket_destroy':
apr_dbd_odbc.c:(.text+0x2b0): undefined reference to `apr_bucket_shared_destroy'
dbd/.libs/apr_dbd_odbc.o: In function `odbc_lob_bucket_read':
apr_dbd_odbc.c:(.text+0x321): undefined reference to `apr_bucket_alloc'
apr_dbd_odbc.c:(.text+0x3fc): undefined reference to `apr_bucket_alloc'
apr_dbd_odbc.c:(.text+0x42a): undefined reference to `apr_bucket_free'
apr_dbd_odbc.c:(.text+0x481): undefined reference to `apr_bucket_free'
apr_dbd_odbc.c:(.text+0x491): undefined reference to `apr_bucket_heap_make'
dbd/.libs/apr_dbd_odbc.o: In function `odbc_datum_get':
apr_dbd_odbc.c:(.text+0x73d): undefined reference to `apr_bucket_alloc'
apr_dbd_odbc.c:(.text+0x74d): undefined reference to `apr_bucket_alloc'
apr_dbd_odbc.c:(.text+0x758): undefined reference to `apr_bucket_eos_create'
apr_dbd_odbc.c:(.text+0x77b): undefined reference to `apr_bucket_free'
apr_dbd_odbc.c:(.text+0x7a2): undefined reference to `apr_bucket_shared_make'
dbd/.libs/apr_dbd_odbc.o: In function `odbc_init':
apr_dbd_odbc.c:(.text+0x29b1): undefined reference to `apu_version'
dbd/.libs/apr_dbd_odbc.o: In function `odbc_lob_bucket_setaside':
apr_dbd_odbc.c:(.text+0x57): undefined reference to
`apr_bucket_setaside_notimpl'
dbd/.libs/apr_dbd_odbc.o: In function `odbc_lob_bucket_destroy':
apr_dbd_odbc.c:(.text+0x2bd): undefined reference to `apr_bucket_free'
dbd/.libs/apr_dbd_odbc.o:(.data.rel.ro+0x128): undefined reference to
`apr_bucket_shared_split'
dbd/.libs/apr_dbd_odbc.o:(.data.rel.ro+0x130): undefined reference to
`apr_bucket_shared_copy'
collect2: ld returned 1 exit status
make[1]: *** [dbd/apr_dbd_odbc.la] Error 1
make[1]: Leaving directory
`/tmp/paludis/dev-libs-apr-util-1.3.4/work/apr-util-1.3.4'
make: *** [all-recursive] Error 1

as you can see i've added the -lapr-1 library to be able to have more
undefined symbols go away. the problem
is that the symbols that are still undefined are present in
libaprutil-1 (which is itself as you can see from the
following output).

# nm -D --defined-only /usr/lib64/libaprutil-1.so | egrep
'apr_bucket_shared_copy'
# 000000000000c695 T apr_bucket_shared_copy

now, from my knowledge these should be fixed inside the includes,
which is there. the thing that i don't understand
is why the linker finds these symbols undefined. i don't have so much
knowledge about linker functionality so i'm
asking out for some help on the matter.
thanks.

-- 
dott. ing. beso

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic