December 02, 2022 [Issue 22367] Modules compiled with -betterC never generate a ModuleInfo | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22367 --- Comment #16 from Walter Bright <bugzilla@digitalmars.com> --- Better than turning on/off the ModuleInfo generation, it is better to do or not do the triggers that cause the ModuleInfo to be generated. For example, if a static constructor is written, and the ModuleInfo is suppressed, the program will link but the static constructor will never be run, causing the resulting program to not behave as expected. -- |
December 02, 2022 [Issue 22367] Modules compiled with -betterC never generate a ModuleInfo | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22367 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|dll, pull | -- |
December 02, 2022 [Issue 22367] Modules compiled with -betterC never generate a ModuleInfo | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22367 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://issues.dlang.org/sh | |ow_bug.cgi?id=23535 -- |
December 06, 2022 [Issue 22367] Modules compiled with -betterC never generate a ModuleInfo | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22367 --- Comment #17 from Walter Bright <bugzilla@digitalmars.com> --- I looked further into this. Essentially, betterC code cannot generate ModuleInfo, because ModuleInfo also generates a call to _d_so_registry in druntime. Having a `static this` in a betterC module, or a betterC module importing a module with a `static this`, requires a ModuleInfo to guarantee the semantics. Simply turning off ModuleInfo generation will get the program to link, but will leave the static this code un-run, i.e. the code will not work. Instead, betterC code must use pragma(crt_constructor) functions instead to perform static initializations. These functions will be called by the C runtime startup code. To reply on pragma(crt_constructor) means fixing the reported problems with them, and making sure they are correctly defined. To that end is: https://github.com/dlang/dmd/pull/14669 which is to be followed by going through druntime to replace `static this` with `pragma(crt_constructor)` wherever possible, such as with: https://github.com/dlang/dmd/pull/14671 -- |
December 13 [Issue 22367] Modules compiled with -betterC never generate a ModuleInfo | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=22367 --- Comment #18 from dlangBugzillaToGithub <robert.schadek@posteo.de> --- THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19990 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB -- |
Copyright © 1999-2021 by the D Language Foundation