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

[DocDB] Fix linker flags to detect undefined symbols during build rather than in runtime #16412

Closed
1 task done
ttyusupov opened this issue Mar 13, 2023 · 0 comments
Closed
1 task done
Assignees
Labels
area/docdb YugabyteDB core features kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@ttyusupov
Copy link
Contributor

ttyusupov commented Mar 13, 2023

Jira Link: DB-5823

Description

Commit ac72f22 removed linker flags -Wl,--no-undefined and -Wl,--no-allow-shlib-undefined because some of the shared libraries we build rely e.g. on tcmalloc hooks, which
will be only provided at runtime, but not at linking time of the shared library.
As a side effect that change made it impossible for linked to catch undefined symbols and when some symbol is undefined, we only will get failure in runtime.

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@ttyusupov ttyusupov added area/docdb YugabyteDB core features status/awaiting-triage Issue awaiting triage labels Mar 13, 2023
@ttyusupov ttyusupov self-assigned this Mar 13, 2023
@ttyusupov ttyusupov added this to Backlog in YBase features via automation Mar 13, 2023
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue kind/enhancement This is an enhancement of an existing feature and removed status/awaiting-triage Issue awaiting triage kind/bug This issue is a bug labels Mar 13, 2023
ttyusupov added a commit that referenced this issue Mar 14, 2023
… build rather than in runtime

Summary:
Commit ac72f22 removed linker flags `-Wl,--no-undefined` and `-Wl,--no-allow-shlib-undefined` because some of the shared libraries we build rely e.g. on tcmalloc hooks, which will be only provided at runtime, but not at linking time of the shared library.
As a side effect that change made it impossible for linker to catch undefined symbols and when some symbol is undefined, we only will get failure in runtime.

This revision adds back these linker flags only for executable files, so liker can still catch undefined symbols during build phase, but allow libraries to be linked without errors.

Other changes:
- Split `common/wire_protocol.*` into `common/wire_protocol.*` (common lib) and `common/ql_wire_protocol.*` (ql_common lib) to clean up dependencies and fix some tests and tools linker errors that haven't been caught due to removed flags.
- Added missing `YbgStatusCreateError` to `src/postgres/src/backend/exports-common.txt`

Test Plan: Jenkins

Reviewers: mihnea, smishra, mbautin

Reviewed By: mbautin

Subscribers: ybase, bogdan

Differential Revision: https://phabricator.dev.yugabyte.com/D23480
YBase features automation moved this from Backlog to Done Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
Development

No branches or pull requests

2 participants