LDMD2(1)

πŸ’– LDMD2(1) πŸ’–

okay bestie, deep breath, because this is THE page: LDMD2 πŸ’… it's the LLVM D Compiler β€” specifically the DMD-compatible driver β€” and the manual name is literally LDMD2(1), right there in the header, no cap. Grab a snack πŸ“, this one's long, and we're only on part 1.


🌸 NAME 🌸

LDMD2 β€” LLVM D Compiler (DMD-compatible driver) ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

πŸ‘‘ It's LDC, bestie (the LLVM D compiler, 1.42.0)

So the whole vibe is this: LDC - the LLVM D compiler (1.42.0):

based on DMD v2.112.1 and LLVM 19.1.7 built with LDC - the LLVM D compiler (1.42.0) Default target: x86_64-pc-linux-gnu Host CPU: skylake https://dlang.org - https://wiki.dlang.org/LDC

translation: it's built on DMD v2.112.1 and LLVM 19.1.7, compiled with LDC - the LLVM D compiler (1.42.0), targeting x86_64-pc-linux-gnu by default, running on a skylake host CPU. the links are https://dlang.org and https://wiki.dlang.org/LDC β€” go look, they're right there 🫢

🎯 Registered Targets

these are all the targets it's registered for, and yes you're gonna read every single one, periodt:

  • aarch64 β€” AArch64 (little endian)
  • aarch64_32 β€” AArch64 (little endian ILP32)
  • aarch64_be β€” AArch64 (big endian)
  • amdgcn β€” AMD GCN GPUs
  • arm β€” ARM
  • arm64 β€” ARM64 (little endian)
  • arm64_32 β€” ARM64 (little endian ILP32)
  • armeb β€” ARM (big endian)
  • avr β€” Atmel AVR Microcontroller
  • bpf β€” BPF (host endian)
  • bpfeb β€” BPF (big endian)
  • bpfel β€” BPF (little endian)
  • hexagon β€” Hexagon
  • lanai β€” Lanai
  • loongarch32 β€” 32-bit LoongArch
  • loongarch64 β€” 64-bit LoongArch
  • m68k β€” Motorola 68000 family
  • mips β€” MIPS (32-bit big endian)
  • mips64 β€” MIPS (64-bit big endian)
  • mips64el β€” MIPS (64-bit little endian)
  • mipsel β€” MIPS (32-bit little endian)
  • msp430 β€” MSP430 [experimental]
  • nvptx β€” NVIDIA PTX 32-bit
  • nvptx64 β€” NVIDIA PTX 64-bit
  • ppc32 β€” PowerPC 32
  • ppc32le β€” PowerPC 32 LE
  • ppc64 β€” PowerPC 64
  • ppc64le β€” PowerPC 64 LE
  • r600 β€” AMD GPUs HD2XXX-HD6XXX
  • riscv32 β€” 32-bit RISC-V
  • riscv64 β€” 64-bit RISC-V
  • sparc β€” Sparc
  • sparcel β€” Sparc LE
  • sparcv9 β€” Sparc V9
  • systemz β€” SystemZ
  • thumb β€” Thumb
  • thumbeb β€” Thumb (big endian)
  • ve β€” VE
  • wasm32 β€” WebAssembly 32-bit
  • wasm64 β€” WebAssembly 64-bit
  • x86 β€” 32-bit X86: Pentium-Pro and above
  • x86-64 β€” 64-bit X86: EM64T and AMD64
  • xcore β€” XCore
  • xtensa β€” Xtensa 32

🐚 Usage

here's the shape of it, bestie:

ldmd2 [<option>...] <file>...
ldmd2 [<option>...] -run <file> [<arg>...]

Where:

  • <file> β€” a D source file
  • <arg> β€” Argument to pass when running the resulting program

πŸ’… The <option> Menu πŸ’…

