Bug 275979 - security/heimdal: fails to build in poudriere CURRENT jail but builds in 14.0-stable jail
Summary: security/heimdal: fails to build in poudriere CURRENT jail but builds in 14.0...
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Cy Schubert
URL:
Keywords:
: 276542 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-28 09:08 UTC by rdunkle
Modified: 2024-03-20 22:20 UTC (History)
7 users (show)

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


Attachments
failure log from current jail (157.87 KB, text/plain)
2023-12-28 09:09 UTC, rdunkle
no flags Details
success in 14.0-stable jail (105.78 KB, application/x-zip-compressed)
2023-12-28 09:15 UTC, rdunkle
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description rdunkle 2023-12-28 09:08:07 UTC
fails to build in poudriere CURRENT jail but builds in 14.0-stable jail.  There is a problem with number of errors in ld regarding HEIMDAL_ROKEN_1.0.
ld: error: version script assignment of 'HEIMDAL_ROKEN_1.0' to symbol 'rk_freehostent' failed: symbol not defined
ld: error: version script assignment of 'HEIMDAL_ROKEN_1.0' to symbol 'rk_freeifaddrs' failed: symbol not defined
ld: error: version script assignment of 'HEIMDAL_ROKEN_1.0' to symbol 'rk_gai_strerror' failed: symbol not defined
ld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1
Comment 1 rdunkle 2023-12-28 09:09:15 UTC
Created attachment 247311 [details]
failure log from current jail
Comment 2 rdunkle 2023-12-28 09:15:24 UTC
Created attachment 247312 [details]
success in 14.0-stable jail
Comment 3 Mina Galić freebsd_triage 2023-12-28 12:15:43 UTC
adding cy@ to cc, who maintains heimdal in base, and might have some insights
Comment 4 John Kennedy 2024-01-01 21:12:14 UTC
This doesn't just affect only you.  It compiles just fine in my 14-stable and 14.0-RELEASE-p4 systems, but not on my 15-current bhyve VM (seeded from 20231228 disk1.iso, but recompiled with today's patches (main-n267336-09af4bf2c98; amd64).
Comment 5 rdunkle 2024-01-03 06:58:57 UTC
I see the same error on the FreeBSD Poudriere machine beefy18.nyi.freebsd.org.
http://beefy18.nyi.freebsd.org/data/main-amd64-default/pf47e590a6da8_sc3268c23de/logs/errors/heimdal-7.8.0_6.log
Comment 6 Cy Schubert freebsd_committer freebsd_triage 2024-01-03 23:13:21 UTC
The workaround I put in place for security/heimdal-devel a while ago was to use LLVM_DEFAULT. Probably not a long term solution but certainly a stopgap until it can be permanently fixed.
Comment 7 rdunkle 2024-01-04 08:16:50 UTC
I changed the make.conf to this:
DEFAULT_VERSIONS+= llvm=15 dbd=18 ssl=openssl31 perl5=5.36

Is this correct?  The llvm version does not appear to change the build error.
Comment 8 rdunkle 2024-01-10 07:46:21 UTC
I found a fix for this problem in the email this morning:
https://lists.freebsd.org/archives/freebsd-stable/2024-January/001850.html

The preferred way is fixing the port by removing the undefined symbols
from the linker version script in the port, but if that is not possible
or difficult, add -Wl,--undefined-version to the linker flags suppresses
the error. E.g. in the port Makefile:

LDFLAGS+=	-Wl,--undefined-version

This is working for me.
Comment 9 Lars Wittebrood 2024-03-14 19:34:58 UTC
Just upgraded my Poudriere server to 13.3-RELEASE (from 13.2). The same happens here as well. So this is also applicable to 13.3-RELEASE.
Comment 10 Lars Wittebrood 2024-03-14 19:45:53 UTC
Adding

LDFLAGS+=	-Wl,--undefined-version

to the Makefile on 13.3-RELEASE also makes the port succesfully build (on my Poudriere server)
Comment 11 Cy Schubert freebsd_committer freebsd_triage 2024-03-14 21:37:27 UTC
The reason is that certain functions, provided by FreeBSD, are not built by heimdal. But heimdal still provides a version.map file with them. I have a patch here which should fix this. Testing in a jail ATM.
Comment 12 Cy Schubert freebsd_committer freebsd_triage 2024-03-14 21:57:55 UTC
(In reply to rdunkle from comment #8)

Removing the symbols from the version script may not scale all that well because different FreeBSD versions may potentially implement others that previous versions of FreeBSD do not.

The other problem is that not all symbols are reported first time through. When the first batch are removed a second set are reported. I haven't tried a third go around. I don't think it's worth the effort considering the possibility discussed in the previous paragraph.
Comment 13 Cy Schubert freebsd_committer freebsd_triage 2024-03-14 21:59:00 UTC
I'll take this.
Comment 14 commit-hook freebsd_committer freebsd_triage 2024-03-14 22:13:42 UTC
A commit in branch main references this bug:

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

commit 64f7f98bb61947a72001a84f06840c374b26628d
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2024-03-14 21:54:29 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2024-03-14 22:08:38 +0000

    security/heimdal: Fix build

    Fix build due to many undefined symbols listed in version.map. The
    problem is that the listed functions are conditionally built and since
    they exist in FreeBSD they are not built but they are still referenced
    in version.map.

    PR:             275979
    MFH:            2024Q1
    Approved by:    portmgr (just fix it)

 security/heimdal/Makefile | 1 +
 1 file changed, 1 insertion(+)
Comment 15 commit-hook freebsd_committer freebsd_triage 2024-03-15 00:27:55 UTC
A commit in branch 2024Q1 references this bug:

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

commit 41d59911159e830876ddc60d90d3d4bdc16b9cb6
Author:     Cy Schubert <cy@FreeBSD.org>
AuthorDate: 2024-03-14 21:54:29 +0000
Commit:     Cy Schubert <cy@FreeBSD.org>
CommitDate: 2024-03-15 00:26:46 +0000

    security/heimdal: Fix build

    Fix build due to many undefined symbols listed in version.map. The
    problem is that the listed functions are conditionally built and since
    they exist in FreeBSD they are not built but they are still referenced
    in version.map.

    PR:             275979
    Approved by:    portmgr (just fix it)

    (cherry picked from commit 64f7f98bb61947a72001a84f06840c374b26628d)

 security/heimdal/Makefile | 1 +
 1 file changed, 1 insertion(+)
Comment 16 Dimitry Andric freebsd_committer freebsd_triage 2024-03-20 22:20:38 UTC
*** Bug 276542 has been marked as a duplicate of this bug. ***