Difference between revisions of "LDC"

From D Wiki
Jump to: navigation, search
m (Update status for Win64)
(Update status of LDC on X86_64 MSVC, ARM, PowerPC 32bit and 64bit)
Line 30: Line 30:
 
=== x86-64 Windows using MSVC ===
 
=== x86-64 Windows using MSVC ===
  
* LDC2 from master branch compiles without patches.
+
* LDC2 from master branch compiles cleanly.
* LLVM 3.5 is required with a fix applied.
+
* LLVM 3.6 (current trunk) is required.
 
* See [[Building and hacking LDC on Windows using MSVC]] for detailed instructions.
 
* See [[Building and hacking LDC on Windows using MSVC]] for detailed instructions.
* druntime and Phobos compile but linker errors are still possible.
+
* There are no compile issues in druntime and phobos.
 +
* Several unit tests still fail: https://github.com/ldc-developers/ldc/issues/758
 
* Contact: kai@redstar.de
 
* Contact: kai@redstar.de
  
Line 41: Line 42:
 
* LLVM 3.4 is required, there are many known bugs affecting ARM in older versions.
 
* LLVM 3.4 is required, there are many known bugs affecting ARM in older versions.
 
* EH support is still broken, and there are many other severe bugs: https://github.com/ldc-developers/ldc/issues?labels=B-arm&state=open
 
