C: Compile with -fvisibility=hidden flag#906
Merged
Merged
Conversation
83329dc to
6e4d5be
Compare
b7bd0d9 to
64dd9f9
Compare
64dd9f9 to
6a1084a
Compare
marcoroth
added a commit
that referenced
this pull request
Nov 30, 2025
Follow Prism's pattern for controlling symbol visibility when building shared libraries. The public API in `herb.h/herb.c` is marked with `HERB_EXPORTED_FUNCTION`, which exports symbols when `HERB_EXPORT_SYMBOLS` is defined. For the Ruby extension, only `Init_herb` is exported, all other symbols (including prism's `pm_*` functions) remain hidden, to prevent future symbol conflicts with other libraries available on the system. Follow up on #906
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR starts compiling the ruby herb gem c dependencies with
-fvisibility=hidden.This addresses a criticial bug that lead to crashes when the ruby gem ran in an environment that already had harfbuzz loaded. Both define a function called
hb_buffer_append, which resulted in conflicts.With this fix we only expose the init function required by the ruby runtime in the DLL/SO.
This PR addresses the issues reported in #905
Before
After