Bug 882393 - Building 389-ds-base source produces error message: ./.libs/libslapd.so: undefined reference to .....
Summary: Building 389-ds-base source produces error message: ./.libs/libslapd.so: unde...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: 389-ds-base
Version: rawhide
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Rich Megginson
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-11-30 20:58 UTC by William
Modified: 2020-09-13 20:20 UTC (History)
5 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2012-11-30 21:13:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github 389ds 389-ds-base issues 530 0 None None None 2020-09-13 20:20:54 UTC

Description William 2012-11-30 20:58:35 UTC
Description of problem:
More  ./.libs/libslapd.so: undefined reference to nss symbols appear when building 389-ds-base-1.3.0.a1 on OpenSuse 12.1 64 bit.


Version-Release number of selected component (if applicable):
389-ds-base-1.2.11.15 and 389-ds-base-1.3.0.a1

How reproducible:

Steps to Reproduce:
1. Install all prerequisites for 64 bit platforms as per http://directory.fedoraproject.org/wiki/Building.

2.
COnfigure 389-ds-base with command:
./configure --prefix=/usr/local/pkgs/389_ds_components/389-ds-base-1.2.11.15/ds-base --enable-debug=yes --with-gnu-ld=yes 
	    --with-systemdsystemunitdir=/usr/local/pkgs/389_ds_components/389-ds-base-1.2.11.15/confdirs/systemdsystemunitdir 
	    --with-systemdsystemconfdir=/usr/local/pkgs/389_ds_components/389-ds-base-1.2.11.15/confdirs/systemdsystemconfdir 
	    --with-instconfigdir=/usr/local/pkgs/389_ds_components/389-ds-base-1.2.11.15/confdirs/instconfigdir 
	    --with-nspr=/usr/local/pkgs/389_ds_depencences/nspr-4.9.3 
	    --with-nss=/usr/local/pkgs/389_ds_depencences/nss-3.14 
	    --with-nss-inc=/usr/local/pkgs/389_ds_depencences/nss-3.14/include 
	    --with-nss-lib=/usr/local/pkgs/389_ds_depencences/nss-3.14/lib 
	    --with-openldap=/usr/local/pkgs/openldap-2.4.33_389_directory_server 
	    --with-openldap-inc=/usr/local/pkgs/openldap-2.4.33_389_directory_server/include 
	    --with-openldap-lib=/usr/local/pkgs/openldap-2.4.33_389_directory_server/lib64 
	    --with-openldap-bin=/usr/local/pkgs/openldap-2.4.33_389_directory_server/bin 
	    --with-svrcore=/usr/local/pkgs/389_ds_depencences/svrcore-4.0.4 
	    --with-icu=/usr/local/pkgs/389_ds_depencences/icu4c-50_1 
	    --with-netsnmp=/usr/local/pkgs/389_ds_depencences/net-snmp-5.7.2 
	    --with-netsnmp-inc=/usr/local/pkgs/389_ds_depencences/net-snmp-5.7.2/include 
	    --with-netsnmp-lib=/usr/local/pkgs/389_ds_depencences/net-snmp-5.7.2/lib64 
	    --with-kerberos=/usr/local/pkgs/389_ds_depencences/krb5-1.10.3 
	    --with-pcre=/usr/local/pkgs/389_ds_depencences/pcre-8.32

3.
make
  
Actual results:
..............................................
/bin/sh ./libtool --tag=CC   --mode=link gcc  -g -O2   -o migratecred-bin ldap/servers/slapd/tools/migratecred_bin-migratecred.o libslapd.la 
      -L/usr/local/pkgs/389_ds_depencences/nspr-4.9.3/lib64 -lplc4 -lplds4 -lnspr4 -L/usr/local/pkgs/389_ds_depencences/nss-3.14/lib -lssl3 -lnss3 
      -L/usr/local/pkgs/389_ds_depencences/svrcore-4.0.4/lib64 -lsvrcore -L/usr/local/pkgs/openldap-2.4.33_389_directory_server/lib64 -lldap_r  -llber -lsasl2 
libtool: link: gcc -g -O2 -o .libs/migratecred-bin ldap/servers/slapd/tools/migratecred_bin-migratecred.o  ./.libs/libslapd.so 
      -L/usr/local/pkgs/openldap-2.4.33_389_directory_server/lib64 -L/usr/local/pkgs/389_ds_depencences/svrcore-4.0.4/lib64 
      -L/usr/local/pkgs/389_ds_depencences/nss-3.14/lib -L/usr/local/pkgs/389_ds_depencences/nspr-4.9.3/lib64 -L/usr/local/pkgs/389_ds_depencences/krb5-1.10.3/lib64 
      -L/usr/local/pkgs/389_ds_depencences/pcre-8.32/lib64 -lkrb5 -lk5crypto -lcom_err /usr/local/pkgs/389_ds_depencences/pcre-8.32/lib64/libpcre.so -lpthread 
      /usr/local/pkgs/389_ds_depencences/svrcore-4.0.4/lib64/libsvrcore.so -lssl3 -lnss3 -lplds4 -lplc4 -lnspr4 
      /usr/local/pkgs/openldap-2.4.33_389_directory_server/lib64/libldap_r.so -lssl -lcrypto /usr/local/pkgs/openldap-2.4.33_389_directory_server/lib64/liblber.so 
      -lresolv -lsasl2 -pthread -Wl,-rpath -Wl,/usr/local/pkgs/389_ds_components/389-ds-base-1.2.11.15/ds-base/lib64/dirsrv 
      -Wl,-rpath -Wl,/usr/local/pkgs/389_ds_depencences/pcre-8.32/lib64 -Wl,-rpath -Wl,/usr/local/pkgs/389_ds_depencences/svrcore-4.0.4/lib64 
      -Wl,-rpath -Wl,/usr/local/pkgs/openldap-2.4.33_389_directory_server/lib64