every single flag. all of them. i am not skipping a one 🫑

  • @<cmdfile> β€” read arguments from cmdfile, so you don't have to type them all yourself
  • -allinst β€” generate code for all template instantiations
  • -betterC β€” omit generating some runtime information and helper functions
  • -boundscheck=[on|safeonly|off] β€” bounds checks on, in @safe only, or off β€” pick one πŸŽ€
  • -c β€” compile only, do not link
  • -check=[assert|bounds|in|invariant|out|switch][=[on|off]] β€” enable or disable specific checks
  • -checkaction=[D|C|halt|context] β€” behavior on assert/boundscheck/finalswitch failure
  • -color β€” turn colored console output on 🌈
  • -color=[on|off|auto] β€” force colored console output on or off, or only when not redirected (default)
  • -conf=<filename> β€” use config file at filename
  • -cov β€” do code coverage analysis
  • -cov=ctfe β€” include code executed during CTFE in coverage report
  • -cov=<nnn> β€” require at least nnn% code coverage
  • -D β€” generate documentation
  • -Dd<directory> β€” write documentation file to directory
  • -Df<filename> β€” write documentation file to filename
  • -d β€” silently allow deprecated features and symbols
  • -de β€” issue an error when deprecated features or symbols are used (halt compilation)
  • -dw β€” issue a message when deprecated features or symbols are used (default)
  • -debug β€” compile in debug code
  • -debug=<level> β€” compile in debug code <= level
  • -debug=<ident> β€” compile in debug code identified by ident
  • -debuglib=<name> β€” set symbolic debug library to name
  • -defaultlib=<name> β€” set default library to name
  • -deps β€” print module dependencies (imports/file/version/debug/lib)
  • -deps=<filename> β€” write module dependencies to filename (only imports)
  • -dllimport=<value> β€” Windows only: select symbols to dllimport (none/defaultLibsOnly/externalOnly/all)
  • -edition[=<NNNN>[<filename>]] β€” set language edition to edition year, apply to <filename>
  • -extern-std=<standard> β€” set C++ name mangling compatibility with standard
  • -fIBT β€” generate Indirect Branch Tracking code
  • -fPIC β€” generate position independent code
  • -ftime-trace β€” turn on compile time profiler, generate JSON file with results
  • -ftime-trace-granularity= β€” minimum time granularity (in microseconds) traced by time profiler (default: 500)
  • -ftime-trace-file=<filename> β€” specify output file for -ftime-trace
  • -g β€” add symbolic debug info
  • -gdwarf=<version> β€” add DWARF symbolic debug info
  • -gf β€” emit debug info for all referenced types
  • -gs β€” always emit stack frame
  • -H β€” generate 'header' file
  • -Hd=<directory> β€” write 'header' file to directory
  • -Hf=<filename> β€” write 'header' file to filename
  • -HC[=[silent|verbose]] β€” write C++ 'header' equivalent to stdout
  • -HCd=<directory> β€” write C++ 'header' file to directory
  • -HCf=<filename> β€” write C++ 'header' file to filename instead of stdout
  • --help β€” print help and exit
  • -I=<directory> β€” look for imports also in directory
  • -extI=<directory> β€” look for imports that are out of the currently compiling binary, used to set the module as DllImport
  • -i[=<pattern>] β€” include imported modules in the compilation
  • -identifiers=<table> β€” specify the non-ASCII tables for D identifiers
  • -identifiers-importc=<table> β€” specify the non-ASCII tables for ImportC identifiers
  • -ignore β€” deprecated flag, unsupported pragmas are always ignored now
  • -inline β€” do function inlining
  • -J=<directory> β€” look for string imports also in directory
  • -L=<linkerflag> β€” pass linkerflag to link
  • -lib β€” generate library rather than object files
  • -lowmem β€” enable garbage collection for the compiler
  • -m32 β€” generate 32 bit code
  • -m64 β€” generate 64 bit code
  • -main β€” add default main() if not present already (e.g. for unittesting)
  • -makedeps[=<filename>] β€” print dependencies in Makefile compatible format to filename or stdout
  • -man β€” open web browser on manual page
  • -mcpu=<id> β€” generate instructions for architecture identified by 'id'
  • -mcpu=[h|help|?] β€” list all architecture options
  • -mixin=<filename> β€” expand and save mixins to file specified by <filename>
  • -mscrtlib=<libname> β€” MS C runtime library to reference from main/WinMain/DllMain
  • -mv=<package.module>=<filespec> β€” use <filespec> as source file for <package.module>
  • -noboundscheck β€” no array bounds checking (deprecated, use -boundscheck=off)
  • -nothrow β€” assume no Exceptions will be thrown
  • -O β€” optimize πŸ”₯
  • -o- β€” do not write object file
  • -od=<directory> β€” write object & library files to directory
  • -of=<filename> β€” name output file to filename
  • -op β€” preserve source path for output files
  • -oq β€” write object files with fully qualified file names
  • -P=<preprocessorflag> β€” pass preprocessorflag to C preprocessor
  • -preview=<name> β€” enable an upcoming language change identified by 'name'
  • -preview=[h|help|?] β€” list all upcoming language changes
  • -profile β€” profile runtime performance of generated code
  • -release β€” contracts and asserts are not emitted, and bounds checking is performed only in @safe functions
  • -revert=<name> β€” revert language change identified by 'name'
  • -revert=[h|help|?] β€” list all revertable language changes
  • -run <srcfile> β€” compile, link, and run the program srcfile
  • -shared β€” generate shared library (DLL)
  • -target=<triple> β€” use <triple> as <arch>-[<vendor>-]<os>[-<cenv>[-<cppenv]]
  • -transition=<name> β€” help with language change identified by 'name'
  • -transition=[h|help|?] β€” list all language changes
  • -unittest β€” compile in unit tests
  • -v β€” verbose πŸ‘€
  • -vasm β€” generate additional textual assembly files (.s)
  • -vcolumns β€” print character (column) numbers in diagnostics
  • -vdmd β€” print the underlying LDC command line
  • -verror-style=[digitalmars|gnu|sarif] β€” set the style for file/line number annotations on compiler messages
  • -verror-supplements=<num> β€” limit the number of supplemental messages for each error (0 means unlimited)
  • -verrors=<num> β€” limit the number of error/deprecation messages (0 means unlimited)
  • -verrors=[context|simple] β€” set the verbosity of error messages
  • -verrors=spec β€” show errors from speculative compiles such as __traits(compiles,...)
  • --version β€” print compiler version and exit
  • -version=<level> β€” compile in version code >= level
  • -version=<ident> β€” compile in version code identified by ident
  • -vgc β€” list all gc allocations including hidden ones
  • -visibility=<value> β€” default visibility of symbols (default/hidden/public)
  • -vtemplates=[list-instances] β€” list statistics on template instantiations
  • -vtls β€” list all variables going into thread local storage
  • -w β€” warnings as errors (compilation will halt) πŸ’€
  • -wi β€” warnings as messages (compilation will continue)
  • -X β€” generate JSON file
  • -Xf=<filename> β€” write JSON file to filename
  • -Xcc=<driverflag> β€” pass driverflag to linker driver (cc)

