Don't use generated linker script when build Kafka client library #38157
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Commit Message:
The linker script generator that comes with the library is not quite correct and as a result sometimes generates symbols that are not exported by the library (see
confluentinc/librdkafka#4593). Since LLVM version 17 it results in a link failure.
There is a fix sent upstream for this, but the PR fixing the issue has been out since October 2024 and didn't get any attention and I couldn't get maintainers of the library to look at the PR or the related bug either. So for now, I'm just disabling the use of linker script when building Kafka client library all together to work around the issue on our side.
I couldn't find the rationale for using custom linker script in the first place, but from what I can see in the upstream repo the linker script that they generate and use is a version script. And looking at the docs (see
https://www.gnu.org/software/gnulib/manual/html_node/LD-Version-Scripts.html) it looks like this script only really matters when building a shared library.
If I'm correct, then we don't really care about this, as we build and link Envoy statically with the Kafka client library anyways. At the very least I didn't notice any issues because of this change in my tests.
Additional Description: related to work in #37911
Risk Level: low
Testing: builds + regular release gating tests
Docs Changes: n/a
Release Notes: n/a
Platform Specific Features: n/a
+cc @phlax