-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Read exports from side modules at link time #13915
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
14bcbdf to
ab85af3
Compare
8817d7f to
ee6d97a
Compare
62db801 to
a6bfc13
Compare
dschuff
left a comment
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.
Can you also update the documentation? Once this works (is that with this PR?) we should document it as the primary way to create dynamic libraries (btw does this mean we don't need the MAIN_MODULE and SIDE_MODULE flags anymore?)
a6bfc13 to
4c3840d
Compare
Not yet but that would be really really cool.. lets do it!
|
4c3840d to
29d987f
Compare
This means we can reason about the symbols which are or are not defined across the entire program which allows for ERROR_ON_UNDEFINED_SYMBOLS to be enabled for any build that includes all its side modules on the command line.
29d987f to
cded507
Compare
|
Added a ChangeLog entry. |
I wonder what the least "surprising" way to do MAIN_MODULE is. on other platforms, dynamic executables are the default, but not for wasm. If someone or their build system is including libs on the command line that we are ignoring now, I guess someone could accidentally end up with a dynamic executable? I guess that doesn't seem too likely though, since they would also have to be using SIDE_MODULE. |
Actually on linux (gcc/clang, etc) the behaviour is "make a static executable unless there is one ore more dynamic libraries in the link, in which case make a dynamic executable". You don't actually need So I guess I'm proposing that we match this behaviour.. that major difference being that we don't provide any shared libraries for system libs.. so most users will end up with static by default. |
|
This was surprising to me actually: Here we see the compiler defaulting to static linking (without any |
|
OK, you got me there :D |
|
BTW, I think that your proposal will probably be fine. But we should make sure that CMake is doing something reasonable in the default cases, and maybe it would be good to have some easy way for a user to tell whether an executable is dynamic, to help them (and us) diagnose problems when things go wrong. |
This means we can reason about the symbols which are or are not defined across
the entire program which allows for
ERROR_ON_UNDEFINED_SYMBOLSto beenabled for any build that includes all its side modules on the command line.