Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
darwin: resolve rb symbols from ext by
-flat_namespace
to see libru…
…by transitively This repairs the assumption, which many fat-gem maintainer expect, "An extension built with --disable-shared Ruby is loadable from --enable-shared Ruby". By default all references resolved to a dynamic library use "two-level namespace", which record the library name and symbol name for each resolution entry. On the other hand, `-flat_namespace` discards the library name information and resolves symbols "flatly". This behavior is useful for us to ignore which image (`ruby` executable or `libruby.dylib`) provides rb symbols at runtime.
- Loading branch information
c5eefb7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @kateinoigakukun for this great explanation!
c5eefb7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making this change! I'll run it through the rake-compiler-dock test suite.
c5eefb7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unfortunately not working very well. See @stevecheckoway's example at https://github.com/stevecheckoway/bundle_test for a demonstration of how symbols in statically-linked archives are not resolving properly.