Crafter.Build/implementations
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Jorijn van der Graaf 3c96d78a7d
fix(sysroot): compile against the sysroot's libc++ headers
clang's driver ranks the host toolchain's own libc++ headers
(<install>/../include/c++/v1) above --sysroot. BuildStdPcm has forced
the sysroot's copy for the std module for that reason, but ordinary
compiles did not. A unit that only does `import std;` never noticed. A
unit that includes a standard header textually got the host's libc++,
configured for the host's libc: cross-building Crafter.Graphics for
aarch64 musl, Crafter.Asset's vendored gdeflate died on <chrono> with
"unknown rune table for this platform". Against a glibc sysroot the
same unit would compile against the wrong libc++ release and say
nothing.

Every non-wasm, non-mingw compile with a sysroot now gets
`-nostdinc++ -isystem <sysroot>/usr/include/c++/v1`. wasm has its own
sysroot handling and mingw is a libstdc++ target.

-nostdinc++ leaves -stdlib=libc++ unused on each compile, which clang
reports once per unit, so the command also carries
-Wno-unused-command-line-argument. The cost is that the driver's
unused-argument diagnostics are silent on sysroot builds, including for
a user's own misplaced flag (a -l or -Wl, option in compileFlags).

Not addressed: external cmake dependencies are still configured
without the target or the sysroot, and objects already built in an
existing sysroot build directory are not invalidated by the new flags.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-06 16:50:41 +02:00
..
Crafter.Build-Asset.cpp linting 2026-07-23 01:24:42 +02:00
Crafter.Build-Clang.cpp fix(sysroot): compile against the sysroot's libc++ headers 2026-10-06 16:50:41 +02:00
Crafter.Build-External.cpp feat(toolchain): resolve the compiler in one place 2026-10-02 22:26:31 +02:00
Crafter.Build-Implementation.cpp fix: decide a build step by its exit code, not by whether it printed 2026-08-26 00:51:15 +00:00
Crafter.Build-Interface.cpp fix: decide a build step by its exit code, not by whether it printed 2026-08-26 00:51:15 +00:00
Crafter.Build-Lint.cpp feat(toolchain): resolve the compiler in one place 2026-10-02 22:26:31 +02:00
Crafter.Build-Platform.cpp fix(host-cache): hash every part of the project.so stamp 2026-10-06 16:50:41 +02:00
Crafter.Build-Progress.cpp refactor: drop Windows host support 2026-10-02 22:03:34 +02:00
Crafter.Build-Shader.cpp feat(shader): per-entry defines and a named output variant 2026-10-06 16:50:41 +02:00
Crafter.Build-Test.cpp feat(toolchain): resolve the compiler in one place 2026-10-02 22:26:31 +02:00
Crafter.Build-Toolchain.cpp fix(sysroot): take the std module source from the sysroot's libc++ release 2026-10-03 16:37:00 +02:00
main.cpp refactor: drop Windows host support 2026-10-02 22:03:34 +02:00