* EH support is still broken, and there are many other severe bugs: https://github.com/ldc-developers/ldc/issues?labels=B-arm&state=open
* Debug information is broken because of [http://llvm.org/bugs/show_bug.cgi?id=18554 PR18554]
 
 
* Android has not been tested yet and most likely does not even compile.
 
* Android has not been tested yet and most likely does not even compile.
 
* LDC has successfully been used to create a minimal free-standing ARM Cortex-M binary, see [[Minimal semihosted ARM Cortex-M %22Hello_World%22]].
 
* LDC has successfully been used to create a minimal free-standing ARM Cortex-M binary, see [[Minimal semihosted ARM Cortex-M %22Hello_World%22]].
Line 49: Line 49:
 
* Requires at least LLVM 3.4 because of [http://llvm.org/bugs/show_bug.cgi?id=16556 PR16556]
 
* Requires at least LLVM 3.4 because of [http://llvm.org/bugs/show_bug.cgi?id=16556 PR16556]
 
* TLS support only for LocalExec model, see [http://llvm.org/bugs/show_bug.cgi?id=16555 PR16555]
 
* TLS support only for LocalExec model, see [http://llvm.org/bugs/show_bug.cgi?id=16555 PR16555]
* Issues in druntime and phobos:
+
* Code generation is known to work.
** druntime: Compiles cleanly with this [http://www.redstar.de/ldc/ppc_druntime.diff patch] applied
+
* There are no compile issues in druntime and phobos.
** phobos: Compiles cleanly with this [http://www.redstar.de/ldc/ppc_phobos.diff patch] applied
+
* Linux/PPC32 specific implementations are missing: core.cpuid, std.internal.math.bigintppc32, ...
** Most of these changes are already passed as upstream pull requests
+
* More testing is needed.
* Threads and fibers require some more work
 
 
* Contact: kai@redstar.de
 
* Contact: kai@redstar.de
  
=== PowerPC 64-bit ===
+
=== PowerPC 64-bit Big Endian and Little Endian ===
  
* Requires at least LLVM 3.3 because of [http://llvm.org/bugs/show_bug.cgi?id=14751 PR14751], [http://llvm.org/bugs/show_bug.cgi?id=14779 PR14779], [http://llvm.org/bugs/show_bug.cgi?id=15347 PR15347], [http://llvm.org/bugs/show_bug.cgi?id=15359 PR15359], [http://llvm.org/bugs/show_bug.cgi?id=15630 PR15630] and [http://llvm.org/bugs/show_bug.cgi?id=15632 PR15632]. Use of debug symbols requires at least LLVM 3.4 because of [http://llvm.org/bugs/show_bug.cgi?id=15580 PR15580]. Solution for [https://github.com/ldc-developers/ldc/issues/372 issue #372] (failure in std.bitmanip) is still missing.
+
* PPPC64 Big Endian requires at least LLVM 3.4. PPC64 Little Endian requires at least LLVM 3.5. Both are affected by [http://llvm.org/bugs/show_bug.cgi?id=21443 PR21443].
 
* Only Linux because LLVM does not cleanly compile on AIX.
 
* Only Linux because LLVM does not cleanly compile on AIX.
 
* Code generation is known to work.
 
* Code generation is known to work.
* Issues in druntime and phobos:
+
* There are no compile issues in druntime and phobos.
** druntime: Compiles cleanly
+
* There are still some test failures. Most of the failures are related to math precision (e.g. unit test expects 80bit reals)
** phobos: Compiles cleanly with this [http://www.redstar.de/ldc/ppc_phobos.diff patch] applied (but not all std.math functionality is available)
 
** Most of these changes are already passed as upstream pull requests
 
* For 0.11.0: 95% of the test suite passes - only 52 tests (out of 1036) fail. These are some modules with problems (incomplete):
 
** Unit test failures: core.math (math precision), std.complex, std.bitmanip (release only with -O2/-O3, [https://github.com/ldc-developers/ldc/issues/372 issue #372]), std.outbuffer, std.csv, std.math, std.getopt (math precision), std.regex (endian), ...
 
** Seg faults: std.datetime, std.range, ...
 
** Reason for failures are likely: math precision, thread synchronisation, frontend bugs, endian issues, bad code generation, ...
 
 
* Linux/PPC64 specific implementations are missing: core.cpuid, std.internal.math.bigintppc64, ...
 
* Linux/PPC64 specific implementations are missing: core.cpuid, std.internal.math.bigintppc64, ...
* Multi-lib build is possible with patches for PPC32 applied
+
* Multi-lib build is possible on Linux/PPC64 Big Endian.
 +
* More testing is needed.
 
* Contact: kai@redstar.de
 
* Contact: kai@redstar.de
  

Revision as of 12:44, 9 November 2014

Compilers: OverviewDMDGDCLDC

The LDC project aims to provide a portable D programming language compiler with modern optimization and code generation capabilities. The compiler uses the official DMD frontend to support the latest D2 version and relies on the LLVM Core libraries for code generation.

LDC is fully Open Source; the parts of the code not taken/adapted from other projects are BSD-licensed (see the LICENSE file for details).

D1 is no longer supported in the current development tree; the last version supporting it can be found at the d1 Git branch.

Getting started

Project status

In general, LDC should work fine on most x86/x86-64 Unix-like systems, including Linux, OS X 10.7+ and most BSD flavors. Code generation should work for other platforms supported by the LLVM MC codegen infrastructure (for example ARM), but druntime/Phobos support will most likely be lacking.

OS X version prior to 10.7 (Lion) are currently not supported by the D2 compiler, because LLVM's support for thread-local storage depends on functionality which first appeared in 10.7.

x86 Windows using MinGW

  • LDC 2 from Git master compiles and builds druntime/Phobos, but requires recent MinGW and LLVM versions for a few critical bug fixes. See Building LDC on MinGW x86.
  • Most programs work just fine (including TLS and exception handling).
  • A small number of remaining test cases still fails, but many of the harder issues (real math precision, MS C runtime-caused problems, ABI differences) have already been solved.
  • Estimate for making Windows x86/MinGW a »first class« target: 1 weekend of focused work, plus a Windows CI slave.

x86-64 Windows using MSVC

ARM

PowerPC 32-bit

  • Requires at least LLVM 3.4 because of PR16556
  • TLS support only for LocalExec model, see PR16555
  • Code generation is known to work.
  • There are no compile issues in druntime and phobos.
  • Linux/PPC32 specific implementations are missing: core.cpuid, std.internal.math.bigintppc32, ...
  • More testing is needed.
  • Contact: kai@redstar.de

PowerPC 64-bit Big Endian and Little Endian

  • PPPC64 Big Endian requires at least LLVM 3.4. PPC64 Little Endian requires at least LLVM 3.5. Both are affected by PR21443.
  • Only Linux because LLVM does not cleanly compile on AIX.
  • Code generation is known to work.
  • There are no compile issues in druntime and phobos.
  • There are still some test failures. Most of the failures are related to math precision (e.g. unit test expects 80bit reals)
  • Linux/PPC64 specific implementations are missing: core.cpuid, std.internal.math.bigintppc64, ...
  • Multi-lib build is possible on Linux/PPC64 Big Endian.
  • More testing is needed.
  • Contact: kai@redstar.de

Contributing

LDC is an entirely community-driven effort, so all contributions are warmly welcomed. The easiest way to help with development is to write high-quality bug reports for any issues you run into. For a quick guide on what a useful report should contain, please see Reporting LDC issues.

If you are interested in getting into compiler development, anecdotal evidence suggests that hacking on LDC might be a nice first step, particularly because the LLVM backend is very comfortable to work with. To get started, just browse through the issue list, find a ticket that tickles your fancy (some of them are specifically marked as "junior jobs"), and work on a fix – and of course don't hesitate to ask for advice at the mailing list or on IRC. An LDC contributor's guide is in the works.

We would also be excited to see LDC packages in more OS distributions, particular Debian and its derivatives. So, if you think you might be able to help, please just drop us a line at the development mailing list. We will actively try to make packaging as smooth as possible, but besides the fact that upstream-maintained packages are sometimes discouraged, it is hard to build good packages for a system you don't know well, so we need to rely on external contributors here.

Useful Links