Bug 7244 - libcups linking broken on OpenBSD Possibly other OS's
libcups linking broken on OpenBSD Possibly other OS's
Status: RESOLVED FIXED
Product: Samba 3.5
Classification: Unclassified
Component: Build environment
3.5.1
Other OpenBSD
: P3 normal
: ---
Assigned To: Björn Jacke
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-12 19:13 UTC by Ian McWilliam
Modified: 2010-08-24 10:26 UTC (History)
1 user (show)

See Also:
metze: review+


Attachments
Share Library Handling on OpenBSD (2.16 KB, patch)
2010-08-24 06:46 UTC, Ian McWilliam
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ian McWilliam 2010-03-12 19:13:04 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"

3.4.x
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"

3.5.x
config.log:PRINT_LIBS=' -lcups'
config.status:S["PRINT_LIBS"]=" -lcups"

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.
Comment 1 Björn Jacke 2010-03-15 03:55:42 UTC
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.
Comment 2 Guenther Deschner 2010-05-27 05:06:46 UTC
Bjoern, what again was the reason for that cups_config change ?
Comment 3 Björn Jacke 2010-05-27 05:17:02 UTC
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.
Comment 4 Björn Jacke 2010-08-12 09:35:08 UTC
there is a fallback in master now (616e187d68e3e) in case libcups is underlinked.
Comment 5 Björn Jacke 2010-08-23 09:47:33 UTC
Metze, can you please review 616e187d68e3e7b202413a96518b31d029e9563a for cherry-pick to 3.5? Build farm host samba-i386 shows that it works as intended.
Comment 6 Stefan Metzmacher 2010-08-23 10:20:27 UTC
616e187d68e3e7b202413a96518b31d029e9563a looks ok
Comment 7 Ian McWilliam 2010-08-24 06:46:15 UTC
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.
Comment 8 Karolin Seeger 2010-08-24 09:41:08 UTC
(In reply to comment #6)
> 616e187d68e3e7b202413a96518b31d029e9563a looks ok
> 

Pushed to v3-5-test.
Comment 9 Karolin Seeger 2010-08-24 09:41:54 UTC
(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?

Comment 10 Björn Jacke 2010-08-24 10:26:38 UTC
it was commented already, it's also marked obsoleted now