Releases: ldc-developers/ldc
Releases · ldc-developers/ldc
Release list
LDC 1.43.0
(Changes since 1.43.0-beta1 are marked with (new).)
Big news
- Frontend, druntime and Phobos are at version 2.113.0, incl. new command-line option
-foptimize-nothrowto restore thenothrowoptimizations. (#5113, #5221, #5239, #5273) (new)-foptimize-nothrowis the default setting when targeting Windows or WebAssembly, to make hitting #3504 much less likely.
- Support for LLVM 22. The prebuilt packages use v22.1.8. (#5097, #5102, #5172)
- Minimum LLVM version raised to 18. (#5094)
- DRuntime and Phobos now support WASI preview levels 1 and 2, based on
wasi-libc, as well as Emscripten. Two caveats being that WASI (and our Emscripten support) is strictly single-threaded (currently), and that fibers are unavailable. (#5186, #5229, #5230, #5242, #5259) (new) - New prebuilt addon packages (
ldc2-*-addon-<target OS>.tar.xz) for simple cross-compilation. Simply unpack them directly into your LDC installation directory, and then cross-compile via-mtriple=…(ordub --target=…): (#5240)- Windows:
x86_64-windows-msvc,i686-windows-msvc; no SDK required. - Android:
aarch64-linux-android30,armv7a-linux-androideabi29,x86_64-linux-android29,i686-linux-android29; needs an Android NDK (r27) and itstoolchains/llvm/prebuilt/*/bin/dir in your PATH. - WASI:
wasm32-unknown-wasip1,wasm32-unknown-wasip2; needs a WASI SDK and itsbin/dir in your PATH. (#5207, #5242) - Emscripten:
wasm32-unknown-emscripten; needs a Emscripten SDK and itsupstream/emscripten/dir in your PATH. (#5259) (new)
- Windows:
- The
@ldc.attributes.restrictUDA is now supported for dynamic-array parameters too. Builtin array ops (c[] = a[] * b[]etc.) use it, enabling auto-vectorization. Note that for such array ops, the dlang spec prescribes that the slice on the left and any slices on the right must not overlap (https://dlang.org/spec/arrays.html#array-operations), and this knowledge is now used by the optimizer; e.g.,x[] *= x[]is invalid. (#5148, #5168, #5176) - DMD-style inline assembly:
asm { naked; }is now much less of a special case wrt. codegen - such naked functions are now emitted as ifasm { naked; }was replaced with the@nakedfunction UDA. IR-wise, they are not emitted as module-level asm blobs anymore, but regular IR functions. This should lift a few formerasm { naked; }-specific restrictions and fixed at least one LTO issue. (#5041) - dcompute: Added support for Native device code Embedding (PTX and SPIR-V) into the host executable's
.rodatasection. (#5140) - WebAssembly:
- The default
-fvisibilitysetting was changed tohidden, like clang, so that only explicitexported symbols are not hidden. And-L--export-dynamicisn't used by default for linking anymore either; add it manually to export all non-hidden symbols, as for normal Posix targets. The net effect is that the size of linked wasm binaries shrinks significantly by default. (#5216) - Exceptions are now supported. Currently, using D and C++ exceptions are mutually exclusive. If linking in DRuntime, you cannot link in C++ code relying on
libunwind(exceptions), due to the hacks required to convince LLVM to use D's EH personality. A future LLVM release may help remove the constraint. (#5162) - In order to allow the GC to function correctly, a new pass is run after optimizations, to spill potential pointers onto the "stack". This pass is enabled by default for all Wasm targets, but can be disabled with
-betterCor the new-disable-wasm-ptrs-spill. (#5178)
- The default
- A new
-fno-moduleinfo-localclassesswitch has been added. This disables populatingModuleInfo.localClassesfor each module. This can help eliminate/strip more dead-code (thus decreasing binary sizes), but breaksObject.factoryand any other code relying on iterating over saidlocalClasses. Enabled by default for Wasm targets. (#5224, #5231) - Predefined version
LDC_LLVM_*now only contains the LLVM major version, i.e., formerversion (LDC_LLVM_1801)with LLVM v18.1 is nowversion (LDC_LLVM_18). Useldc.intrinsics.LLVM_versionfor backwards compatibility if really needed. (#5109)
Platform support
- Supports LLVM 18 - 22.
- WebAssembly:
extern(C) mainis now mangled as__main_voidor__main_argc_argvas appropriate, matching Clang behavior (#5186).
Bug fixes
LDC 1.43.0-beta1
Big news
- Frontend, druntime and Phobos are at version ~2.113.0, incl. new command-line option
-foptimize-nothrowto restore thenothrowoptimizations. (#5113, #5221, #5239)-foptimize-nothrowis the default setting when targeting Windows or WebAssembly, to make hitting #3504 much less likely.
- Support for LLVM 22. The prebuilt packages use v22.1.8. (#5097, #5102, #5172)
- Minimum LLVM version raised to 18. (#5094)
- DRuntime and Phobos now support WASI preview levels 1 and 2, based on
wasi-libc. Two caveats being that WASI is strictly single-threaded (currently), and that fibers are unavailable. (#5186, #5229, #5230, #5242) - New prebuilt addon packages (
ldc2-*-addon-<target OS>.tar.xz) for simple cross-compilation. Simply unpack them directly into your LDC installation directory, and then cross-compile via-mtriple=…(ordub --target=…): (#5240)- Windows:
x86_64-windows-msvc,i686-windows-msvc; no SDK required. - Android:
aarch64-linux-android30,armv7a-linux-androideabi29,x86_64-linux-android29,i686-linux-android29; needs an Android NDK (r27) and itstoolchains/llvm/prebuilt/*/bin/dir in your PATH. - WASI:
wasm32-unknown-wasip1,wasm32-unknown-wasip2; needs a WASI SDK and itsbin/dir in your PATH. (#5207, #5242)
- Windows:
- The
@ldc.attributes.restrictUDA is now supported for dynamic-array parameters too. Builtin array ops (c[] = a[] * b[]etc.) use it, enabling auto-vectorization. Note that for such array ops, the dlang spec prescribes that the slice on the left and any slices on the right must not overlap (https://dlang.org/spec/arrays.html#array-operations), and this knowledge is now used by the optimizer; e.g.,x[] *= x[]is invalid. (#5148, #5168, #5176) - DMD-style inline assembly:
asm { naked; }is now much less of a special case wrt. codegen - such naked functions are now emitted as ifasm { naked; }was replaced with the@nakedfunction UDA. IR-wise, they are not emitted as module-level asm blobs anymore, but regular IR functions. This should lift a few formerasm { naked; }-specific restrictions and fixed at least one LTO issue. (#5041) - dcompute: Added support for Native device code Embedding (PTX and SPIR-V) into the host executable's
.rodatasection. (#5140) - WebAssembly:
- The default
-fvisibilitysetting was changed tohidden, like clang, so that only explicitexported symbols are not hidden. And-L--export-dynamicisn't used by default for linking anymore either; add it manually to export all non-hidden symbols, as for normal Posix targets. The net effect is that the size of linked wasm binaries shrinks significantly by default. (#5216) - Exceptions are now supported. Currently, using D and C++ exceptions are mutually exclusive. If linking in DRuntime, you cannot link in C++ code relying on
libunwind(exceptions), due to the hacks required to convince LLVM to use D's EH personality. A future LLVM release may help remove the constraint. (#5162) - In order to allow the GC to function correctly, a new pass is run after optimizations, to spill potential pointers onto the "stack". This pass is enabled by default for all Wasm targets, but can be disabled with
-betterCor the new-disable-wasm-ptrs-spill. (#5178)
- The default
- A new
-fno-moduleinfo-localclassesswitch has been added. This disables populatingModuleInfo.localClassesfor each module. This can help eliminate/strip more dead-code (thus decreasing binary sizes), but breaksObject.factoryand any other code relying on iterating over saidlocalClasses. Enabled by default for Wasm targets. (#5224, #5231) - Predefined version
LDC_LLVM_*now only contains the LLVM major version, i.e., formerversion (LDC_LLVM_1801)with LLVM v18.1 is nowversion (LDC_LLVM_18). Useldc.intrinsics.LLVM_versionfor backwards compatibility if really needed. (#5109)
Platform support
- Supports LLVM 18 - 22.
- WebAssembly:
extern(C) mainis now mangled as__main_voidor__main_argc_argvas appropriate, matching Clang behavior (#5186).
Bug fixes
LDC 1.42.0
(Changes since 1.42.0-beta3 are marked with (new).)
Big news
- Frontend, druntime and Phobos are at version 2.112.1+, incl. new command-line options
-extI,-dllimport=externalOnlyand-edition. (#4949, #4962, #4988, #5029, #5042, #5046, #5051, #5061, #5067, #5069, #5076) (new) - Support for LLVM 21. The prebuilt packages use v21.1.8. (#4950, #5033)
- New prebuilt package for Alpine Linux aarch64 with musl libc, analogous to the existing x86_64 package. (#4943)
- Breaking change for dcompute: The special
@kernelUDA is now a function and requires parentheses as in@kernel() void foo(){}. Optionally you can provide launch dimensions,@kernel([2,4,8]), to specify to the compute runtime how the kernel is intended to be launched. - ldc2.conf can now be a directory. All the files inside it, ordered naturally, will be concatenated and treated like a big config. (#4954)
- Running
ldc-build-runtime --installWithSuffixnow includes installing a target-specific .conf file to that directory. (#4978)
- Running
- Breaking change for ldc2.conf cmake generation: The
cmakebuild process now generates theldc2.confandldc2_install.confas directories.ldc2*.conf.inandADDITIONAL_DEFAULT_LDC_SWITCHEShave been removed, if you need to add switches check outmakeConfSectioninLdcConfig.cmake. (#4954) - When cross-compiling, the fallback value for the (cross) C compiler will be picked based on some heuristics.
The old behavior was to default tocc.
As an example, when cross-compiling foraarch64-linux-gnuthe compilers that are checked are:aarch64-linux-gnu-gccaarch64-linux-gnu-clangclang --target=aarch64-linux-gnu
- The prebuilt arm64/universal macOS packages additionally bundle the arm64 iOS-simulator libraries, for out-of-the-box cross-compilation support via e.g.
-mtriple=arm64-apple-ios12.0-simulator. (#4974) - New
--fdebug-prefix-mapcommand-line option and changed debuginfo file/directory name splitting logic (both now similar to clang), to aid reproducible builds. (#5039)
Platform support
- Supports LLVM 15 - 21.
- PowerPC64:
realnow matches the C++ host compiler'slong doublewhen compiling for the native target, not just on Linux hosts. (#5054)
LDC 1.42.0-beta3
(Changes since 1.42.0-beta2 are marked with (new).)
Big news
- Frontend, druntime and Phobos are at version 2.112.1+, incl. new command-line options
-extI,-dllimport=externalOnlyand-edition. (#4949, #4962, #4988, #5029, #5042, #5046, #5051, #5061, #5067) (new) - Support for LLVM 21. The prebuilt packages use v21.1.8. (#4950, #5033)
- New prebuilt package for Alpine Linux aarch64 with musl libc, analogous to the existing x86_64 package. (#4943)
- Breaking change for dcompute: The special
@kernelUDA is now a function and requires parentheses as in@kernel() void foo(){}. Optionally you can provide launch dimensions,@kernel([2,4,8]), to specify to the compute runtime how the kernel is intended to be launched. - ldc2.conf can now be a directory. All the files inside it, ordered naturally, will be concatenated and treated like a big config. (#4954)
- Running
ldc-build-runtime --installWithSuffixnow includes installing a target-specific .conf file to that directory. (#4978)
- Running
- Breaking change for ldc2.conf cmake generation: The
cmakebuild process now generates theldc2.confandldc2_install.confas directories.ldc2*.conf.inandADDITIONAL_DEFAULT_LDC_SWITCHEShave been removed, if you need to add switches check outmakeConfSectioninLdcConfig.cmake. (#4954) - When cross-compiling, the fallback value for the (cross) C compiler will be picked based on some heuristics.
The old behavior was to default tocc.
As an example, when cross-compiling foraarch64-linux-gnuthe compilers that are checked are:aarch64-linux-gnu-gccaarch64-linux-gnu-clangclang --target=aarch64-linux-gnu
- The prebuilt arm64/universal macOS packages additionally bundle the arm64 iOS-simulator libraries, for out-of-the-box cross-compilation support via e.g.
-mtriple=arm64-apple-ios12.0-simulator. (#4974) - New
--fdebug-prefix-mapcommand-line option and changed debuginfo file/directory name splitting logic (both now similar to clang), to aid reproducible builds. (#5039)
Platform support
- Supports LLVM 15 - 21.
- PowerPC64:
realnow matches the C++ host compiler'slong doublewhen compiling for the native target, not just on Linux hosts. (#5054)
LDC 1.42.0-beta2
(Changes since 1.42.0-beta1 are marked with (new).)
Big news
- Frontend, druntime and Phobos are at version 2.112.1+, incl. new command-line options
-extI,-dllimport=externalOnlyand-edition. (#4949, #4962, #4988, #5029, #5042, #5046, #5051) (new) - Support for LLVM 21. The prebuilt packages use v21.1.8. (#4950, #5033) (new)
- New prebuilt package for Alpine Linux aarch64 with musl libc, analogous to the existing x86_64 package. (#4943)
- Breaking change for dcompute: The special
@kernelUDA is now a function and requires parentheses as in@kernel() void foo(){}. Optionally you can provide launch dimensions,@kernel([2,4,8]), to specify to the compute runtime how the kernel is intended to be launched. - ldc2.conf can now be a directory. All the files inside it, ordered naturally, will be concatenated and treated like a big config. (#4954)
- Running
ldc-build-runtime --installWithSuffixnow includes installing a target-specific .conf file to that directory. (#4978)
- Running
- Breaking change for ldc2.conf cmake generation: The
cmakebuild process now generates theldc2.confandldc2_install.confas directories.ldc2*.conf.inandADDITIONAL_DEFAULT_LDC_SWITCHEShave been removed, if you need to add switches check outmakeConfSectioninLdcConfig.cmake. (#4954) - When cross-compiling, the fallback value for the (cross) C compiler will be picked based on some heuristics.
The old behavior was to default tocc.
As an example, when cross-compiling foraarch64-linux-gnuthe compilers that are checked are:aarch64-linux-gnu-gccaarch64-linux-gnu-clangclang --target=aarch64-linux-gnu
- The prebuilt arm64/universal macOS packages additionally bundle the arm64 iOS-simulator libraries, for out-of-the-box cross-compilation support via e.g.
-mtriple=arm64-apple-ios12.0-simulator. (#4974) - New
--fdebug-prefix-mapcommand-line option and changed debuginfo file/directory name splitting logic (both now similar to clang), to aid reproducible builds. (#5039) (new)
Platform support
- Supports LLVM 15 - 21.
- PowerPC64:
realnow matches the C++ host compiler'slong doublewhen compiling for the native target, not just on Linux hosts. (#5054) (new)
LDC 1.42.0-beta1
Big news
- Frontend, druntime and Phobos are at version ~2.112.0, incl. new command-line options
-extI,-dllimport=externalOnlyand-edition. (#4949, #4962, #4988, #5029) - Support for LLVM 21. Beware that we have seen misoptimizations for
std.jsonat one point (not anymore). (#4950, #5033) - New prebuilt package for Alpine Linux aarch64 with musl libc, analogous to the existing x86_64 package. (#4943)
- Breaking change for dcompute: The special
@kernelUDA is now a function and requires parentheses as in@kernel() void foo(){}. Optionally you can provide launch dimensions,@kernel([2,4,8]), to specify to the compute runtime how the kernel is intended to be launched. - ldc2.conf can now be a directory. All the files inside it, ordered naturally, will be concatenated and treated like a big config. (#4954)
- Running
ldc-build-runtime --installWithSuffixnow includes installing a target-specific .conf file to that directory. (#4978)
- Running
- Breaking change for ldc2.conf cmake generation: The
cmakebuild process now generates theldc2.confandldc2_install.confas directories.ldc2*.conf.inandADDITIONAL_DEFAULT_LDC_SWITCHEShave been removed, if you need to add switches check outmakeConfSectioninLdcConfig.cmake. (#4954) - When cross-compiling, the fallback value for the (cross) C compiler will be picked based on some heuristics.
The old behavior was to default tocc.
As an example, when cross-compiling foraarch64-linux-gnuthe compilers that are checked are:aarch64-linux-gnu-gccaarch64-linux-gnu-clangclang --target=aarch64-linux-gnu
- The prebuilt arm64/universal macOS packages additionally bundle the arm64 iOS-simulator libraries, for out-of-the-box cross-compilation support via e.g.
-mtriple=arm64-apple-ios12.0-simulator. (#4974)
Platform support
- Supports LLVM 15 - 21.
LDC 1.41.0
(Changes since 1.41.0-beta1 are marked with (new).)
Big news
- Frontend, druntime and Phobos are at version 2.111.0+. (#4877, #4910, #4918, #4941) (new)
- Support for LLVM 20. The prebuilt packages use v20.1.5. (#4843, #4911, #4935) (new)
- The dynamic-compile (JIT) feature has regressed with LLVM 20. Use LLVM 18 or 19 for that feature.
- Keep frame pointers by default with
-Ofor some targets, notably AArch64 (except Windows), x86_64 (except Windows and glibc Linux), Windows x86, and Android. This fixes druntime backtraces with optimized code (incl. prebuilt druntime/Phobos). (#4889) - The prebuilt (non-musl) Linux packages are now generated on Ubuntu 22.04; the minimum glibc version has accordingly been raised from v2.31 to v2.35. (#4893)
- druntime: Optimize
core.int128via inline IR/assembly. (#4892) - Follow clang wrt. unwind tables emission, enabling them for most popular targets. (#4888)
- ldc2.conf: Arrays can now be appended to via the
~=operator. (#4848, #4856) - New
--installWithSuffixcommand-line option for theldc-build-runtimetool, to simplify copying the libraries to an existing LDC installation. (#4870) - CMake changes (for building LDC itself):
- Minimum CMake version bumped to v3.16. (#4898)
- macOS: Fix weird linker error when running CMake the first time. (#3901, #4926) (new)
- Reworked integration of the LLVM compiler-rt libraries. Package maintainers may want to see docs/compiler_rt.md. (#4665)
- Somewhat simplify separate compiler and runtime builds, incl. cross-compiling LDC itself. (#4872)
Platform support
- Supports LLVM 15 - 20. (new)
- RISC-V: Fiber context switching is now implemented natively. (#4867) (new)
Bug fixes
- Prebuilt macOS packages: Fix
ldmd2and other bundled executables crashing on macOS v15.4. (#4899, #4912) (new) - ImportC: Run C preprocessor in C11 mode. (#4933) (new)
- ImportC Windows: Disable clang headers when C-preprocessing with
clang-cl. (#4934) (new) - Fix ICE on invalid constant address-of expressions. (#4938, #4939) (new)
- Allow Unicode in fully qualified label names. (#4927, #4929) (new)
LDC 1.41.0-beta1
Big news
- Frontend, druntime and Phobos are at version 2.111.0+. (#4877, #4910)
- Keep frame pointers by default with
-Ofor some targets, notably AArch64 (except Windows), x86_64 (except Windows and glibc Linux), Windows x86, and Android. This fixes druntime backtraces with optimized code (incl. prebuilt druntime/Phobos). (#4889) - The prebuilt (non-musl) Linux packages are now generated on Ubuntu 22.04; the minimum glibc version has accordingly been raised from v2.31 to v2.35. (#4893)
- ldc2.conf: Arrays can now be appended to via the
~=operator. (#4848, #4856) - New
--installWithSuffixcommand-line option for theldc-build-runtimetool, to simplify copying the libraries to an existing LDC installation. (#4870)
LDC 1.40.1
(Changes since 1.40.1-beta1 are marked with (new).)
Big news
- Frontend and druntime bumped to version 2.110.0 final. (#4854, #4868)
- LLVM for prebuilt packages bumped to v19.1.7. (#4822)
- New prebuilt package for Alpine Linux x86_64 with musl libc. It's currently generated on Alpine v3.21, using its default LLVM 19. Most bundled executables are fully static and can be run on ~all distros. (#4826, #4862)
- Revived dynamic-compile (JIT) functionality (formerly unsupported since LLVM 12), supporting LLVM 18+ now. (#4774)
- ldc2.conf:
%%ldcversion%%placeholder added, allowing to refer to version-specific directories. - Windows: The prebuilt packages now bundle an official libcurl build (from https://curl.se/windows/), currently v8.12.1. The static library (
curl_a.lib) isn't available anymore. When bundling thislibcurl.dllwith your binaries, make sure to includecurl-ca-bundle.crttoo (in the same directory as the DLL), to prevent 'SSL peer certificate or SSH remote key was not OK' exceptions. (#4855, #4875) (new)
Platform support
- Supports LLVM 15 - 19.
- Initial compiler and runtime support for ppc64 and ppc64le systems that use IEEE 754R 128-bit floating-point as the default 128-bit floating-point format. (#4833, #4840)
- Initial support for Windows on ARM64. The prebuilt Windows multilib package/installer bundles prebuilt arm64 druntime and Phobos; cross-compiling works out of the box via
-mtriple=aarch64-windows-msvc, but you currently need to set up a suited MSVC arm64 build environment before yourself (e.g., by runningvsdevcmd.bat -arch=arm64 -host_arch=x64). (#4835, #4846)
Bug fixes
LDC 1.40.1-beta1
Big news
- Frontend and druntime bumped to version 2.110.0 final. (#4854, #4868)
- LLVM for prebuilt packages bumped to v19.1.7. (#4822)
- New prebuilt package for Alpine Linux x86_64 with musl libc. It's currently generated on Alpine v3.21, using its default LLVM 19. Most bundled executables are fully static and can be run on ~all distros. (#4826, #4862)
- Revived dynamic-compile (JIT) functionality (formerly unsupported since LLVM 12), supporting LLVM 18+ now. (#4774)
- ldc2.conf:
%%ldcversion%%placeholder added, allowing to refer to version-specific directories. - Windows: The prebuilt packages now bundle an official libcurl build (from https://curl.se/windows/), currently v8.12.1. The static library (
curl_a.lib) isn't available anymore. (#4855)
Platform support
- Supports LLVM 15 - 19.
- Initial compiler and runtime support for ppc64 and ppc64le systems that use IEEE 754R 128-bit floating-point as the default 128-bit floating-point format. (#4833, #4840)
- Initial support for Windows on ARM64. The prebuilt Windows multilib package/installer bundles prebuilt arm64 druntime and Phobos; cross-compiling works out of the box via
-mtriple=aarch64-windows-msvc, but you currently need to set up a suited MSVC arm64 build environment before yourself (e.g., by runningvsdevcmd.bat -arch=arm64 -host_arch=x64). (#4835, #4846)