This reduces the size of a statically linked Phobos-based
Hello World by 11 kB on Linux x86_64.
Also creates a header file for gen/module.cpp, which has been
renamed to "modules" such as not to conflict with the frontend
header file.
We had switched to a somewhat simplified implementation Martin
came up with for DMD based on our old one. Unfortunately, that
turned out not to work for certain ld.bfd versions on Linux
(e.g. 2.26.0.20160501), where the .bss section from other shared
objects would be picked up instead.
This reverts commit 08ad4fddb5.
GitHub: Fixes#1534.
Also adds the CMake infrastructure to compile and link the D source files.
The build is partially broken:
- A few files in Phobos and druntime do not build
- MSVC build is broken because of unresolved symbols involving reals
This PR replaces the few uses of global.params.is<OS> with
global.params.targetTriple.isOS<OS>(). This avoids adding a new
boolean for each supported OS.
It also defines all xBSD-type OS as using the dso-registry.
In case of a singleobj build and a provided output file (.exe or .obj).
The dmd-testsuite tests used to produce lots of .o files while expecting
.obj ones as specified in the command line.