Bug 261274

Summary: dns/dnsjit: build error
Product: Ports & Packages Reporter: Jaap Akkerhuis <jaap>
Component: Individual Port(s)Assignee: Daniel Engberg <diizzy>
Status: Closed FIXED    
Severity: Affects Only Me CC: diizzy, fernape, freebsd
Priority: --- Flags: bugzilla: maintainer-feedback? (freebsd)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch to fix build problem
none
Patch to updated existing patch none

Description Jaap Akkerhuis 2022-01-17 15:07:00 UTC
Created attachment 231076 [details]
patch to fix build problem

It seems that I cannot build dns/dnsjit anymore, it complains with

ld: error: undefined symbol: _send_tls
>>> referenced by dnscli.c
>>>               output/dnscli.o:(output_dnscli_send)

ld: error: undefined symbol: _send_tcp
>>> referenced by dnscli.c
>>>               output/dnscli.o:(output_dnscli_send)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [dnsjit] Error code 1

The attached patch fixes this but there is probably a better way
Comment 1 Daniel Engberg freebsd_committer freebsd_triage 2022-01-18 06:52:15 UTC
Yes, this seems to break on recent 13-STABLE (tested on amd64) and possibly 14 too.
Comment 2 Daniel Engberg freebsd_committer freebsd_triage 2022-01-18 06:55:08 UTC
Just for reference, it builds fine on 13-STABLE using GCC...
Comment 3 Jaap Akkerhuis 2022-01-19 12:52:54 UTC
(In reply to Daniel Engberg from comment #2)
Confirmed, it looks like a problem with the base compiler (clang).

Gooling around I found that the problem is also on arm64 (see https://www.mail-archive.com/freebsd-pkg-fallout@freebsd.org/msg1847923.html), so it seems clang needs fixing
Comment 4 commit-hook freebsd_committer freebsd_triage 2022-03-13 07:54:28 UTC
A commit in branch main references this bug:

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

commit b1fffcc63233affe26710b8bf62e4f4961621ab8
Author:     Jaap Akkerhuis <jaap@NLnetLabs.nl>
AuthorDate: 2022-03-13 07:38:29 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-03-13 07:53:54 +0000

    dns/dnsjit: Fix build issues on 13-STABLE and newer versions

    PR:             261274
    Approved by:    Leo Vandewoestijne <freebsd@dns.company> (maintainer timeout, 7+ weeks)

 dns/dnsjit/files/patch-src_output_dnscli.c (new) | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
Comment 5 Daniel Engberg freebsd_committer freebsd_triage 2022-03-13 07:57:13 UTC
Committed, sorry for the wait
Comment 6 Daniel Engberg freebsd_committer freebsd_triage 2022-03-13 08:04:52 UTC
Jaap, can you also please submit this fix upstream?
Comment 7 Jaap Akkerhuis 2022-03-16 13:24:12 UTC
(In reply to Daniel Engberg from comment #6)
I'll give t a try
Comment 8 Jaap Akkerhuis 2022-03-16 14:13:14 UTC
(In reply to Daniel Engberg from comment #5)
Something went wrong with the commit. The line PORTREVISON= 1 Seems to be missing from the Makefile.

See also the diff (https://bugs.freebsd.org/bugzilla/attachment.cgi?id=231076&action=diff) for the proper fix.
Comment 9 Jaap Akkerhuis 2022-03-16 14:26:43 UTC
(In reply to Jaap Akkerhuis from comment #7)
Reported to upstreams, see <https://github.com/DNS-OARC/dnsjit/issues/220>

I'm not the port maintainer, but it seems this needs some work
Comment 10 Daniel Engberg freebsd_committer freebsd_triage 2022-03-16 22:41:23 UTC
No need to bump PORTREVISION for build fixes
Comment 11 Jaap Akkerhuis 2022-03-17 14:59:10 UTC
Created attachment 232518 [details]
Patch to updated existing patch

Given the discussion at https://github.com/DNS-OARC/dnsjit/issues/220, here is a patch on top of the previous tap.

(Or one could edit the patch file by hand)
Comment 12 commit-hook freebsd_committer freebsd_triage 2022-03-18 08:05:55 UTC
A commit in branch main references this bug:

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

commit ed9bc952d8f28013344d69fa40b3a207c9bc2975
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2022-03-18 08:00:36 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-03-18 08:00:41 +0000

    dns/dnsjit: Switch to upstream's build fix

    Backport upstream commit 4346a4859b1ff21f74cc4ae7c79ba6af07a5774f to fix
    build with LLVM 12+

    PR:             261274
    Reported by:    Jaap Akkerhuis <jaap@NLnetLabs.nl>
    Approved by:    portmgr (blanket)

 dns/dnsjit/Makefile                               |  3 +++
 dns/dnsjit/distinfo                               |  4 +++-
 dns/dnsjit/files/patch-src_output_dnscli.c (gone) | 20 --------------------
 3 files changed, 6 insertions(+), 21 deletions(-)
Comment 13 Daniel Engberg freebsd_committer freebsd_triage 2022-03-18 08:06:38 UTC
Committed upstream fix, thanks for working with upstream on this one!