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

darwin: work around the Ruby 3.2 symbol resolution changes #94

Merged
merged 2 commits into from
Jan 4, 2023

Conversation

flavorjones
Copy link
Collaborator

@flavorjones flavorjones commented Jan 2, 2023

Summary

This PR introduces the -Wl,-flat_namespace linker flag into the Darwin Ruby 3.2 build environments.

Context

See lengthy conversations at these issues for context

After building RCs of precompiled gems for both nokogiri and sqlite3, I found that I needed to add this flag in order for the extension to be able to resolve basic symbols like rb_cObject when running against a version of Ruby compiled with the --enable-shared config flag.

I cannot imagine any scenario where someone would be precompiling a Ruby 3.2 Darwin bundle and not want this flag on given the current state of the universe.

Details

@flavorjones flavorjones marked this pull request as ready for review January 2, 2023 21:46
@flavorjones
Copy link
Collaborator Author

flavorjones commented Jan 3, 2023

@larskanis I've also tested this with the sqlite3-ruby gem and it works. I think we should merge this, do you have any feedback on it?

Copy link
Member

@larskanis larskanis left a comment

Choose a reason for hiding this comment

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

Looks good! I don't have a better idea.

@flavorjones flavorjones merged commit ce619f2 into master Jan 4, 2023
@flavorjones flavorjones deleted the flavorjones-ruby-3.2-darwin-dldflags branch January 4, 2023 20:34
flavorjones added a commit to sparklemotion/sqlite3-ruby that referenced this pull request Jan 4, 2023
This works around new Darwin Ruby 3.2 symbol resolution issues, but
also follows best practices around shipping shared libraries.

Note that we remove the `-flat_namespace` hack because the latest
rake-compiler-docker images have the changes from
rake-compiler/rake-compiler-dock#94
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.

None yet

2 participants