Solaris 8 and Cyrus compilation revisited...

Alexey Melnikov alexey.melnikov at isode.com
Wed Sep 14 05:36:46 EDT 2005


Carson Gaspar wrote:

> --On Wednesday, September 07, 2005 02:17:05 PM -0500 Alex Moen 
> <alexm at ndtel.com> wrote:
>
>> OK, I tried these patches, and get the exact same errors.  It looks 
>> to me
>> like ld is having problems here... No matter what I do, I get the
>> following errors:
>>
>> gcc -Wall -W -g -O2 -o .libs/sasldblistusers2 sasldblistusers.o
>> ../lib/.libs/libsasl2.so -ldl -lresolv -lsocket -lnsl -lresolv -lsocket
>> -L/usr/lib -ldb -lresolv -lsocket -lnsl ../sasldb/.libs/libsasldb.al
>> -lresolv -lsocket -lresolv -lsocket -R/usr/lib
>> Undefined symbol        first referenced in file
>> db_strerror             ../sasldb/.libs/libsasldb.al(db_berkeley.lo)
>> db_create               ../sasldb/.libs/libsasldb.al(db_berkeley.lo)
>> ld: fatal: Symbol referencing errors. No output written to
>> .libs/sasldblistusers2
>
>
> Which ld are you using? /usr/ccs/bin/ld, or GNU ld? My tests were with 
> /usr/ccs/bin/ld (and Sun Studio 10, not gcc). It looks like the ld 
> you're using is order sensitive. Since your -ldb is before your 
> libsasldb.al, the symbols aren't being resolved. If you added a 
> trailing "-ldb" (or perhaps a trailing "-ldb -lsocket -lnsl"), it 
> should link.
>
> If this does fix your problem, the root cause is that 
> sasldb/libsasldb.la is wrong. Perhaps changing sasldb/Makefile.am (or 
> just hacking Makefile.in, as regenerating the 
> libtool/automake/autoconf is painful...) so that:
>
> libsasldb_la_LIBADD = $(SASL_DB_BACKEND)
>
> becomes:
>
> libsasldb_la_LIBADD = $(SASL_DB_BACKEND) $(SASL_DB_LIB)
>
> would help? It does in my test.

I think a better fix is to switch the order of "$(all_sasl_libs)" and 
"../sasldb/libsasldb.la" in utils/Makefile.am.
Does the attached patch work?

-------------- next part --------------
--- orig.Makefile.am	2005-09-13 21:35:55.000000000 +0100
+++ Makefile.am	2005-09-13 21:38:11.000000000 +0100
@@ -56,9 +56,9 @@
 man_MANS = saslpasswd2.8 sasldblistusers2.8
 endif
 
-saslpasswd2_LDADD = $(all_sasl_libs) ../sasldb/libsasldb.la
+saslpasswd2_LDADD = ../sasldb/libsasldb.la $(all_sasl_libs)
 saslpasswd2_SOURCES = saslpasswd.c
-sasldblistusers2_LDADD = $(all_sasl_libs) ../sasldb/libsasldb.la
+sasldblistusers2_LDADD = ../sasldb/libsasldb.la $(all_sasl_libs)
 sasldblistusers2_SOURCES = sasldblistusers.c
 dbconverter_2_LDADD = ../sasldb/libsasldb.la $(all_sasl_libs)
 


More information about the Cyrus-sasl mailing list