Linked shared lib disappearing


I’m trying to link a shared lib ( ) into the executables of a package ( ). Everything seems to work OK, i. e. the package builds successfully. However, when I install the result and examine the executables with “ldd”, libsyncdir is not listed and the build log doesn’t list libsyncdir in Requires. (libsyncdir provides only symbols that are also in libc.)

Building the package locally (openSUSE 11.4) from the same spec file produces the expected result, i. e. ldd lists libsyncdir and Requires also contains it.

Strangely, according to the build logs from OBS it works OK for SLE_11_SP1 but doesn’t for openSUSE-11.3, 11.4 and Factory.

Any ideas?


Found it. I was linking with “gcc … -lsyncdir file.o -o file”, but in newer openSUSE versions the order of arguments during linking matters. I. e. libsyncdir is only looked at if files listed before -lsyncdir use symbols from it. Moving -lsyncdir to the end of the argument list fixed the problem.

(I’d been bitten by this before, but then linking failed - in this case it worked because libsyncdir contains only symbols also present in libc.)