Skip to content
Open
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
6 changes: 4 additions & 2 deletions .github/workflows/cross-build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ name: cross-build-test
# target | toolchain | host→target | run
# ----------------------|----------------------------------|---------------|-----
# aarch64-linux-musl | aarch64-linux-musl-gcc@16.1.0 | x86_64→arm64 | qemu
# riscv64-linux-musl | riscv64-linux-musl-gcc@16.1.0 | x86_64→riscv64| qemu
# x86_64-w64-mingw32 | mingw-cross-gcc@16.1.0 (MSVCRT) | linux→windows | wine
# x86_64-linux-musl | x86_64-linux-musl-gcc@16.1.0 | windows→linux | linux job
#
Expand Down Expand Up @@ -44,8 +45,6 @@ name: cross-build-test
# yet inject `-target <triple>` + a cross sysroot for a
# clang toolchain; cross `--target` resolves to gcc musl
# only. Wire the clang cross path first, then add a row.
# * riscv64-linux-musl: add once xim:riscv64-linux-musl-gcc ships to
# xlings-res + xim-pkgindex.

on:
push:
Expand All @@ -70,6 +69,9 @@ jobs:
- target: aarch64-linux-musl
file_arch: "ARM aarch64"
qemu_bin: qemu-aarch64-static
- target: riscv64-linux-musl
file_arch: "UCB RISC-V"
qemu_bin: qemu-riscv64-static
env:
MCPP_HOME: /home/runner/.mcpp
# Verbose every mcpp invocation for richer CI diagnostics (src/cli.cppm).
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ the right toolchain payload is resolved and installed automatically.
| `x86_64-windows-gnu` | gcc 16 MinGW-w64 — native on Windows, cross from Linux (wine-verified) *(Windows default without Visual Studio)* | ✅ |
| `x86_64-windows-msvc` | `msvc@system` (detected VS/BuildTools) or llvm ¹ *(Windows default with Visual Studio)* | ✅ |
| `aarch64-macos` | llvm *(macOS default)* | ✅ |
| `riscv64-linux-musl` | — | 🔄 |
| `riscv64-linux-musl` | gcc 16, fully static — cross from x86_64 (qemu-verified); base `rv64gc`/`lp64d` ISA, optional extensions (`-march=rv64gcv`, Zb*) pass through | ✅ |
| `aarch64-linux-gnu` | — | 🔄 |
| `x86_64-macos` | — | 🔄 |

