-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
add option to dlopen with RTLD_GLOBAL (fixes issue #2312) #2317
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
Conversation
I'm gonna let @JeffBezanson sign off on this one, but this looks good to me. Nice addition. |
I went ahead and renamed the new functionality to |
Another option: |
Actually preferred the second Boolean argument |
@StefanKarpinski, this is from the person who wanted The reason I switched it was that when I looked at my own code, |
Well, different norms are different functions. This does the same thing a slightly different way... |
@StefanKarpinski, to nitpick, I would say that But is this really the basis on which to decide such an issue, as opposed to e.g. code readability? (Or maintenance concerns, etcetera?) |
|
On linux. POSIX only defines 4. Pedantic achievement unlocked! |
@pao, note that three of those 7 flags are Linux-only, and the remaining two are two pairs of opposites, so POSIX actually only gives two bits (two booleans) worth of choices. The other choice is (And then there is the question of Windows, which makes it especially iffy to think about exposing lots of |
This is my favorite comment in a long time. Laughed out loud. |
By the way, another reason to use a different symbol is that this way I can use (Or is there a similarly easy way to check whether a 2-argument version of a function is available?) |
|
Well, I've said my piece. When it comes down to it, I don't really care that much what the interface is, as long as the functionality is there. Say the word and I will revert the patch to |
Jeff's call |
Haha, fair enough. I agree that most of those are probably useless to us, or are indeed Linux-specific, but something about |
Both the bool argument and |
Another option (get it) is to actually use integer flags. Easier to read but still just an extra argument. |
There is something to be said for using |
@JeffBezanson, the downside to using Regarding |
Just rebased the patch. Any additional thoughts? |
Small note: opening with |
@JeffBezanson, can I go ahead and merge or do you want a different spelling? |
In this patch, Julia's
dlopen
now hasan optional boolean second argumenta variantdlopen_global
, which loads the shared library globally if possible (so that its symbols are available to any subsequently loaded shared library), needed to fix #2312.Alternatively, instead of the optional second argument I could just rename that version toUpdate: I renamed it this way below.dlopen_global
. Let me know what you prefer.Works on Linux (and should work on other POSIX systems). It's not clear if Windows supports or needs this option; the flag currently does nothing on Windows.