# 用 DMD 成功构建 GDC 的实战指南

Original title: Bootstrapping GDC with DMD

> Hacker News story 48898032 · language: zh · submitted 2026-07-13
> Web version: https://zeli.app/zh/story/48898032
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 6 · by [LorenDB](<https://news.ycombinator.com/user?id=LorenDB>) · 💬 0
[original](<https://briancallahan.net/blog/20260713.html>) · [HN discussion](<https://news.ycombinator.com/item?id=48898032>)

## Summary

FreeBSD 系统上一直缺少 GDC 的官方软件包，作为研究人员，我不得不自己动手解决这个问题。GCC 官方文档声称构建 GDC 必须依赖 GDC 本身，但这听起来像是个死循环。我决定挑战这个假设，尝试用 DMD 来构建 GDC。事实证明，只要编写一个简单的 gdc-wrapper 来转换编译参数，DMD 完全有能力完成 stage1 GDC 的构建任务。整个过程比预想的简单得多，只需下载 DMD 二进制文件并配置好路径，就能在 FreeBSD 上顺利编译出 GDC 15.2.0 和 16.1.0。如果你也在 FreeBSD、NetBSD 或其他没有 GDC 包的 Linux 发行版上工作，这个方法或许能帮你省去大量时间。

## Key quote

> 文档中声称构建 GDC 必须使用 GDC 本身，但这部分内容感觉并未经过充分测试。

---

## Cite

- Page: https://zeli.app/zh/story/48898032
- Date: 2026-07-13
- Source: briancallahan.net (https://briancallahan.net/blog/20260713.html)
- Hacker News: https://news.ycombinator.com/item?id=48898032

## Other languages

- en: https://zeli.app/story/48898032 · markdown: https://zeli.app/story/48898032.md
- ja: https://zeli.app/ja/story/48898032 · markdown: https://zeli.app/ja/story/48898032.md
- ko: https://zeli.app/ko/story/48898032 · markdown: https://zeli.app/ko/story/48898032.md
- de: https://zeli.app/de/story/48898032 · markdown: https://zeli.app/de/story/48898032.md
- es: https://zeli.app/es/story/48898032 · markdown: https://zeli.app/es/story/48898032.md
