The Samba-Bugzilla – Bug 7244
libcups linking broken on OpenBSD Possibly other OS's
Last modified: 2010-08-24 10:26:38 UTC
The change to configure / configure.in from samba 3.4.x series to samba 3.5.x series changed the way the PRINT_LIBS lines work for cups resulting in a non linking smbd when cups support is enabled.
3.4.x PRINT_LIBS="$PRINT_LIBS `$CUPS_CONFIG --libs`"
3.5.x PRINT_LIBS="$PRINT_LIBS -lcups"
config.log:PRINT_LIBS=' -lcups -lgssapi -lkrb5 -lasn1 -lcrypto -lssl -lcrypto -lz -pthread -lm'
config.status:S["PRINT_LIBS"]=" -lcups -lgssapi -lkrb5 -lasn1 -lcrypto -lssl -lcrypto -lz -pthread -lm"
Because -pthread is missing in the 3.5.x series When linking in libcups it complains about missing pthread symbols and the build stops.
adding the way 3.4.x built the PRINT_LIBS for cups ie PRINT_LIBS="$PRINT_LIBS `$CUPS_CONFIG --libs`" solves the issue.
your cups is built with pthread support but at least the cups libraries are not linked against libpthread. You can either fix your cups installation so that libcups is properly linked against pthread itself. If this is the default openbsb cups package, you should file a bug report ther. As a quick workaround you can set LDFLAGS="-Wl,-lpthread" before running Samba's configure.
Bjoern, what again was the reason for that cups_config change ?
cups-config does not do usefull things like krb5-config. It outputs which libs the cups or cupsimage libs use. Users of cups just need to link against cups not against "-lcups -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err -lkeyutils -lresolv -ldl -lssl -lcrypto -lz -lpthread -lm -lcrypt" like on my system. "-lcups" is all we need the rest of the cruft is a dependency of cups itself.
there is a fallback in master now (616e187d68e3e) in case libcups is underlinked.
Metze, can you please review 616e187d68e3e7b202413a96518b31d029e9563a for cherry-pick to 3.5? Build farm host samba-i386 shows that it works as intended.
616e187d68e3e7b202413a96518b31d029e9563a looks ok
Created attachment 5923 [details]
Share Library Handling on OpenBSD
Samba 3.5.4 will ship in the OpenBSD ports / packages tree for 4.8 when it is release (Nov). Samba shared Library support is broken for OpenBSD and we will be shipping with the attached patch that resolve the issue. It will be good if it could be reviewed and included in the official samba tree.
(In reply to comment #6)
> 616e187d68e3e7b202413a96518b31d029e9563a looks ok
Pushed to v3-5-test.
(In reply to comment #7)
> Created an attachment (id=5923) [details]
> Share Library Handling on OpenBSD
> Samba 3.5.4 will ship in the OpenBSD ports / packages tree for 4.8 when it is
> release (Nov). Samba shared Library support is broken for OpenBSD and we will
> be shipping with the attached patch that resolve the issue. It will be good if
> it could be reviewed and included in the official samba tree.
Björn, could you comment this patch, please?
it was commented already, it's also marked obsoleted now