Bug 275866 - net/librdkafka: Build fails, link error 'rd_ut_coverage_check' failed: symbol not defined
Summary: net/librdkafka: Build fails, link error 'rd_ut_coverage_check' failed: symbol...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Luca Pizzamiglio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-12-21 05:42 UTC by robbak
Modified: 2024-11-01 17:49 UTC (History)
4 users (show)

See Also:
pizzamig: maintainer-feedback+


Attachments
Patch to remove errant symbol (367 bytes, patch)
2023-12-21 05:42 UTC, robbak
no flags Details | Diff
Build Script (70.37 KB, text/plain)
2023-12-21 05:43 UTC, robbak
no flags Details
net/librdkafka: work around undefined version symbol error (1.08 KB, patch)
2024-09-10 08:06 UTC, Dimitry Andric
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description robbak 2023-12-21 05:42:13 UTC
Created attachment 247181 [details]
Patch to remove errant symbol

Build fails on my system. To me, it looks like the system has accidentally included something from the unit test system.

The build worked for me after removing the reference to this symbol in the lds-gen.py script. Dependent ports built too, but I don't know enough about the services this port provides to test functionality.

Build script and patch attached.
Comment 1 robbak 2023-12-21 05:43:25 UTC
Created attachment 247182 [details]
Build Script
Comment 2 Luca Pizzamiglio freebsd_committer freebsd_triage 2023-12-27 15:22:02 UTC
Hi! Thanks for reporting.

In poudriere, the build succeed as there is no python3, and the python script is not used.
Locally, I've built the librdkafka with python3 to replicate your error, but error message is only a warning, so I can successfully build it.

Are you enabling -Werror maybe?

The offending symbol doesn't seem accidentally but explicitly included by the python script, so I'm not inclined in removing it.

What do yo think?
Comment 3 robbak 2023-12-28 04:34:53 UTC
Thanks. No, I'm not (knowingly) using -Werror. Nothing in my make.conf that could conceivably cause that. And it clearly states it as an error, not a warning.

Based on the info you gave me, I got it to build by defining "WITH_LDS=n" in the make args. Interesting to know how the build changes when it uses, or doesn't use, this script.

--- a/net/librdkafka/Makefile
+++ b/net/librdkafka/Makefile
@@ -25,7 +25,7 @@ USE_GITHUB=   yes
 GH_ACCOUNT=    edenhill
 
 GNU_CONFIGURE= yes
-MAKE_ARGS=     pkgconfigdir=${PREFIX}/libdata/pkgconfig
+MAKE_ARGS=     pkgconfigdir=${PREFIX}/libdata/pkgconfig WITH_LDS=n
 CONFIGURE_ARGS+=       --disable-sasl \
                                        --enable-ssl \
                                        --enable-strip
Comment 4 chadf 2024-08-13 21:51:25 UTC
I just got this error trying to build it. Has this been resolved yet?

Based on a web search, it may also be an issue only with llvm17+. When I added in CC=clang15 (which happened to already be on my system) it also built without errors.
Comment 5 Dimitry Andric freebsd_committer freebsd_triage 2024-09-10 08:06:52 UTC
Created attachment 253476 [details]
net/librdkafka: work around undefined version symbol error

I'm seeing this too when doing a non-poudriere build. I guess it is easiest to add -Wl,--undefined-version to LDFLAGS.
Comment 6 nrn 2024-10-06 01:22:23 UTC
The patch in this pull request - https://github.com/confluentinc/librdkafka/pull/4862 - also fixes the problem for me in FreeBSD 14.1-RELEASE-p5.
Comment 7 commit-hook freebsd_committer freebsd_triage 2024-11-01 17:48:25 UTC
A commit in branch main references this bug:

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

commit 148d4c8dd90e2fbd7d4ed05eabf06f647790b395
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-09-10 08:04:03 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-11-01 17:47:13 +0000

    net/librdkafka: work around undefined version symbol error

    When building outside of poudriere, net/librdkafka can fail to link,
    with an error similar to:

      ld: error: version script assignment of 'global' to symbol 'rd_ut_coverage_check' failed: symbol not defined

    Work around this by adding -Wl,--undefined-version to LDFLAGS.

    While here, pet portlint.

    PR:             275866
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2024Q4

 net/librdkafka/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Comment 8 commit-hook freebsd_committer freebsd_triage 2024-11-01 17:49:27 UTC
A commit in branch 2024Q4 references this bug:

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

commit 27efb93a3b82722272a9af4458bc41a56d4386a5
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-09-10 08:04:03 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-11-01 17:48:16 +0000

    net/librdkafka: work around undefined version symbol error

    When building outside of poudriere, net/librdkafka can fail to link,
    with an error similar to:

      ld: error: version script assignment of 'global' to symbol 'rd_ut_coverage_check' failed: symbol not defined

    Work around this by adding -Wl,--undefined-version to LDFLAGS.

    While here, pet portlint.

    PR:             275866
    Approved by:    maintainer timeout (2 weeks)
    MFH:            2024Q4

    (cherry picked from commit 148d4c8dd90e2fbd7d4ed05eabf06f647790b395)

 net/librdkafka/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)