Expand Down
2 changes: 1 addition & 1 deletion README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ mcpp 的身份模型是两条正交轴:**工具链** = `family@version`(family
| `x86_64-windows-gnu` | gcc 16 MinGW-w64——Windows 原生,Linux 交叉(wine 实测)(*无 Visual Studio 时的 Windows 默认*) | ✅ |
| `x86_64-windows-msvc` | `msvc@system`(探测 VS/BuildTools)或 llvm ¹(*有 Visual Studio 时的 Windows 默认*) | ✅ |
| `aarch64-macos` | llvm(*macOS 默认*) | ✅ |
| `riscv64-linux-musl` | — | 🔄 |
| `riscv64-linux-musl` | gcc 16,全静态——x86_64 交叉(qemu 实测);基础 `rv64gc`/`lp64d` ISA,可选扩展(`-march=rv64gcv`、Zb*)自行指定 | ✅ |
| `aarch64-linux-gnu` | — | 🔄 |
| `x86_64-macos` | — | 🔄 |

Expand Down
3 changes: 2 additions & 1 deletion docs/03-toolchains.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@ Targets:
* x86_64-linux-musl static gcc 16.1.0 installed
x86_64-windows-gnu PE, static, cross gcc 16.1.0 installed
aarch64-linux-musl static, cross gcc 16.1.0 available
riscv64-linux-musl static, cross — planned
riscv64-linux-musl static, cross gcc 16.1.0 available
aarch64-linux-gnu cross — planned

Available toolchains (run `mcpp toolchain install <family> <version>`):
gcc 15.1.0 / 13.3.0 / 11.5.0 / 9.4.0
Expand Down
3 changes: 2 additions & 1 deletion docs/zh/03-toolchains.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ Targets:
* x86_64-linux-musl static gcc 16.1.0 installed
x86_64-windows-gnu PE, static, cross gcc 16.1.0 installed
aarch64-linux-musl static, cross gcc 16.1.0 available
riscv64-linux-musl static, cross — planned
riscv64-linux-musl static, cross gcc 16.1.0 available
aarch64-linux-gnu cross — planned

Available toolchains (run `mcpp toolchain install <family> <version>`):
gcc 15.1.0 / 13.3.0 / 11.5.0 / 9.4.0
Expand Down
2 changes: 1 addition & 1 deletion src/toolchain/triple.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ inline constexpr TargetInfo kKnownTargets[] = {
{ "x86_64-windows-gnu", "verified", "PE", "gcc@16.1.0", true },
{ "x86_64-windows-msvc", "verified", "PE", "", false },
{ "aarch64-macos", "verified", "", "", false },
{ "riscv64-linux-musl", "planned", "", "", true },
{ "riscv64-linux-musl", "verified", "", "gcc@16.1.0", true },
{ "aarch64-linux-gnu", "planned", "", "", false },
{ "x86_64-macos", "planned", "", "", false },
};
Expand Down
20 changes: 16 additions & 4 deletions tests/e2e/103_target_vocabulary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,23 @@ grep -q "did you mean 'x86_64-linux-musl'" "$TMP/typo.log" || {
echo "FAIL: missing did-you-mean suggestion"; cat "$TMP/typo.log"; exit 1; }

# ── 2. planned tier: registered but unsupported → error, not a host build ───
if "$MCPP" build --target riscv64-linux-musl > "$TMP/planned.log" 2>&1; then
echo "FAIL: planned-tier target built"; cat "$TMP/planned.log"; exit 1
# The target is read out of `toolchain list` rather than hardcoded: this
# assertion is about the TIER, not about any particular triple, and every time a
# target gets promoted the hardcoded spelling stops being planned and the check
# silently becomes a test of something else (riscv64-linux-musl was the second
# one to go that way).
planned=$("$MCPP" toolchain list --no-color 2>/dev/null \
| awk '$NF == "planned" { print $1; exit }')
if [[ -z "$planned" ]]; then
echo "(no planned-tier target registered — step 2 skipped)"
else
if "$MCPP" build --target "$planned" > "$TMP/planned.log" 2>&1; then
echo "FAIL: planned-tier target '$planned' built"; cat "$TMP/planned.log"; exit 1
fi
grep -q "not yet supported" "$TMP/planned.log" || {
echo "FAIL: missing planned-tier error for '$planned'"
cat "$TMP/planned.log"; exit 1; }
fi
grep -q "not yet supported" "$TMP/planned.log" || {
echo "FAIL: missing planned-tier error"; cat "$TMP/planned.log"; exit 1; }

# ── 3. escape hatch: custom triple with an explicit [target.X] section ──────
# (pin the host gcc so resolution succeeds; the point is validation lets an
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_linkmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ TEST(LoaderFilename, TripleMap) {
EXPECT_EQ(tc::loader_filename("aarch64-linux-gnu"), "ld-linux-aarch64.so.1");
EXPECT_EQ(tc::loader_filename("x86_64-linux-musl"), "ld-musl-x86_64.so.1");
EXPECT_EQ(tc::loader_filename("aarch64-linux-musl"), "ld-musl-aarch64.so.1");
EXPECT_EQ(tc::loader_filename("riscv64-linux-musl"), "ld-musl-riscv64.so.1");
EXPECT_EQ(tc::loader_filename("riscv64-linux-gnu"), "ld-linux-riscv64-lp64d.so.1");
EXPECT_EQ(tc::loader_filename("wasm32-unknown-unknown"), "");
}

Expand Down
Loading