LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

gdc

GNU D Compiler for the D programming language

TLDR

Compile D file
$ gdc [source.d] -o [output]
copy
Compile with optimization
$ gdc -O2 [source.d] -o [output]
copy
Enable debug info
$ gdc -g [source.d] -o [output]
copy
Compile only
$ gdc -c [source.d]
copy
Link with library
$ gdc [source.d] -l[library] -o [output]
copy

SYNOPSIS

gdc [options] files...

DESCRIPTION

gdc is the GNU D Compiler, providing a D programming language frontend for the GCC (GNU Compiler Collection) backend. It compiles D source code to native machine code using GCC's proven optimization infrastructure and code generation capabilities.The compiler supports the D2 language specification, including modern features like compile-time function execution (CTFE), mixins, templates, and garbage collection. As a GCC frontend, gdc integrates seamlessly with the GNU toolchain, accepting familiar GCC flags for optimization levels, debugging, linking, and cross-compilation.gdc benefits from GCC's extensive platform support, making D code portable across architectures that GCC supports. It leverages GCC's mature optimization passes, often producing highly efficient native code. The compiler can interoperate with C and C++ code through D's foreign function interface capabilities.While the reference D compiler (DMD) typically implements new language features first, gdc provides broader platform support and benefits from GCC's optimization technology. It's a solid choice for D development when maximum portability, GCC ecosystem integration, or specific optimization characteristics are priorities.

PARAMETERS

FILES

D source files to compile.
-o FILE
Output filename.
-c
Compile only, no linking.
-g
Generate debug information.
-O LEVEL
Optimization level (0-3).
-I PATH
Import path.
-L FLAG
Linker flag.
--help
Display help information.

INSTALL

sudo apt install gdc
copy
sudo dnf install gcc-gdc
copy
sudo apk add gcc-gdc
copy

CAVEATS

May lag behind reference DMD compiler. Some D features may differ. GCC version dependencies.

HISTORY

gdc was developed to bring the D programming language to GCC, providing an alternative to the reference DMD compiler with broader platform support.

SEE ALSO

gcc(1), dmd(1), ldc(1), dub(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid