github ldc-developers/ldc v1.4.0
LDC 1.4.0

latest releases: v1.38.0-beta1, dmd-rewrite-v2.108.0, dmd-rewrite-v2.108.0-rc.1...
6 years ago

(Changes from 1.4.0-beta1 release are marked with (new).)

Big news

  • Frontend, druntime and Phobos are at version 2.074.1. (#2076)
  • ldc-build-runtime: a small D tool that makes it easy to compile the LDC runtime and standard library yourself, for example, to enable LTO-ability/sanitizers or cross-compiling executables and shared libraries for other platforms, like Android/ARM. (Wiki page)
  • @joakim-noah's Android fixes have finally been fully incorporated, enabling every host to (cross-)compile to Android. (ldc-developers/llvm@8655f32) Instructions on using this ldc release to cross-compile D apps for Android are on the wiki, including how to try out the native Android/arm package, ie a D compiler that you can run on your Android smartphone or tablet.
  • Improved support for AddressSanitizer. LDC will automatically link with the AddressSanitizer runtime library when -fsanitize=address is passed (when LDC can find the AddressSanitizer library).
  • libFuzzer sanitizer support using -fsanitize=fuzzer (same as Clang). This flag implies -fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp and automatically links-in the runtime libFuzzer library if LDC can locate the runtime library. (With LLVM 4.0, there is a dependency on sanitizer runtime, so manually link the ASan library or use -fsanitize=fuzzer,address.)
  • New -fsanitize-blacklist=<file> command-line option to exclude functions from sanitizer instrumentation (identical to Clang). The file must adhere to the textual Sanitizer Special Case List format.
  • New -fsanitize-coverage=... command-line option with the same functionality as Clang.
  • The config file sections now feature an additional post-switches list for switches to be appended to the command line (the existing switches list is prepended). E.g., this now allows the user to override the directory containing the runtime libraries via -L-L/my/runtime/libs in the command line. (#2281) (new)

Breaking changes

  • The -sanitize command-line option has been renamed to -fsanitize*, for clang conformance.
  • The semantics of an empty -conf= command-line option have been changed from 'use default config file' to 'use no config file'.
  • The binary representations of the init values for float/double/real have been unified to a special quiet NaN, with both most significant mantissa bits set, on all hosts and for all targets. (#2207)

Platform support

  • Supports LLVM 3.7 - 5.0. Support for 3.5 and 3.6 has been dropped.
  • Windows: Supports Visual Studio/C++ Build Tools 2015 and 2017, incl. the latest Visual Studio 2017 Update 15.3 (new).

Changes to the prebuilt packages

  • Consistent usage of a minimally tailored LLVM 4.0.1.
  • Newly enabled LLVM target NVPTX in order to target CUDA via DCompute. (new)
  • Linux x86_64:
    • Shipping with the LLVM LTO plugin for the gold linker. On Ubuntu 14.04 and later, -flto=full|thin -Xcc=-fuse-ld=gold should work out of the box.
    • Build environment upgraded from Ubuntu 12.04 and gcc 4.9 to Ubuntu 14.04 and gcc 6.3.
  • Windows/MSVC: Build environment upgraded from Visual Studio 2015 Update 3 to Visual Studio 2017 15.3.3 (WinSDK 10.0.15063). (new)

Bug fixes

  • Misc. debuginfo issues, incl. adaptations to internal LLVM 5.0 changes: (#2315) (new)
    • ref parameters and closure parameters declared with wrong address and hence potentially showing garbage.
    • Win64: parameters > 64 bit passed by value showing garbage.
    • Win64: debuginfos for closure and nested variables now finally available starting with LLVM 5.0.
  • LLVM error Global variable initializer type does not match global variable type! for T.init with explicit initializers for dominated members in nested unions. (#2108)
  • Inconsistent handling of lvalue slicees wrt. visible side-effects of slice lower/upper bound expressions. (#1433)
  • Misc. dcompute issues. (#2195, #2215)
  • Potential LDC crashes due to dangling pointers after replacing IR globals (required in some cases if the type contains unions) almost fully mitigated. (#1829)
  • Multiple arrayop function emissions. (#2216)
  • Potentially incorrect memory layout for unnaturally aligned aggregates. (#2235)
  • Wrong -m32/64 in command-line for external ARM assembler used via -no-integrated-as.

Internals

  • Misc. CI improvements:
    • Addition of high-performant SemaphoreCI (incl. enabled LLVM/LDC assertions).
    • CircleCI upgraded to 2.0, testing with latest gcc.
  • Compile all D files for (non-unittest) druntime/Phobos at once. May be disabled via CMake option COMPILE_ALL_D_FILES_AT_ONCE=OFF. (#2231)

Known issues

  • 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 to real members inside structs etc.
  • Phobos does not compile on MinGW platform.
  • ThinLTO may not work well with the ld.bfd linker, use ld.gold instead (-Xcc=-fuse-ld=gold).
  • When building with LLVM 5.0, you may need -DLDC_WITH_LLD=OFF in the CMake command line. Otherwise, if the LLD headers are available and LDC is built with LLD integration, the produced LDC binary will refuse to work due to conflicting command-line options.

Don't miss a new ldc release

NewReleases is sending notifications on new releases.