On Tue, Aug 28, 2018 at 09:38:50PM +0200, Andreas Tille wrote: > > Also, this broken library package would have been detectable at build time > > if you were building with -Wl,-z,defs in LDFLAGS, as that would have > > prevented ever generating a shared library with missing symbols. That's a > > good idea to do anyway, but in particular it would mean that if you didn't > > want to support i386 anymore, you could just add this to build flags and not > > have to worry about changing the architecture list explicitly.
> So I did but was running into new problems which are caused by the hand > craftet build system (yes, I tried to convince upstream to use some of > the usual candidates but failed :-((( ). I was able to add some missing > libs in pbuilder chroot but whatever trick I try[1] the build system > always constructs a different command line than I tested inside the > pbuilder chroot. > Do you have any idea to stop this insane messing up with library options? > [1] > https://salsa.debian.org/med-team/ncbi-vdb/blob/master/debian/patches/fix_linking.patch Failure I see in a local build is: Try to add extra libs to LDFLAGS ... unfortunately this fails as well CMD=gcc -shared -o /tmp/ncbi-vdb/debian/tmp/usr/ncbi-vdb/linux/gcc/x86_64/dbg/lib/libkdf5.so.2.9.2 -Wl,-soname,libkdf5.so.2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -Wl,--as-needed -g -g hdf5dir.pic.o hdf5file.pic.o hdf5arrayfile.pic.o -L/tmp/ncbi-vdb/debian/tmp/usr/ncbi-vdb/linux/gcc/x86_64/dbg/lib -L/tmp/ncbi-vdb/debian/tmp/usr/ncbi-vdb/linux/gcc/x86_64/dbg/ilib -lhdf5_serial -lz -lmbedx509 -lmbedtls -lmbedcrypto -Wl,-Bstatic -Wl,-whole-archive -lklib -lkfs -Wl,-no-whole-archive -Wl,-Bdynamic -lbz2 -ldl -lpthread -lm -lkproc -lkfs -lkdb -lkns -lkfg gcc -shared -o /tmp/ncbi-vdb/debian/tmp/usr/ncbi-vdb/linux/gcc/x86_64/dbg/lib/libkdf5.so.2.9.2 -Wl,-soname,libkdf5.so.2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -Wl,--as-needed -g -g hdf5dir.pic.o hdf5file.pic.o hdf5arrayfile.pic.o -L/tmp/ncbi-vdb/debian/tmp/usr/ncbi-vdb/linux/gcc/x86_64/dbg/lib -L/tmp/ncbi-vdb/debian/tmp/usr/ncbi-vdb/linux/gcc/x86_64/dbg/ilib -lhdf5_serial -lz -lmbedx509 -lmbedtls -lmbedcrypto -Wl,-Bstatic -Wl,-whole-archive -lklib -lkfs -Wl,-no-whole-archive -Wl,-Bdynamic -lbz2 -ldl -lpthread -lm /tmp/ncbi-vdb/debian/tmp/usr/ncbi-vdb/linux/gcc/x86_64/dbg/ilib/libklib.a(hashfile.pic.o): In function `map_calloc': /tmp/ncbi-vdb/libs/klib/hashfile.c:288: undefined reference to `KLockAcquire' /tmp/ncbi-vdb/libs/klib/hashfile.c:321: undefined reference to `KLockUnlock' /tmp/ncbi-vdb/libs/klib/hashfile.c:328: undefined reference to `KLockUnlock' [...] When using -Wl,--as-needed, each object needs to be listed on the commandline /after/ those objects that use it. A correct commandline would be: gcc -shared -o /tmp/ncbi-vdb/debian/tmp/usr/ncbi-vdb/linux/gcc/x86_64/dbg/lib/libkdf5.so.2.9.2 -Wl,-soname,libkdf5.so.2 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,-z,defs -Wl,--as-needed -g -g hdf5dir.pic.o hdf5file.pic.o hdf5arrayfile.pic.o -L/tmp/ncbi-vdb/debian/tmp/usr/ncbi-vdb/linux/gcc/x86_64/dbg/lib -L/tmp/ncbi-vdb/debian/tmp/usr/ncbi-vdb/linux/gcc/x86_64/dbg/ilib -lhdf5_serial -lz -Wl,-Bstatic -Wl,-whole-archive -lklib -lkfs -Wl,-no-whole-archive -Wl,-Bdynamic -lbz2 -ldl -lpthread -lm -lkfs -lkq -lkproc -lkdb -lkns -lkfg -lksproc -lmbedx509 -lmbedtls -lmbedcrypto -lz So this seems to be sufficient: CMD="$CMD -lkfs -lkq -lkproc -lkdb -lkns -lkfg -lksproc -lmbedx509 -lmbedtls -lmbedcrypto -lz" Though there is another similar error when trying to link libdiagnose.so later. -- Steve Langasek Give me a lever long enough and a Free OS Debian Developer to set it on, and I can move the world. Ubuntu Developer https://www.debian.org/ [email protected] [email protected]
signature.asc
Description: PGP signature

