Bug 275154 - print/cups: build fail without GNUTLS
Summary: print/cups: build fail without GNUTLS
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Tijl Coosemans
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-17 19:13 UTC by Ivan Rozhuk
Modified: 2023-11-17 23:05 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (tijl)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2023-11-17 19:13:35 UTC
echo Linking ippeveprinter...
echo Linking ippeveprinter-static...
Linking ippeveprinter...
cc -L../cups  -Wl,-z,relro,-z,now -fstack-protector-strong  -Wl,-R/usr/local/lib -fPIE -pie -fPIC   -o ippeveprinter ippeveprinter.o  -lpam -ldl -L../cups -lcups
Linking ippeveprinter-static...
cc -L../cups  -Wl,-z,relro,-z,now -fstack-protector-strong  -Wl,-R/usr/local/lib -fPIE -pie -fPIC   -o ippeveprinter-static ippeveprinter.o -lpam -ldl ../cups/libcups.a    -lz -lpthread -lm -lcrypt -L/usr/local/lib  -lz
/usr/bin/true -s "-" ipptool
ld: error: undefined symbol: gnutls_hash_get_len
>>> referenced by hash.c
>>>               hash.o:(hash_data) in archive ../cups/libcups.a

ld: error: undefined symbol: gnutls_hash_init
>>> referenced by hash.c
>>>               hash.o:(hash_data) in archive ../cups/libcups.a

ld: error: undefined symbol: gnutls_hash
>>> referenced by hash.c
>>>               hash.o:(hash_data) in archive ../cups/libcups.a
>>> referenced by hash.c
>>>               hash.o:(hash_data) in archive ../cups/libcups.a

ld: error: undefined symbol: gnutls_hash_deinit
>>> referenced by hash.c
>>>               hash.o:(hash_data) in archive ../cups/libcups.a
cc: error: linker command failed with exit code 1 (use -v to see invocation)
gmake[3]: *** [Makefile:220: ipptool-static] Error 1
gmake[3]: *** Waiting for unfinished jobs....
/usr/bin/true -s "-" ippeveprinter
ld: error: undefined symbol: gnutls_hash_get_len
>>> referenced by hash.c
>>>               hash.o:(hash_data) in archive ../cups/libcups.a

ld: error: undefined symbol: gnutls_hash_init
>>> referenced by hash.c
>>>               hash.o:(hash_data) in archive ../cups/libcups.a

ld: error: undefined symbol: gnutls_hash
>>> referenced by hash.c
>>>               hash.o:(hash_data) in archive ../cups/libcups.a
>>> referenced by hash.c
>>>               hash.o:(hash_data) in archive ../cups/libcups.a

ld: error: undefined symbol: gnutls_hash_deinit
>>> referenced by hash.c
>>>               hash.o:(hash_data) in archive ../cups/libcups.a
cc: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 1 Ivan Rozhuk 2023-11-17 19:29:14 UTC
As far I understand if gnutls disabled than OpenSSL must be used:
--with-tls=...          use cdsa (macOS), gnutls, or openssl for TLS support

Upstream broke build without cryptolib:
/cups/hash.c
....
#ifdef HAVE_OPENSSL
  const EVP_MD	*md = NULL;		// Message digest implementation
  EVP_MD_CTX	*ctx;			// Context
#else // HAVE_GNUTLS
  gnutls_digest_algorithm_t alg = GNUTLS_DIG_UNKNOWN;
					// Algorithm
  gnutls_hash_hd_t ctx;			// Context
#endif // HAVE_OPENSSL
....
Comment 2 commit-hook freebsd_committer freebsd_triage 2023-11-17 22:11:29 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=6218c0ab259f38c6e9ec88291b95a333c07d8c60

commit 6218c0ab259f38c6e9ec88291b95a333c07d8c60
Author:     Tijl Coosemans <tijl@FreeBSD.org>
AuthorDate: 2023-11-17 20:51:47 +0000
Commit:     Tijl Coosemans <tijl@FreeBSD.org>
CommitDate: 2023-11-17 22:10:11 +0000

    print/cups: Fix build with GNUTLS disabled

    PR:             275154

 print/cups/Makefile | 4 ++++
 print/cups/distinfo | 4 +++-
 2 files changed, 7 insertions(+), 1 deletion(-)
Comment 3 Ivan Rozhuk 2023-11-17 23:05:36 UTC
Fixed, thanks!