./.libs/libslapd.so: undefined reference to `MD5_HashBuf'
./.libs/libslapd.so: undefined reference to `SEED_DestroyContext'
./.libs/libslapd.so: undefined reference to `Camellia_InitContext'
./.libs/libslapd.so: undefined reference to `Camellia_Encrypt'
./.libs/libslapd.so: undefined reference to `SEED_Decrypt'
./.libs/libslapd.so: undefined reference to `MD5_Begin'
./.libs/libslapd.so: undefined reference to `SHA1_End'
./.libs/libslapd.so: undefined reference to `RC2_InitContext'
./.libs/libslapd.so: undefined reference to `AES_Decrypt'
./.libs/libslapd.so: undefined reference to `Camellia_DestroyContext'
./.libs/libslapd.so: undefined reference to `HMAC_Begin'
./.libs/libslapd.so: undefined reference to `SHA1_Clone'
./.libs/libslapd.so: undefined reference to `MD5_Clone'
./.libs/libslapd.so: undefined reference to `RC2_Decrypt'
./.libs/libslapd.so: undefined reference to `AES_DestroyContext'
./.libs/libslapd.so: undefined reference to `AES_Encrypt'
./.libs/libslapd.so: undefined reference to `RC2_DestroyContext'
./.libs/libslapd.so: undefined reference to `TLS_PRF'
./.libs/libslapd.so: undefined reference to `Camellia_Decrypt'
./.libs/libslapd.so: undefined reference to `RC4_DestroyContext'
./.libs/libslapd.so: undefined reference to `SEED_InitContext'
./.libs/libslapd.so: undefined reference to `BL_Unload'
./.libs/libslapd.so: undefined reference to `RC4_Decrypt'
./.libs/libslapd.so: undefined reference to `RC4_InitContext'
./.libs/libslapd.so: undefined reference to `AES_InitContext'
./.libs/libslapd.so: undefined reference to `SEED_Encrypt'
./.libs/libslapd.so: undefined reference to `MD5_End'
./.libs/libslapd.so: undefined reference to `SHA1_Begin'
./.libs/libslapd.so: undefined reference to `RC4_Encrypt'
./.libs/libslapd.so: undefined reference to `DES_Decrypt'
./.libs/libslapd.so: undefined reference to `DES_Encrypt'
./.libs/libslapd.so: undefined reference to `DES_DestroyContext'
./.libs/libslapd.so: undefined reference to `RC2_Encrypt'
./.libs/libslapd.so: undefined reference to `MD5_DestroyContext'
./.libs/libslapd.so: undefined reference to `DES_InitContext'
./.libs/libslapd.so: undefined reference to `HMAC_Destroy'
./.libs/libslapd.so: undefined reference to `SHA1_HashBuf'
./.libs/libslapd.so: undefined reference to `SHA256_HashBuf'
./.libs/libslapd.so: undefined reference to `HASH_GetRawHashObject'
./.libs/libslapd.so: undefined reference to `HMAC_Finish'
./.libs/libslapd.so: undefined reference to `SHA1_DestroyContext'
collect2: ld returned 1 exit status
make[1]: *** [migratecred-bin] Error 1



Expected results:
The symbols should be found in nss library but they are not.

Additional info:
Read some info from: http://www.sourceware.org/autobook/autobook/autobook_88.html#SEC88 so I tried 
using libslapd_la_LDFLAGS = -no-undefined but the result was the same.

At: http://www.sourceware.org/autobook/autobook/autobook_172.html#SEC172 they say that:
`-no-undefined'
This is an extremely important option when you are aiming for maximum portability. It declares that all of the symbols required by the target are resolved at link time. Some shared library architectures do not allow undefined symbols by default (Tru64 Unix), and others do not allow them at all (AIX). By using this switch, and ensuring that all symbols really are resolved at link time, your libraries will work on even these platforms. See section 11.2.1 Creating Libtool Libraries with Automake.

I also read this one:
http://www.gnu.org/software/libtool/manual/html_node/Inter_002dlibrary-dependencies.html and tried to remake libslapd.so playing around with rpath and -lnss3 in different places in the libtool link command.


Also read ltmain.sh and saw this one:

func_mode_link ()
{
    $opt_debug
    case $host in
    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
      # It is impossible to link a dll without this setting, and
      # we shouldn't force the makefile maintainer to figure out
      # which system we are compiling for in order to pass an extra
      # flag for every libtool invocation.
      # allow_undefined=no

      # FIXME: Unfortunately, there are problems with the above when trying
      # to make a dll which has undefined symbols, in which case not
      # even a static library is built.  For now, we need to specify
      # -no-undefined on the libtool link line when we can be certain
      # that all symbols are satisfied, otherwise we get a static library.
      allow_undefined=yes
....................
}

Also I searched some symbols in nss source code and found them defined in mozilla/security/nss/lib/freebl/loader.c so I added -lfreebl3 at the NSS_LINK in Makefile.am but the result was the same.

Can someone give me a clue what could be the propblem?

Thanks,
Steve

Comment 1 Rich Megginson 2012-11-30 21:12:09 UTC
Upstream ticket:
https://fedorahosted.org/389/ticket/530

Comment 2 Rich Megginson 2012-11-30 21:13:19 UTC
closing - this is not a Fedora bug - please refer to https://fedorahosted.org/389/ticket/530


Note You need to log in before you can comment on or make changes to this bug.