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

explore whether -load_hidden will work around flat namespace #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

flavorjones
Copy link

demonstrating that we can use -load_hidden to work around -flat_namespace

@stevecheckoway
Copy link
Owner

Another idea is to link the extension with -Wl,-no_exported_symbols,-exported_symbol,init which should cause the extension to only have a single defined symbol, init. (In Nokogiri's case, that would be Init_nokogiri.) But as you noted, this is going to break anything that assumes Nokogiri will define the libxml2 symbols.

@flavorjones
Copy link
Author

Yes, I think long-term the right thing to do with Nokogiri is to make an API decision on whether libxml2/libxslt/gumbo symbols are exported, write some tests to make sure we're exporting only what we want, and then figure out what combination of options (is it --exported-symbols-list, is it -no_exported_symbols,-exported_symbol,Init_nokogiri, etc.) is best to implement visibility.

@stevecheckoway
Copy link
Owner

That sounds like exactly the right decision.

@flavorjones
Copy link
Author

See sparklemotion/nokogiri#2746

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