-
Notifications
You must be signed in to change notification settings - Fork 14
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
ld: support -dynamic_lookup_library #1
base: master
Are you sure you want to change the base?
Conversation
@@ -4575,6 +4575,10 @@ int OutputFile::compressedOrdinalForAtom(const ld::Atom* target) | |||
// regular ordinal | |||
const ld::dylib::File* dylib = dynamic_cast<const ld::dylib::File*>(target->file()); | |||
if ( dylib != NULL ) { | |||
// Handle -dynamic_lookup_library | |||
if ( dylib->forcedDynamicLookupLinked() ) | |||
return BIND_SPECIAL_DYLIB_FLAT_LOOKUP; |
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.
There is also BIND_SPECIAL_DYLIB_MAIN_EXECUTABLE
. However, I suspect this is more geared towards the case where the symbols are actually in the main executable which is not the case for the libpython
use case.
@Bigcheese Bruno and I talked about this in Kona 2019, but I can't seem to find his GitHub handle. |
e7f03bb
to
6c0052c
Compare
ebc627b
to
c754c2b
Compare
I don't think Apple pays attention to github pull requests, so I filed FB10995337 in their bugtracker. |
This causes all symbols found in the specified library to be looked up at load time. The library itself is not linked by the output library at all. The main use case for this is creating compiled modules for dynamic languages (e.g., Ruby or Python) where the application loading the module provides the interpreter's symbols. This allows the compiled module to be agnostic to the installation of the interpreter. That is, it can link against the Apple-provided Python, but be run with an Anaconda-provided interpreter.
c754c2b
to
659e8e8
Compare
Updated to actually compile based on testing within the |
This causes all symbols found in the specified library to be looked up
at load time. The library itself is not linked by the output library at
all.
The main use case for this is creating compiled modules for dynamic
languages (e.g., Ruby or Python) where the application loading the
module provides the interpreter's symbols. This allows the compiled
module to be agnostic to the installation of the interpreter. That is,
it can link against the Apple-provided Python, but be run with an
Anaconda-provided interpreter.