and then, bestie, the page does the thing where it repeats itself πŸŒ€ β€” here it comes again, same energy, same words:

based on DMD v2.112.1 and LLVM 19.1.7 built with LDC - the LLVM D compiler (1.42.0) Default target: x86_64-pc-linux-gnu Host CPU: skylake https://dlang.org - https://wiki.dlang.org/LDC

🎯 Registered Targets

  • aarch64 β€” AArch64 (little endian)
  • aarch64_32 β€” AArch64 (little endian ILP32)
  • aarch64_be β€” AArch64 (big endian)
  • amdgcn β€” AMD GCN GPUs
  • arm β€” ARM
  • arm64 β€” ARM64 (little endian)
  • arm64_32 β€” ARM64 (little endian ILP32)
  • armeb β€” ARM (big endian)
  • avr β€” Atmel AVR Microcontroller
  • bpf β€” BPF (host endian)
  • bpfeb β€” BPF (big endian)
  • bpfel β€” BPF (little endian)
  • hexagon β€” Hexagon
  • lanai β€” Lanai

...and that's exactly where part 1 cuts off mid-target-list 😭 so don't you dare go anywhere, there's more, we are NOT done 🫢

…and bestie, the target roster just keeps going, so here's every single one, no skips, no edits, exactly as the compiler spells them ✨

  • loongarch32 β€” 32-bit LoongArch
  • loongarch64 β€” 64-bit LoongArch
  • m68k β€” the Motorola 68000 family, a certified vintage icon πŸ•°οΈ
  • mips β€” MIPS, 32-bit, big endian
  • mips64 β€” MIPS, 64-bit, big endian
  • mips64el β€” MIPS, 64-bit, little endian
  • mipsel β€” MIPS, 32-bit, little endian
  • msp430 β€” MSP430, marked [experimental] so pls hold its hand πŸ™ˆ
  • nvptx β€” NVIDIA PTX, 32-bit
  • nvptx64 β€” NVIDIA PTX, 64-bit
  • ppc32 β€” PowerPC 32
  • ppc32le β€” PowerPC 32 LE
  • ppc64 β€” PowerPC 64
  • ppc64le β€” PowerPC 64 LE
  • r600 β€” AMD GPUs, HD2XXX–HD6XXX
  • riscv32 β€” 32-bit RISC-V
  • riscv64 β€” 64-bit RISC-V
  • sparc β€” Sparc
  • sparcel β€” Sparc LE
  • sparcv9 β€” Sparc V9
  • systemz β€” SystemZ
  • thumb β€” Thumb
  • thumbeb β€” Thumb, big endian
  • ve β€” VE
  • wasm32 β€” WebAssembly, 32-bit
  • wasm64 β€” WebAssembly, 64-bit
  • x86 β€” 32-bit X86: Pentium-Pro and above
  • x86-64 β€” 64-bit X86: EM64T and AMD64
  • xcore β€” XCore
  • xtensa β€” Xtensa 32

And that's the whole vibe check, bestie β€” every architecture present and accounted for, not one of them ghosted πŸ’…

That's a wrap on this page. The version stamped at the bottom is LDC 1.42.0, it's dated June 2026, and the whole thing lives in manual section LDMD2(1) β€” so if you need to cite it, that's your receipt πŸ§ΎπŸ’– Go forth and compile something iconic, you absolute main character 🫢🌈

πŸ“¦ where this page comes from