-
-
Notifications
You must be signed in to change notification settings - Fork 756
Keep shared libraries from calling main program's startup/cleanup procs on Linux #5173
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
Keep shared libraries from calling main program's startup/cleanup procs on Linux #5173
Conversation
That it's practically a one-liner is encouraging. |
Please if you could, make sure to test that this doesn't break anything on Windows as a result. I chose |
With this patch applied, I get the following. Windows:
Linux:
I don't know why, but on Linux it consistently prints |
Interesting. I just noticed the order is actually different too as you pointed out, so it's technically not mirroring Windows. I would consider this a bug in its own right, as I can imagine people may need to rely on certain linking order behaviors in the future, especially if |
That may be down to the difference between msvc and clang's linkers, who knows. Would have to be looked into. Other than that the fix looks fine to me, but let's let Bill take a gander first. |
Looks similar to a patch I did recently that was having the same symptoms with other procs and globals being used from other modules: 1053ec3 Weird that doesn't apply it to these procs too. |
It looks like the startup/cleanup procs are never seen by either It looks like they are getting skipped on Is this possibly where another check for it should be? |
4d2b6e0
to
713360a
Compare
I updated the patch to use the same visibility/linkage as |
Fixes #5169
I've tested this and it works on my machine. I'm not sure if it needs to be done for any other procs, or if this is the ideal way to do it, but if not, hopefully it helps expand the understanding on the issue.