-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
Emit ModuleInfo stubs for -betterC shared libraries #3996
Comments
|
Is it possible that my usage of Specifically[0] causes the sidero.base.allocators.gc to be added by the executable (and not used anywhere else). [0] https://github.com/Project-Sidero/basic_memory/blob/main/source/sidero/base/allocators/gc_hook.d |
Nope, but some directly or indirectly imported module with a module ctor/dtor. E.g. (IIRC):
This is needed for druntime to establish the module ctor invocation order at startup. These link-time errors are currently the only protection for worseD code depending on modules with module ctors (which of course aren't run without druntime). What's your 'excuse' for the |
None of these apply. It's a leaf module, nothing imports it, when commented out (constructor + destructor) the reference to Context: I'm trying to build up to a full GUI toolkit, and that means things like IDE form editor ext. So I want to be able to mix compilers and compiler versions with its shared libraries in the plugin architecture. With the druntime, it just adds to the mix of things that can go wrong. At least by starting with -betterC, there is a chance that this isn't just a fever dream. |
Maybe read again? - This |
|
It, unfortunately, didn't show it: I described it as a leaf because apart from the crt_constructor/destructor it should never be referenced by anything, certainly not by import in D. There shouldn't be any module constructors of any kind being in use here. However, this doesn't really help me much, even if this one was fixed (as I narrowed it down, so I know which module is doing it), the other two are much more widely used and almost certainly are going to be hit by the random user. https://github.com/Project-Sidero/basic_memory/blob/main/source/sidero/base/allocators/gc.d |
|
Okay bit more chatting on Discord, and yeah it's looking like it's due to imports requiring it, not constructor/destructor. So a stub would still need
|
|
GDC has |
Target: Windows 64bit
Compiler: 1.30-beta1
Scenario:
Shared library built with -betterC (may have static library dependencies), no ModuleInfo.
Full D executable, depends on shared library.
Result:
I managed to work around this by generating ModuleInfo stubs in the shared library via:
For -betterC code, it would be very nice to be able to tune ModuleInfo emittance (including emitting of stubs).
Note: this does pass my test suite, so yay :D
The text was updated successfully, but these errors were encountered: