Difference between revisions of "GDC"

From D Wiki
Jump to: navigation, search
(Added "Quicklinks" section)
(Arch has a normal package, not AUR)
(44 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 
{{:Compilers_Widget}}
 
{{:Compilers_Widget}}
<table cellspacing= "10" style="width:100%">
+
 
<tr>
 
<td style="width:70%; vertical-align:top;">
 
 
Welcome to GDC. This project aims to continue the development of GDC, a GCC frontend for the D programming language.
 
Welcome to GDC. This project aims to continue the development of GDC, a GCC frontend for the D programming language.
__TOC__
+
 
</td>
 
<td style="margin:0; margin-top:10px; margin-right:10px; border:1px solid #c0d9e2; border-bottom: 2px solid #a0b9c2; border-top: 1px solid #fff; padding:0 1em 1em 1em; background-color: #e4f4f9; align:right;vertical-align:top;">
 
 
=== Useful Links ===
 
=== Useful Links ===
 
* [https://github.com/D-Programming-GDC/GDC Source code (GitHub)]
 
* [https://github.com/D-Programming-GDC/GDC Source code (GitHub)]
 
* [http://www.gdcproject.org/ Project website]
 
* [http://www.gdcproject.org/ Project website]
* [http://bugzilla.gdcproject.org Bug tracker]
+
* [http://bugzilla.gdcproject.org/describecomponents.cgi Bug tracker]
</td>
+
* [https://www.bountysource.com/trackers/455080-gdc Bountysource project]
</tr>
 
</table>
 
  
 
== Introduction ==
 
== Introduction ==
Line 19: Line 13:
 
GDC is a frontend for the [//dlang.org D programming language]. By using GCC as a backend, it gives us the ability to target the same platforms that GCC targets.
 
GDC is a frontend for the [//dlang.org D programming language]. By using GCC as a backend, it gives us the ability to target the same platforms that GCC targets.
  
This project was originally started by David Friedman. His original project page can be found [//dgcc.sourceforge.net here]. Unfortunately, he disappeared from the D scene, and was no longer able to maintain GDC. This project was the result of an effort to help continue David Friedman's work on GDC.
+
This project was originally started by David Friedman. His first announcement can be found [http://forum.dlang.org/post/c3mnst$2htg$1@digitaldaemon.com here] and his original project page can be found [http://dgcc.sourceforge.net here]. Unfortunately, he disappeared from the D scene, and was no longer able to maintain GDC. This project was the result of an effort to help continue David Friedman's work on GDC.
 +
 
 +
The paperwork is complete and efforts are currently underway to merge GDC into the official GCC codebase, which represents a great step forward for D. However, more than ever, GDC is in need of contributors to keep it up to date with both the D frontend and the trunk development of the GCC backend.
  
 
=== Why GDC? ===
 
=== Why GDC? ===
Line 31: Line 27:
  
 
=== Status ===
 
=== Status ===
D2 Frontend Version: [//www.digitalmars.com/d/2.0/changelog.html#new2_064 2.064]
+
D2 Frontend Versions: [//dlang.org/changelog/2.068.0.html 2.068], [//dlang.org/changelog/2.076.0.html 2.076], [//dlang.org/changelog/2.081.0.html 2.081]
  
 
=== Supported GCC versions ===
 
=== Supported GCC versions ===
* [//gcc.gnu.org/gcc-4.7 GCC 4.7.x]
+
* [//gcc.gnu.org/gcc-4.7 GCC 4.7.x (2.062)]
* [//gcc.gnu.org/gcc-4.8 GCC 4.8.x]
+
* [//gcc.gnu.org/gcc-4.8 GCC 4.8.x (2.066.1)]
* [//gcc.gnu.org/snapshots.html GCC 4.9.x Development]
+
* [//gcc.gnu.org/gcc-4.9 GCC 4.9.x (2.066.1)]
 +
* [//gcc.gnu.org/gcc-5 GCC 5.x (2.066.1)]
 +
* [//gcc.gnu.org/gcc-6 GCC 6.x (2.068.2)]
 +
* [//gcc.gnu.org/gcc-7 GCC 7.x (2.076.0)]
 +
* [//gcc.gnu.org/gcc-8 GCC 8.x (2.081.1)]
 +
* [//gcc.gnu.org/snapshots.html GCC 9.x Development (2.081.1)]
 +
 
 +
== Installing GDC ==
 +
=== Linux distribution packages ===
 +
Official packages are available for these distributions
 +
* [https://packages.debian.org/search?keywords=gdc&searchon=names&exact=1&suite=all&section=all Debian]
 +
* [http://packages.ubuntu.com/search?keywords=gdc&searchon=names&exact=1&suite=all&section=all Ubuntu]
 +
* [https://www.archlinux.org/packages/community/x86_64/gdc/ Arch Linux]
 +
 
 +
For Gentoo Linux, GDC enabled ebuilds of GCC are available from the [https://github.com/gentoo/dlang dlang] overlay:
 +
* [https://wiki.gentoo.org/wiki/Dlang Gentoo Wiki: Dlang]
 +
Enable the ''d'' USE-flag for sys-devel/gcc and emerge it again. If you are currently on stable GCC you can install the GDC enabled testing version in parallel. gcc-config should be used to switch the active version temporarily if you would like to be able to run ''gdc'' without typing the full path.
 +
 
 +
=== Official prebuilt binaries ===
 +
Various precompiled toolchains are available on the [http://gdcproject.org/downloads/ official download page].
 +
 
 +
=== Detailed installation guide ===
 +
[[GDC/Installation|GDC/Installation]] contains detailed information on building and installing GDC alongside your system's host compilers.
  
 
== Documentation ==
 
== Documentation ==
=== Installation Guide ===
+
=== User Documentation ===
[[GDC/Installation|This documentation page]] includes information on building and installing GDC alongside your system's host compilers.
+
[[GDC/Using_GDC]] aims to explain some aspects of GDC such as its usage, differences from DMD, and known issues. If you need help using GDC, take a look here.
  
=== Developer Documentation ===
+
=== Target Documentation ===
[[GDC/Development|This documentation page]] includes information about the internals of GDC, and will most likely only be of use to you if you want to help with the development of GDC.
+
==== MinGW ====
 +
[[GDC/MinGW|This documentation page]] aims to explain aspects of the MinGW port of GDC.  Such as MinGW specific features, Windows specific topics and known issues.  A source code repository containing various patches and a build script can be found [https://github.com/venix1/MinGW-GDC here], but it may be out of date.
  
=== User Documentation ===
+
==== ARM Cortex-M ====
[[GDC/Using_GDC|This documentation page]] aims to explain a couple of aspects of GDC to user, such as its usage, differences from DMD, and known issues. If can't figure out how to use GDC, take a look here.
+
A minimal "Hello World!" example that requires no D runtime, no standard library (Phobos), and no C can be found [[Minimal semihosted ARM Cortex-M %22Hello_World%22 | here]].  It serves as an excellent starting point for anyone wishing to pursue their own port of D to the ARM Cortex-M family of microcontrollers.
  
== Target Documentation ==
+
Additionally, there is [https://bitbucket.org/timosi/minlibd minlibd].  A collection of libraries and tools to compile D language programs for embedded systems with the GDC compiler.
=== MinGW ===
 
[[GDC/MinGW|This documentation page]] aims to explain aspects of the MinGW port of GDC.  Such as MinGW specific features, Windows specific topics and known issues.
 
  
=== ARM Cortex-M ===
+
See also [[Bare Metal ARM Cortex-M GDC Cross Compiler]] for instructions specific to building a bare metal ARM Cortex-M GDC cross compiler.
In December 2013 an effort was launched to bring D to the ARM Cortex-M family of MCUs.  GDC is currently the compiler of choice, and development is currently taking place [https://github.com/JinShil/D_Runtime_ARM_Cortex-M_study/wiki/1.0-Introduction here].  
 
  
A minimal "Hello World!" example that requires no D runtime, no standard library (Phobos), and no C can be found [[Extremely_minimal_semihosted_"Hello_World" | here]].  It serves as an excellent starting point for anyone wishing to pursue their own port of D to the ARM Cortex-M family of microcontrollers.
+
=== Developer Documentation ===
 +
[[GDC/Development/DevelopmentEnvironment]] provides instructions on how to set up a development environment for hacking the GDC compiler.
  
==Binary Releases==
+
[[GDC/Hacking]] describes the structure of the GCC and GDC source code repositories.
  
GDC binaries are generally not distributed for Linux, as the details of building and installing it are quite distribution-specific. However, due to the difficulty of building GDC on Windows, Daniel Green has been building and posting binaries at https://bitbucket.org/goshawk/gdc/downloads.
+
[[GDC/Development]] contains information about the internals of GDC, and will be a valuable resource for those that wish to help with GDC's development.
  
 
== Support ==
 
== Support ==
Line 68: Line 85:
 
* Sending an inbox message to one of the maintainers.
 
* Sending an inbox message to one of the maintainers.
  
The D.gnu newsgroup should also be used for general discussion about GDC. A bug, proposal, or enhancement can go to the [//gdcproject.org/bugzilla issue tracker]. If you choose to use the issue tracker, please label the issue appropriately. (bug, proposal, enhancement)
+
The D.gnu newsgroup should also be used for general discussion about GDC. A bug, proposal, or enhancement can go to the [http://bugzilla.gdcproject.org/describecomponents.cgi issue tracker]. If you choose to use the issue tracker, please label the issue appropriately. (bug, proposal, enhancement)
  
 
=== Bugs ===
 
=== Bugs ===
A list of open bugs can be found [//bitbucket.org/goshawk/gdc/issues?status=new&status=open here.] Bugs created before this repository was made can be found [//d.puremagic.com/issues/buglist.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&product=DGCC+aka+GDC&content= here.] These lists are still maintained, however, new bugs should be submitted to the GDC Bugzilla site. A simple comment saying "This also happens/doesn't happen on Mac\Windows\Linux under GCC x.x.x(GCC version)" can be useful in helping solve the bug.
+
A list of open bugs can be found [http://bugzilla.gdcproject.org/describecomponents.cgi here.] New bugs should be submitted to the GDC Bugzilla site. A simple comment saying "This also happens/doesn't happen on Mac\Windows\Linux under GCC x.x.x(GCC version)" can be useful in helping solve the bug.
  
 
If you have found a possible bug in GDC, please submit it! Here are some guidelines that you should follow when submitting a bug:
 
If you have found a possible bug in GDC, please submit it! Here are some guidelines that you should follow when submitting a bug:
Line 83: Line 100:
  
 
== Getting Involved ==
 
== Getting Involved ==
There are a lot of things that you can do to get involved and help out with GDC. They vary from making simple documentation for some of the files, finding and submitting bugs, testing out bugs on different platforms, or submitting patches for GDC. Any help is appreciated.
 
  
Please see [[GDC/ProjectIdeas|Project Ideas]] for inspiration.
+
Please see [[GDC/GCCSubmission|Submission of D Front End]] for a list of open (and closed) tasks for the current GCC submission process.
 +
 
 +
Please see [[GDC/ProjectIdeas|Project Ideas]] for inspiration and long term goals.
 +
 
 +
GDC is currently developed by a very small group (as the commit history on GitHub shows). While the addition of a D frontend to GCC represents a great step forward for D, it also represents an informal promise by the D community to keep the D frontend up to date with the latest GCC development.
 +
 
 +
If you use GDC, we encourage you to try to contribute, whether by submitting pull requests or bug reports. In the past, GDC has nearly died due to poor communication and lack of development. Avoiding those issues is easier than ever before, but GDC will always need a community that's willing to give back.
  
Developers, please see [[GDC/Hacking|Hacking]]
+
Thanks to GitHub, contributing to GDC is as easy as forking the repository and submitting a pull request (although this workflow will likely change when the merge is officially complete), and filing a bug report is a simple web form.
  
==Quicklinks==
+
There are a lot of things that you can do to get involved and help out with GDC. They vary from making simple documentation for some of the files, finding and submitting bugs, testing out bugs on different platforms, or submitting patches for GDC. Any help is appreciated.
*[http://gcc.gnu.org/ GCC] (the GNU Compiler Collection)
 
*[http://www.gnu.org/software/gdb/gdb.html GDB] (the GNU Debugger)
 
  
Possibly out of date:
+
[[Category:GDC Compiler]]
*[http://www.dsource.org/projects/gdb-patches Patching GDB] to understand D code/mangling
 
*[http://dstress.kuehne.cn/www/dstress.html DStress], test cases for D compilers
 

Revision as of 19:35, 25 July 2019

Compilers: OverviewDMDGDCLDC

Welcome to GDC. This project aims to continue the development of GDC, a GCC frontend for the D programming language.

Useful Links

Introduction

What is GDC?

GDC is a frontend for the D programming language. By using GCC as a backend, it gives us the ability to target the same platforms that GCC targets.

This project was originally started by David Friedman. His first announcement can be found here and his original project page can be found here. Unfortunately, he disappeared from the D scene, and was no longer able to maintain GDC. This project was the result of an effort to help continue David Friedman's work on GDC.

The paperwork is complete and efforts are currently underway to merge GDC into the official GCC codebase, which represents a great step forward for D. However, more than ever, GDC is in need of contributors to keep it up to date with both the D frontend and the trunk development of the GCC backend.

Why GDC?

There are many advantages to adding a D frontend to GCC, and most of them stem from the fact that the GCC codebase has been the focus of extensive development over several decades, and that the GCC middle and back ends are designed such that multiple languages can easily take advantage of them. This means that a D frontend that can make use of the GCC middle and backend code will gain many advantages that would require years of development to match in the DMD codebase.

Firstly, GCC targets many more platforms than DMD.

Secondly, GCC has a very well-developed optimization framework that can generally generate more performant code than DMD, particularly when taking advantage of more recent CPU features such as SIMD instructions (both directly and through automatic vectorization).

Thirdly, GDB is primarily developed to debug code generated by GCC, so debugging code generated by GCC will generally result in a better user experience.

Status

D2 Frontend Versions: 2.068, 2.076, 2.081

Supported GCC versions

Installing GDC

Linux distribution packages

Official packages are available for these distributions

For Gentoo Linux, GDC enabled ebuilds of GCC are available from the dlang overlay:

Enable the d USE-flag for sys-devel/gcc and emerge it again. If you are currently on stable GCC you can install the GDC enabled testing version in parallel. gcc-config should be used to switch the active version temporarily if you would like to be able to run gdc without typing the full path.

Official prebuilt binaries

Various precompiled toolchains are available on the official download page.

Detailed installation guide

GDC/Installation contains detailed information on building and installing GDC alongside your system's host compilers.

Documentation

User Documentation

GDC/Using_GDC aims to explain some aspects of GDC such as its usage, differences from DMD, and known issues. If you need help using GDC, take a look here.

Target Documentation

MinGW

This documentation page aims to explain aspects of the MinGW port of GDC. Such as MinGW specific features, Windows specific topics and known issues. A source code repository containing various patches and a build script can be found here, but it may be out of date.

ARM Cortex-M

A minimal "Hello World!" example that requires no D runtime, no standard library (Phobos), and no C can be found here. It serves as an excellent starting point for anyone wishing to pursue their own port of D to the ARM Cortex-M family of microcontrollers.

Additionally, there is minlibd. A collection of libraries and tools to compile D language programs for embedded systems with the GDC compiler.

See also Bare Metal ARM Cortex-M GDC Cross Compiler for instructions specific to building a bare metal ARM Cortex-M GDC cross compiler.

Developer Documentation

GDC/Development/DevelopmentEnvironment provides instructions on how to set up a development environment for hacking the GDC compiler.

GDC/Hacking describes the structure of the GCC and GDC source code repositories.

GDC/Development contains information about the internals of GDC, and will be a valuable resource for those that wish to help with GDC's development.

Support

Support can be found in a couple of different places:

  • On irc.freenode.net, there is a GDC irc channel. It is channel #d.gdc.
  • The D.gnu newsgroup, located here.
  • Sending an inbox message to one of the maintainers.

The D.gnu newsgroup should also be used for general discussion about GDC. A bug, proposal, or enhancement can go to the issue tracker. If you choose to use the issue tracker, please label the issue appropriately. (bug, proposal, enhancement)

Bugs

A list of open bugs can be found here. New bugs should be submitted to the GDC Bugzilla site. A simple comment saying "This also happens/doesn't happen on Mac\Windows\Linux under GCC x.x.x(GCC version)" can be useful in helping solve the bug.

If you have found a possible bug in GDC, please submit it! Here are some guidelines that you should follow when submitting a bug:

  1. Make sure the bug has not already been submitted to GDC.
  2. Include the GCC version. (e.g. 4.7.0, etc)
  3. Include the git changeset you are using for GDC. (e.g. changset 6f03952ff48f)
  4. Include your operating system.(Mac/Windows/flavour of Linux)
  5. Include a simple test case demonstrating the issue.
  6. if possible, include a patch to fix the issue.

Getting Involved

Please see Submission of D Front End for a list of open (and closed) tasks for the current GCC submission process.

Please see Project Ideas for inspiration and long term goals.

GDC is currently developed by a very small group (as the commit history on GitHub shows). While the addition of a D frontend to GCC represents a great step forward for D, it also represents an informal promise by the D community to keep the D frontend up to date with the latest GCC development.

If you use GDC, we encourage you to try to contribute, whether by submitting pull requests or bug reports. In the past, GDC has nearly died due to poor communication and lack of development. Avoiding those issues is easier than ever before, but GDC will always need a community that's willing to give back.

Thanks to GitHub, contributing to GDC is as easy as forking the repository and submitting a pull request (although this workflow will likely change when the merge is officially complete), and filing a bug report is a simple web form.

There are a lot of things that you can do to get involved and help out with GDC. They vary from making simple documentation for some of the files, finding and submitting bugs, testing out bugs on different platforms, or submitting patches for GDC. Any help is appreciated.