Enable real dynamic linking with -shared by default#25930
Conversation
655b473 to
e01726b
Compare
6e4f78f to
3b0addc
Compare
3b9f050 to
d2bc4e4
Compare
dbf81cc to
2a061bd
Compare
d43b884 to
19b4b57
Compare
I actually ended up leaving the cmake |
|
OK, I think this change is in pretty good shape now |
-shared by default
kripken
left a comment
There was a problem hiding this comment.
Can you explain the motivation more? It doesn't look like this removes a bunch of code or simplifies anything significantly. Do you just think this is a more sensible default? (If so, I wonder how we measure that against the annoyance of a breaking change for our users.)
This change essentially disables `FAKE_DYLIBS` by default, which in turn means `-shared` will now produce dynamic libraries by default. If you want the old behaviour you now need `-sFAKE_DYLIBS`.
You would right that this change intentionally doesn't really simplify the code internally or remove much complexity. All it does it change a default, but we are continuing to support the old way for some period of time. The hope is that is if The motivation is indeed to have more sensible default and mimic native toolchains more. i.e. we should be able to use My guess is that very very few folks rely on these fake side modules. We have, after all, had a warning in place for any users of this feature for a long time now: The main reason these fake side modules were invented was to allow folks to build projects that included shared libraries and had no option to disable them. i.e. no |
|
(I actually worked very hard to make sure this change was as small as possible.. i.e. mostly just flipping a boolean setting, and not really changing anything else. In fact this change is the whole reason I introduced the new |
|
Given that we have a sensible behavior for dynamic linking, I think that having the |
In particular, mention the `FAKE_DYLIBS` setting. This is important especially since we are about the change the default behavior. See emscripten-core#25930
Good idea. I started by updated the docs here: #26976. I can then include another update with this PR when it lands. |
In particular, mention the `FAKE_DYLIBS` setting. This is important especially since we are about the change the default behavior. See emscripten-core#25930
In particular, mention the `FAKE_DYLIBS` setting. This is important especially since we are about the change the default behavior. See emscripten-core#25930
This change essentially disables
FAKE_DYLIBSby default, which inturn means
-sharedwill now produce dynamic libraries by default.If you want the old behaviour you now need
-sFAKE_DYLIBS.For cmake builds we still don't set
TARGET_SUPPORTS_SHARED_LIBS.That will likely be a followup once we deal with https://gitlab.kitware.com/cmake/cmake/-/work_items/27240