I am attempting to compile Samba on Solaris 9 using the Sun Studio 11 compiler. My configure is a bit on the ugly side: CPPFLAGS="-I/usr/local/ssl/include/ -I/usr/local/include/ -I/usr/local/openldap/include/" LDFLAGS="-L/usr/local/ssl/lib/ -L/usr/local/lib/ -L/usr/local/openldap/lib/ -R/usr/local/openldap/lib/ -R/usr/local/samba/lib" ./configure --with-included-popt --with-krb5=/usr/local --disable-swat --disable-cups Make (on the second run) generates the following output: Using CFLAGS = -I../lib/zlib -I/usr/local/include -O -I. -I/export/home/pkgbuild/pkgs/samba-3.6.3/source3 -I/export/home/pkgbuild/pkgs/samba-3.6.3/source3/../lib/popt -I/export/home/pkgbuild/pkgs/samba-3.6.3/source3/../lib/iniparser/src -Iinclude -I./include -I. -I. -I./../lib/replace -I./../lib/tevent -I./librpc -I./.. -I./../lib/talloc -I../lib/tdb/include -DHAVE_CONFIG_H -I/usr/local/include -I/usr/local/ssl/include/ -I/usr/local/include/ -I/usr/local/openldap/include/ -D_REENTRANT -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DLDAP_DEPRECATED -DSUNOS5 -I/export/home/pkgbuild/pkgs/samba-3.6.3/source3/lib -I.. -D_SAMBA_BUILD_=3 -D_SAMBA_BUILD_=3 PICFLAG = -KPIC LIBS = -lsendfile -lresolv -lrt -ldl -lnsl -lsocket -lrt LDFLAGS = -L/usr/local/lib -R/usr/local/lib -L/usr/local/ssl/lib -L/usr/local/ssl/lib/ -L/usr/local/lib/ -L/usr/local/openldap/lib/ -R/usr/local/openldap/lib/ -R/usr/local/samba/lib -lthread -L./bin DYNEXP = LDSHFLAGS = -KPIC -G -L/usr/local/lib -R/usr/local/lib -L/usr/local/ssl/lib -L/usr/local/ssl/lib/ -L/usr/local/lib/ -L/usr/local/openldap/lib/ -R/usr/local/openldap/lib/ -R/usr/local/samba/lib -lthread -L./bin -lc -Wl,-z,defs SHLIBEXT = so SONAMEFLAG = -Wl,-h, Linking bin/winbind_krb5_locator.so Undefined first referenced symbol in file socket ./../lib/replace/getifaddrs.o (symbol belongs to implicit dependency /lib/libsocket.so.1) getaddrinfo ../nsswitch/winbind_krb5_locator.o (symbol belongs to implicit dependency /lib/libsocket.so.1) freeaddrinfo ../nsswitch/winbind_krb5_locator.o (symbol belongs to implicit dependency /lib/libsocket.so.1) inet_pton ./../lib/replace/inet_aton.o (symbol belongs to implicit dependency /lib/libnsl.so.1) ld: fatal: Symbol referencing errors. No output written to bin/winbind_krb5_locator.so *** Error code 1 Samba then builds cleanly if I edit the Makefile and add $(LIBS) in the following definition as follows: bin/winbind_krb5_locator.so: $(BINARY_PREREQS) $(WINBIND_KRB5_LOCATOR_OBJ) $(LIBWBCLIENT) @echo "Linking $@" @$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_KRB5_LOCATOR_OBJ) $(LIBWBCLIENT_LIBS) $(KRB5LIBS) $(LIBS) \ -Wl,-h,`basename $@`
adding LIBREPLACE_LIBS on that system solves the issue, too? This issue is not reproducible on one of our systems. Can you please verify that adding $LIBREPLACE_LIBS works?
I hit this bug tonight. Samba 3.6.5 / Solaris 9 / Sun Studio 12 compiler Compiling ../nsswitch/winbind_krb5_locator.c Linking bin/winbind_krb5_locator.so Undefined first referenced symbol in file socket ./../lib/replace/getifaddrs.o (symbol belon gs to implicit dependency /usr/lib/libsocket.so.1) getaddrinfo ../nsswitch/winbind_krb5_locator.o (symbol belongs to implicit dependency /usr/lib/libsocket.so.1) freeaddrinfo ../nsswitch/winbind_krb5_locator.o (symbol belongs to implicit dependency /usr/lib/libsocket.so.1) inet_pton ./../lib/replace/inet_aton.o (symbol belong s to implicit dependency /usr/lib/libnsl.so.1) ld: fatal: Symbol referencing errors. No output written to bin/winbind_krb5_loca tor.so *** Error code 1 make: Fatal error: Command failed for target `bin/winbind_krb5_locator.so' I added LIBREPLACE_LIBS, as it included the missing -lsocket and -lnsl libraries to the makefile and it allowed me to finish compiling. I suppose I could have saved 10 minutes if I'd googled first. Anyway, I'll confirm that just adding in LIBREPLACE_LIBS (-lsocket -lnsl) appears to work just fine. Here's what my Makefile looks like: bin/winbind_krb5_locator.so: $(BINARY_PREREQS) $(WINBIND_KRB5_LOCATOR_OBJ) $(LIB WBCLIENT) @echo "Linking $@" @$(SHLD) $(LDSHFLAGS) -o $@ $(WINBIND_KRB5_LOCATOR_OBJ) $(LIBWBCLIENT_LI BS) $(KRB5LIBS) $(LIBREPLACE_LIBS) \ -Wl,-h,`basename $@`
Thanks Cory for verifying! 3085225e72c75abf84d7740334459cd971ee4c56 in master fixes this now. Metze, can you please ACK this and reassign to Karo for cherry-picking to 3.6 ?
(In reply to comment #3) > Thanks Cory for verifying! > > 3085225e72c75abf84d7740334459cd971ee4c56 in master fixes this now. Metze, can > you please ACK this and reassign to Karo for cherry-picking to 3.6 ? Yes, looks good. Karolin, please cherry-pick -x it applies to v3-6-test fine for me.
Pushed to v3-6-test. Closing out bug report. Thanks!
*** Bug 9291 has been marked as a duplicate of this bug. ***
reopening for the fix in 3.5
(In reply to comment #7) > reopening for the fix in 3.5 Pushed to v3-5-test. Closing out bug report. Thanks!