Skip to content

BLD: Force all internal extension symbols to be hidden - #32209

Open
QuLogic wants to merge 1 commit into
matplotlib:mainfrom
QuLogic:hidden-symbols
Open

BLD: Force all internal extension symbols to be hidden#32209
QuLogic wants to merge 1 commit into
matplotlib:mainfrom
QuLogic:hidden-symbols

Conversation

@QuLogic

@QuLogic QuLogic commented Aug 14, 2026

Copy link
Copy Markdown
Member

PR summary

Even though Meson defaults to hidden visibility, our bundled libraries like FreeType may themselves export their own symbols individually. So force all symbols other than the Python module initialization function to be hidden with a linker version script.

By making symbols like FT_Init_Freetype local, it ensures that they cannot be resolved by other global versions, such as a system copy loaded beforehand. It also allows the linker to discard more sections for unused code, saving us approximately 6.6% in shared library space.

Fixes #32208

AI Disclosure

None

PR quality check

  • Use an expressive title, e.g. "Fix title font property precedence"
  • New and changed code is tested
  • [n/a] Plotting related features are demonstrated in an example
  • [n/a] New features and API changes have release notes
  • [n/a] Documentation complies with general and docstring guidelines

Even though Meson defaults to hidden visibility, our bundled libraries
like FreeType may themselves export their own symbols individually. So
force all symbols other than the Python module initialization function
to be hidden with a linker version script.

By making symbols like `FT_Init_Freetype` local, it ensures that they
cannot be resolved by other global versions, such as a system copy
loaded beforehand. It also allows the linker to discard more sections
for unused code, saving us approximately 6.6% in shared library space.
@QuLogic QuLogic added this to the v3.11.2 milestone Aug 14, 2026
@QuLogic QuLogic added the CI: Run cibuildwheel Run wheel building tests on a PR label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI: Run cibuildwheel Run wheel building tests on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Wheel's freetype binding can conflict with system library

1 participant