diff options
author | Andrei Alexeyev <akari@taisei-project.org> | 2023-09-27 11:43:23 +0200 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2024-09-24 10:25:12 -0700 |
commit | 798bf519035808aa4d86e6b58d7a6b3c5e4b2988 (patch) | |
tree | 1b2e90d59cfe63000a53c52f787f663f97dae467 /docs | |
parent | 6797f9bc1502609783a8fc465e2960819ab4f38f (diff) | |
download | meson-798bf519035808aa4d86e6b58d7a6b3c5e4b2988.zip meson-798bf519035808aa4d86e6b58d7a6b3c5e4b2988.tar.gz meson-798bf519035808aa4d86e6b58d7a6b3c5e4b2988.tar.bz2 |
linkers: basic support for the 'zig cc' linker
Diffstat (limited to 'docs')
-rw-r--r-- | docs/markdown/Reference-tables.md | 1 | ||||
-rw-r--r-- | docs/markdown/snippets/zig_ld.md | 18 |
2 files changed, 19 insertions, 0 deletions
diff --git a/docs/markdown/Reference-tables.md b/docs/markdown/Reference-tables.md index 7e0d6cf..e4e964c 100644 --- a/docs/markdown/Reference-tables.md +++ b/docs/markdown/Reference-tables.md @@ -62,6 +62,7 @@ These are return values of the `get_linker_id` method in a compiler object. | ld.mold | The fast MOLD linker | | ld.solaris | Solaris and illumos | | ld.wasm | emscripten's wasm-ld linker | +| ld.zigcc | The Zig linker (C/C++ frontend; GNU-like) | | ld64 | Apple ld64 | | ld64.lld | The LLVM linker, with the ld64 interface | | link | MSVC linker | diff --git a/docs/markdown/snippets/zig_ld.md b/docs/markdown/snippets/zig_ld.md new file mode 100644 index 0000000..8835c38 --- /dev/null +++ b/docs/markdown/snippets/zig_ld.md @@ -0,0 +1,18 @@ +## Zig 0.11 can be used as a C/C++ compiler frontend + +Zig offers +[a C/C++ frontend](https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html) as a drop-in replacement for Clang. It worked fine with Meson up to Zig 0.10. Since 0.11, Zig's +dynamic linker reports itself as `zig ld`, which wasn't known to Meson. Meson now correctly handles +Zig's linker. + +You can use Zig's frontend via a [machine file](Machine-files.md): + +```ini +[binaries] +c = ['zig', 'cc'] +cpp = ['zig', 'c++'] +ar = ['zig', 'ar'] +ranlib = ['zig', 'ranlib'] +lib = ['zig', 'lib'] +dlltool = ['zig', 'dlltool'] +``` |