In recent versions or binutils, or in binutils-gold, the default for ld is linking with --no-add-needed. With this flag activated, ld does not perform indirect linking, and therefore, osptoolkit fails to build from source.
The following is an extract of the build errors in Debian and Ubuntu:
libtool --mode=link gcc -o bin/enroll enroll/osptnepinit.o enroll/osptnepenroll.o enroll/osptnep.o enroll/osptneputil.o lib/libosptk.la
libtool: link: gcc -o bin/.libs/enroll enroll/osptnepinit.o enroll/osptnepenroll.o enroll/osptnep.o enroll/osptneputil.o lib/.libs/libosptk.so
/usr/bin/ld: enroll/osptnep.o: in function OSPPEnrollParseParameters:enroll/osptnep.c:509: error: undefined reference to 'BIO_new_file'
/usr/bin/ld: enroll/osptnep.o: in function OSPPEnrollParseParameters:enroll/osptnep.c:518: error: undefined reference to 'PEM_read_bio_X509'
/usr/bin/ld: enroll/osptnep.o: in function OSPPEnrollParseParameters:enroll/osptnep.c:519: error: undefined reference to 'i2d_X509'
/usr/bin/ld: enroll/osptnep.o: in function OSPPEnrollParseParameters:enroll/osptnep.c:520: error: undefined reference to 'EVP_EncodeBlock'
/usr/bin/ld: enroll/osptnep.o: in function OSPPEnrollParseParameters:enroll/osptnep.c:544: error: undefined reference to 'X509_free'
/usr/bin/ld: enroll/osptnep.o: in function OSPPEnrollParseParameters:enroll/osptnep.c:546: error: undefined reference to 'BIO_free'
/usr/bin/ld: enroll/osptnep.o: in function OSPPEnrollParseParameters:enroll/osptnep.c:554: error: undefined reference to 'BIO_new_file'
/usr/bin/ld: enroll/osptnep.o: in function OSPPEnrollParseParameters:enroll/osptnep.c:563: error: undefined reference to 'PEM_read_bio_X509_REQ'
/usr/bin/ld: enroll/osptnep.o: in function OSPPEnrollParseParameters:enroll/osptnep.c:564: error: undefined reference to 'i2d_X509_REQ'
/usr/bin/ld: enroll/osptnep.o: in function OSPPEnrollParseParameters:enroll/osptnep.c:565: error: undefined reference to 'EVP_EncodeBlock'
/usr/bin/ld: enroll/osptnep.o: in function OSPPEnrollParseParameters:enroll/osptnep.c:587: error: undefined reference to 'X509_REQ_free'
/usr/bin/ld: enroll/osptnep.o: in function OSPPEnrollParseParameters:enroll/osptnep.c:588: error: undefined reference to 'BIO_free'
collect2: ld returned 1 exit status
make[1]: *** [bin/enroll] Error 1
More information related to this issue can be found here: http://wiki.debian.org/qa.debian.org/FTBFS#A2009-11-02Packagesfailingbecausebinutils-gold.2BAC8-indirectlinking
The attached patch add the missing libraries to the linker in the Makefile, fixing the resulting build failure. This patch has already been applied in Debian and Ubuntu:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=555877
https://bugs.launchpad.net/ubuntu/oneiric/+source/osptoolkit/+bug/756018
To reproduce this bug, prepend the flag --no-add-needed to ld, or build the package with the current development version of Ubuntu, that can be downloaded from here:
http://cdimage.ubuntu.com/daily-live/20110705.1/oneiric-desktop-i386.iso
Thanks for considering this patch
Sebastian Carneiro
scarneiro@fibertel.com.ar