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

Use --export-dynamic linker flag rather than --export-all when we want to export everything #15413

Merged
merged 1 commit into from
Nov 3, 2021

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Nov 2, 2021

This means hidden symbols no longer get exported by default. The
only way to export a hidden symbol when building with MAIN_MODULE,
SIDE_MODULE or LINKABLE is to add it to the EXPORT_FUNCTIONS list.

This should be code side win for anyone building with MAIN_MODULE=1
or LINKABLE, and some folks building with SIDE_MODULE=1.

The primary motivator for this change is the musl upgrade where there
are new hidden symbols being introduced but we don't want them
exported when building with MAIN_MODULE=1.

@sbc100 sbc100 requested review from kripken and dschuff November 2, 2021 23:31
@sbc100 sbc100 force-pushed the export_dynamic branch 2 times, most recently from 64d413a to e72a2f7 Compare November 2, 2021 23:52
@sbc100 sbc100 changed the base branch from main to test_data_exports November 3, 2021 00:04
@sbc100 sbc100 force-pushed the export_dynamic branch 2 times, most recently from faab348 to d55638c Compare November 3, 2021 00:05
@sbc100 sbc100 changed the title Use --export-dynamic rather than --export-all when linking with MAIN_MODULE=1 Use --export-dynamic linker flag rather than --export-all when we want to export everything Nov 3, 2021
@sbc100 sbc100 force-pushed the test_data_exports branch from 735092d to a9c7c80 Compare November 3, 2021 01:54
@sbc100 sbc100 force-pushed the export_dynamic branch 2 times, most recently from 54ebb2a to 0276ff9 Compare November 3, 2021 16:12
Base automatically changed from test_data_exports to main November 3, 2021 17:09
@sbc100 sbc100 force-pushed the export_dynamic branch 2 times, most recently from a60c4c7 to bd6af72 Compare November 3, 2021 17:36
…AIN_MODULE=1

This means hidden symbols no longer get exported by default.  The
only way to export a hidden symbol when building with MAIN_MODULE,
SIDE_MODULE or LINKABLE is to add it to the EXPORT_FUNCTIONS list.

Also, update the `test_dlfcn_self` test which check the number of data
exports to be precise.  This means it will need updating anytime libc or
some other core library adds or removes a data exports, but that seems
like something we should be tracking here anyway.
@sbc100
Copy link
Collaborator Author

sbc100 commented Nov 3, 2021

PTAL, I'd like to land this before #13006 since it hides the musl-internal hidden symbols.

Copy link
Member

@dschuff dschuff left a comment

Choose a reason for hiding this comment

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

LGTM this sounds like a good idea.

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