Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions en/xclang/guide/comparisons.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ the documentation of each project, linked. Corrections are welcome as

| | what it is | targets out of the box | sysroots and SDKs | C++ runtime in programs | Linux programs run on | build systems | compiler built with PGO |
|---|---|---|---|---|---|---|---|
| **xclang** | clang, lld and six targets' runtimes, prebuilt | Linux x64/arm64, Windows x64/arm64 (MinGW, MSVC), macOS x64/arm64 | bundled; Apple's and Microsoft's SDKs fetched by the user from the vendor, or Xcode's | libc++, static; for MSVC targets, Microsoft's STL, static | glibc 2.17+ | CMake package, Bazel module, conda | yes, PGO + ThinLTO, every host |
| **xclang** | clang, lld and eight targets' runtimes, prebuilt | Linux x64/arm64 (glibc, musl), Windows x64/arm64 (MinGW, MSVC), macOS x64/arm64 | bundled; Apple's and Microsoft's SDKs fetched by the user from the vendor, or Xcode's | libc++, static; for MSVC targets, Microsoft's STL by choice | glibc 2.17+, or none (musl, static) | CMake package, Bazel module, conda | yes, PGO + ThinLTO, every host |
| **zig cc** 0.17 | Zig's driver around its clang | dozens: glibc, musl, MinGW, macOS, BSDs, WASI | libc sources and stubs bundled, built on first use | libc++, static | any glibc version chosen per target; 2.31 by default | `zig build`; `CC="zig cc"` | not stated |
| **cargo-zigbuild** | zig cc as cargo's linker | Linux, macOS, as its README lists | through zig; macOS SDK from the user | through zig | glibc version chosen per target | cargo | as zig |
| **cross-rs** | cargo in Docker images with GCC cross toolchains | most of Rust's Linux, Windows and other targets | per-target images; Apple and MSVC images built by the user | libstdc++ | 2.31; 2.17 in `:centos` images | cargo | no; GCC |
Expand All @@ -34,15 +34,15 @@ work. It differs from xclang in how it gets there:
builds what a target needs the first time, then caches it
([overview](https://ziglang.org/learn/overview/)). That is how it fits
dozens of targets in a 55 MB download. xclang ships the runtimes of its
six targets prebuilt: no first-build delay, and the same bytes for
eight targets prebuilt: no first-build delay, and the same bytes for
everyone. Fetching other targets as prebuilt archives is
[planned](../design/roadmap.md#target-archives).
- **It has more targets today**: musl, any glibc version per target
- **It has more targets today**: any glibc version per target
(`x86_64-linux-gnu.2.17`), the BSDs and WASI. It also builds for macOS
from any host, with Apple's libc headers and a `libSystem` stub
([0.17.0 release notes](https://ziglang.org/download/0.17.0/release-notes.html)).
In xclang, the musl targets are in every archive from 23.1.2.10 on
([musl targets](../reference/targets.md#musl-targets)), and a newer
xclang has musl in every archive since 23.1.2.10
([musl targets](../reference/targets.md#musl-targets)); a newer
glibc and the BSDs are [considered](../design/roadmap.md#glibc-newer).
xclang builds for macOS from any host too, with Apple's own SDK, which
the user fetches
Expand Down Expand Up @@ -121,8 +121,8 @@ ThinLTO on Linux and macOS (`clang/cmake/caches/Release.cmake`), and with
PGO but no LTO on Windows. They carry no sysroot for another target, so a
cross build needs one from elsewhere. An archive is 0.9 to 2 GB.

xclang 23.1.2.1 was built by them. xclang's archives are 86 to 94 MB,
carry six targets, and run on glibc 2.17. On compile speed they are close
xclang 23.1.2.1 was built by them. xclang's archives are 89 to 97 MB,
carry eight targets, and run on glibc 2.17. On compile speed they are close
on Linux and macOS ([PGO](../design/pgo.md#what-it-buys) has the numbers).

## Distribution Clang and GCC Cross Toolchains
Expand Down
2 changes: 1 addition & 1 deletion en/xclang/guide/what-is-xclang.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
xclang is a clang toolchain for cross-compiling, the way rustup, cross-rs
and cargo-zigbuild let Rust do it: one compiler for every target. One
directory holds the compiler, the linker and the binary tools. It also
holds, for six targets, the *sysroot* (the C library's headers and
holds, for eight targets, the *sysroot* (the C library's headers and
libraries) and the runtimes. Cross-compiling is a `--target` flag and
nothing else:

Expand Down
2 changes: 1 addition & 1 deletion en/xclang/guide/why-xclang.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ C++ builds.
|---|---|---|
| [Reproducible](#reproducible) | one pinned toolchain; Bazel builds that are the same bytes in any checkout | [the Bazel module](../design/bazel-module.md) |
| [Portable programs](#portable-programs) | a program runs on any machine of its target, as one file | [hermeticity](../design/hermeticity.md) |
| [Cross-compiling is a flag](#cross-compiling-is-a-flag) | one compiler version for six targets, no sysroots to install | [cross-compiling](cross-compiling.md) |
| [Cross-compiling is a flag](#cross-compiling-is-a-flag) | one compiler version for eight targets, no sysroots to install | [cross-compiling](cross-compiling.md) |
| [Correct build caches](#correct-build-caches) | a cache never serves objects of another compiler | [the Bazel module](../design/bazel-module.md#every-toolchain-file-is-an-input) |
| [C++20 modules](#c-20-modules) | `import std` in CMake 3.28 or later without experimental switches, and in Bazel | [C++20 modules](../features/modules.md) |
| [Fast](#fast) | clang and lld built with PGO and ThinLTO, on every host | [PGO](../design/pgo.md) |
Expand Down
2 changes: 1 addition & 1 deletion en/xclang/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ hero:

features:
- title: Cross-Compiling
details: A --target flag is all it takes. The sysroots, libc++ and lld for all six targets come with the toolchain.
details: A --target flag is all it takes. The sysroots, libc++ and lld for all eight targets come with the toolchain.
link: ./guide/cross-compiling
- title: Self-Contained Programs
details: "A program loads only what its OS has: glibc 2.17 or later, the Windows DLLs, or libSystem. Everything else is linked in."
Expand Down
Loading