# Created with quilt === From: Jan Engelhardt jengelh@inai.de Date: 2012-05-11 19:34:50.087905211 +0200
build: resolve link failure
libtool: link: gcc -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -fno-strict-aliasing -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Wl,--version-script -Wl,./src/providers/sssd_be.exports -o sssd_be src/providers/data_provider_be.o src/providers/data_provider_fo.o src/providers/data_provider_opts.o src/providers/data_provider_callbacks.o src/providers/fail_over.o src/resolv/async_resolv.o -Wl,--export-dynamic -lpam -lcares ./.libs/libsss_util.a -ltevent -ltalloc -lpopt -lldb -ldbus-1 -lpcre -lini_config -lcollection -ldhash -llber -lldap -ltdb -lunistring -lcrypto /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: src/providers/data_provider_be.o: undefined reference to symbol 'dlsym@@GLIBC_2.2.5' /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: note: 'dlsym@@GLIBC_2.2.5' is defined in DSO /lib64/libdl.so.2 so try adding it to the linker command line /lib64/libdl.so.2: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status make[2]: *** [sssd_be] Error 1
--- Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Index: sssd-1.8.3/Makefile.am =================================================================== --- sssd-1.8.3.orig/Makefile.am +++ sssd-1.8.3/Makefile.am @@ -547,7 +547,7 @@ sssd_be_SOURCES = \ src/providers/data_provider_callbacks.c \ $(SSSD_FAILOVER_OBJ) sssd_be_LDADD = \ - $(SSSD_LIBS) \ + -ldl $(SSSD_LIBS) \ $(CARES_LIBS) \ libsss_util.la sssd_be_LDFLAGS = \
On Fri, 2012-05-11 at 19:47 +0200, Jan Engelhardt wrote:
# Created with quilt
From: Jan Engelhardt jengelh@inai.de Date: 2012-05-11 19:34:50.087905211 +0200
build: resolve link failure
libtool: link: gcc -Wall -Wshadow -Wstrict-prototypes -Wpointer-arith -Wcast-qual -Wcast-align -Wwrite-strings -Werror-implicit-function-declaration -fno-strict-aliasing -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Wl,--version-script -Wl,./src/providers/sssd_be.exports -o sssd_be src/providers/data_provider_be.o src/providers/data_provider_fo.o src/providers/data_provider_opts.o src/providers/data_provider_callbacks.o src/providers/fail_over.o src/resolv/async_resolv.o -Wl,--export-dynamic -lpam -lcares ./.libs/libsss_util.a -ltevent -ltalloc -lpopt -lldb -ldbus-1 -lpcre -lini_config -lcollection -ldhash -llber -lldap -ltdb -lunistring -lcrypto /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: src/providers/data_provider_be.o: undefined reference to symbol 'dlsym@@GLIBC_2.2.5' /usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld: note: 'dlsym@@GLIBC_2.2.5' is defined in DSO /lib64/libdl.so.2 so try adding it to the linker command line /lib64/libdl.so.2: could not read symbols: Invalid operation collect2: error: ld returned 1 exit status make[2]: *** [sssd_be] Error 1
Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Index: sssd-1.8.3/Makefile.am
--- sssd-1.8.3.orig/Makefile.am +++ sssd-1.8.3/Makefile.am @@ -547,7 +547,7 @@ sssd_be_SOURCES = \ src/providers/data_provider_callbacks.c \ $(SSSD_FAILOVER_OBJ) sssd_be_LDADD = \
- $(SSSD_LIBS) \
- -ldl $(SSSD_LIBS) \ $(CARES_LIBS) \ libsss_util.la
sssd_be_LDFLAGS = \
While there's nothing wrong with this patch, you SHOULD be picking up the -ldl requirement from pkg-config for nss crypto. Are you perhaps building against openssl instead of nss for crypto? If so, we strongly recommend that you build against libnss. There are several features of SSSD that are unsupported when using openssl. (OpenSSL support is a contributed feature that has been largely unmaintained. All development and testing is done using NSS.)
That said, it's probably more correct for us to be including this explicitly, so I'll ack it. (Making a minor modification to the formatting).
Thank you very much for the patch! Pushed to master and sssd-1-8.
On Friday 2012-05-11 20:31, Stephen Gallagher wrote:
sssd_be_LDADD = \
- $(SSSD_LIBS) \
- -ldl $(SSSD_LIBS) \ $(CARES_LIBS) \ libsss_util.la
sssd_be_LDFLAGS = \
While there's nothing wrong with this patch, you SHOULD be picking up the -ldl requirement from pkg-config for nss crypto.
Even if I were building against nss (I do need to change from crypto to nss indeed), it would not resolve, since there is no -ldl in nss.pc:
prefix=/usr exec_prefix=${prefix} libdir=/usr/lib64 includedir=${prefix}/include/nss3
Name: NSS Description: Network Security Services Version: 3.13.3 Requires: nspr >= 4.9.0 Libs: -lssl3 -lsmime3 -lnss3 -lnssutil3 Cflags: -I${includedir}
-ldl can only come from the libldb m4 pieces, if enabled:
./src/external/libldb.m4: [AC_CHECK_LIB(ldb, ldb_init, [LDB_LIBS="-lldb"], , -ltevent -ltdb -ldl -lldap) ],
On Fri, 2012-05-11 at 23:02 +0200, Jan Engelhardt wrote:
On Friday 2012-05-11 20:31, Stephen Gallagher wrote:
sssd_be_LDADD = \
- $(SSSD_LIBS) \
- -ldl $(SSSD_LIBS) \ $(CARES_LIBS) \ libsss_util.la
sssd_be_LDFLAGS = \
While there's nothing wrong with this patch, you SHOULD be picking up the -ldl requirement from pkg-config for nss crypto.
Even if I were building against nss (I do need to change from crypto to nss indeed), it would not resolve, since there is no -ldl in nss.pc:
prefix=/usr exec_prefix=${prefix} libdir=/usr/lib64 includedir=${prefix}/include/nss3
Name: NSS Description: Network Security Services Version: 3.13.3 Requires: nspr >= 4.9.0 Libs: -lssl3 -lsmime3 -lnss3 -lnssutil3 Cflags: -I${includedir}
Yeah, I think we just have different implementations of that file on Fedora/RHEL. Our NSS module contains the -ldl in Libs:
That said, I agreed that your approach was the correct one (we should not have been relying on linking by luck), and it's been committed upstream. So thank you very much for your contribution.
sssd-devel@lists.fedorahosted.org