Problems with libtool, linking and util-linux-ng

Natanael Copa natanael.copa at gmail.com
Fri Aug 14 14:23:21 UTC 2009


Hi,

I wonder if I have some issue with my setup or if I am hitting a libtool
bug of some sort.

This is a native compile (not cross-compile) on an x86 uclibc-0.9.30.1
(+ some fixes and backports) and gcc-4.1.1 with espf patches from
gentoo.

I tried to compile e2fsprogs-1.41.8 against the util-linux-ng-2.16's
libuuid and libblkid. The configure script complained and said:

checking for blkid_get_cache in -lblkid... no
configure: error: external blkid library not found
make: *** No targets specified and no makefile found.  Stop.

So I checked up the config.log which told me that its a linker error:

configure:4629: ccache gcc -o conftest -march=i486 -Os -fomit-frame-pointer -march=i486 -Os -fomit-frame-pointer -Wl,--as-needed conftest.c -lblkid   >&5
/usr/lib/gcc/i486-alpine-linux-uclibc/4.4.1/../../../libblkid.a(probe.o): In function `blkid_probe_set_uuid_as':
(.text+0x47f): undefined reference to `uuid_unparse'

So... it needs uuid_unparse. Some bells started to ring in the back of
my head as I had similar issues a few days ago with libtheora which I
traced to libtheoraenc needed stuff in libtheoradec, but enc lib was not
linked with the dec lib.

So I check, what is libblkid linked to?:
nclab01:~/aports/main/e2fsprogs$ scanelf -n /lib/libblkid.so.1
 TYPE   NEEDED FILE 
ET_DYN libc.so.0,ld-uClibc.so.0 /lib/libblkid.so.1 

My suspicon was correct. libblkid.so is not linked with libuuid, exactly
the same that happened to libtheora. Either should -luuid be added to
linker flag or libuuid should have been in the NEEDED section of
libblkid.

So, I start to dig a bit on why is not libblkid.so linked with -luuid
(which is what I would prefer) and here I need some help.

first i ran a check in the build dir:
nclab01:~/aports/main/util-linux-ng/src/util-linux-ng-2.16$ scanelf -Rn . | grep libblk
...
ET_DYN libc.so.0,ld-uClibc.so.0 ./shlibs/blkid/src/.libs/libblkid.so.1.1.0T 
ET_DYN libuuid.so.1,libc.so.0,ld-uClibc.so.0 ./shlibs/blkid/src/.libs/libblkid.so.1.1.0 
...

What i find funny here is that there *is* a correctly
linked ./shlibs/blkid/src/.libs/libblkid.so.1.1.0 then the expected
libuuid as NEEDED. However, during 'make install' this is not the one
that gets installed. libtool picks the other one with the T suffix,
thats not linked with libuuid.

(after make install DESTDIR=/tmp/foo)

nclab01:~/aports/main/util-linux-ng/src/util-linux-ng-2.16$ scanelf -Rn /tmp/foo
/ | grep libblk
...
ET_DYN libc.so.0,ld-uClibc.so.0 /tmp/foo/lib/libblkid.so.1.1.0 
...

Now I'm stuck. After googling around it seems that there were some
pkg-config stuff that should handle the linkerflags for util-linux-ng
properly but that part looks correct. blkid.pc:

Requires.private: uuid
..
Libs: -L${libdir} -lblkid

This is not directly related to uclibc but maybe someone could please
point me to correct direction.

Thanks!

-nc




More information about the uClibc mailing list