(Changes since 1.27.0-beta1 are marked with (new).)
Big news
- Frontend, druntime and Phobos are at version 2.097.0+. (#3741, #3770, #3771) (new)
- LLVM for prebuilt packages bumped to v12.0.0, and Linux base image to Ubuntu 18.04. Unfortunately, the dynamic-compile (JIT) functionality is lost this way - it needs some more work to adapt to a newer LLVM API. (#3701)
- Prebuilt packages now bundle reggae, a meta build tool to generate ninja/make build files for dub projects (and more). Building large projects with many dependencies can be significantly sped-up via parallelization and dependency tracking for incremental builds. (#3739)
Basic usage, in a dub project dir (containing adub.{sdl,json}
file):reggae -b ninja|make --dc=ldc2 # only needed the first time or when adding source files ninja|make [-j<N>]
- Greatly improved DLL support on Windows, making it almost as easy as on Posix:
-fvisibility=public
now also affects Windows, exporting all defined symbols as on Posix, without explicitexport
visibility. Compiling a DLL with-shared
now defaults to-fvisibility=public
for consistency with Posix. (#3703)- This paved the way for druntime and Phobos DLLs, now bundled with prebuilt Windows packages and linkable via
-link-defaultlib-shared
(default with-shared
, consistent with Posix targets). Previous hacks to partially accomodate for multiple, statically linked druntimes and Phobos in a single process (GC proxy etc.) aren't required any longer. With-link-defaultlib-shared
, LDC now defaults to-mscrtlib=msvcrt
, linking against the shared MSVC runtime. (ldc-developers/druntime#197, #3704, ldc-developers/druntime#198) - Limitation: TLS variables cannot be accessed directly across DLL boundaries. This can be worked around with an accessor function, e.g., ldc-developers/druntime@5d3e21a35d.
- Non-TLS
extern(D)
global variables not defined in a root module aredllimport
ed (with-fvisibility=public
, or - restricted to druntime/Phobos symbols - with-link-defaultlib-shared
). Compiling all modules of a DLL at once thus avoids linker warnings about 'importing locally defined symbol'. When linking a DLL against a static library, the static library may likely need to be compiled with-fvisibility=public
to make its globals importable from the DLL. There's a new-dllimport
option for explicit control. (#3763) (new) - Caveat: symbols aren't uniqued across the whole process, so can be defined in multiple DLLs/executables, each with their own address, so you cannot rely on TypeInfos, instantiated symbols and functions to have the same address for the whole process.
- When linking manually (not via LDC), binaries linked against druntime DLL need to include new
lib\dso_windows.obj
. - To restore the previous behavior of
-shared
, add-fvisibility=hidden -link-defaultlib-shared=false
.
- Windows: ANSI color codes can now be enforced for redirected stderr via
-enable-color
. (#3744) - Prebuilt Linux and Mac packages now use the mimalloc allocator, significantly increasing compiler performance in some cases. (#3758, #3759) (new)
- The prebuilt macOS x64 package now bundles shared druntime/Phobos libs for iOS too. (#3764) (new)
- Possibly more performant shared Phobos library by compiling to a single object file with implicit cross-module inlining. (#3757) (new)
- New
-cov-increment
option for more performant coverage count execution. (#3724) (new) -fsanitize=memory
: Bundle according LLVM compiler-rt library and add new-fsanitize-memory-track-origins
option. (#3751) (new)
Platform support
- Supports LLVM 6.0 - 12.0.
Bug fixes
- Fix debuginfo source file paths, e.g., including directories in exception stack traces. (#3687)
- Fix potentially corrupt context pointers for nested functions with
-linkonce-templates
. (#3690, #3766) (new) - Predefine version
CppRuntime_Gcc
for musl targets. (#3769) (new) - beta1 regression wrt. teardown of Windows DLLs with static druntime using the .exe GC. (#3755) (new)
Known issues
- When building LDC, old LDC 0.17.*/ltsmaster host compilers miscompile LDC ≥ 1.21, leading to potential segfaults of the built LDC. Ltsmaster can still be used to bootstrap a first compiler and then let that compiler compile itself. (#3354)
- Buggy older
ld.bfd
linker versions may wrongly strip out required symbols, e.g., ModuleInfos (so that e.g. no module ctors/dtors are run). LDC defaults told.gold
on Linux. - LDC does not zero the padding area of a
real
variable. This may lead to wrong results if the padding area is also considered. See #770. Does not apply toreal
members inside structs etc.