Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use generated linker script when build Kafka client library #38157

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

krinkinmu
Copy link
Contributor

@krinkinmu krinkinmu commented Jan 23, 2025

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

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#4862). Since LLVM
version 17 it results in a link failure.

There is a fix upstream for this, but the PR fixing the issue has been
out since Octoiber 2024 and didn't get any attention and I couldn't get
the maintainer 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.

Signed-off-by: Mikhail Krinkin <[email protected]>
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #38157 was opened by krinkinmu.

see: more, trace.

@krinkinmu krinkinmu marked this pull request as ready for review January 23, 2025 11:34
Copy link
Member

@phlax phlax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks @krinkinmu

@phlax phlax merged commit 55bbbb1 into envoyproxy:main Jan 23, 2025
24 checks passed
bazmurphy pushed a commit to bazmurphy/envoy that referenced this pull request Jan 29, 2025
…voyproxy#38157)

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.

related to work in envoyproxy#37911 

Signed-off-by: Mikhail Krinkin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants