You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* The c-abi probe on a Windows host strips the host's leaked macros; the wchar realisation on a freestanding target no longer assumes the toolchain default is 32 bits (2026.9.18.3)
* fix cenv: the freestanding branch must emit -fno-short-wchar unconditionally
bb0437d dropped the freestanding ? 32 : native_wchar_bits(os) special
case that 7097acd had added, on the grounds that it was wrong on
Windows hosts. That is right for the -U_<WIN32>-stripped probe, but
for the REAL compile (the one whose cflags the engine broadcasts to
the package's own translation units) the toolchain's freestanding
default on Windows is host-contaminated: clang on Windows emits a
16-bit wchar_t by default for -target=riscv64-none-elf unless told
otherwise. So a declaration of wchar=32 needs -fno-short-wchar on
every freestanding target regardless of what native_wchar_bits(os)
says, and the previous "if (decl.wcharBits != native)" gate lets a
32-bit declaration through to a 16-bit compile on Windows freestanding.
Symmetric for wchar=16: a freestanding Linux/macOS host's default
wchar is 32, and the declaration 16 needs -fshort-wchar. The
"hosted" branch (the else-if) keeps the old behaviour; only the
freestanding branch is restructured.
Verified locally with openkal-musl#37 and openkal-llvm-runtime#24's
matrix against mcpp built from this branch.
* cenv_probe: cacheRoot before hostStripMacros; presents=none emits -fno-short-wchar
The previous parameter order put hostStripMacros before cacheRoot. That
meant callers passing a custom cache directory (the test suite does this
in every TEST) had to also pass an empty hostStripMacros, even though
they did not care about the strip. Reordering puts cacheRoot first so
the strip's default value (`{}`) is what callers that override cache
actually mean, and tests that want to assert the strip's behaviour pass
both. prepare.cppm's call passes both, in the reordered order.
The "presents = none" wchar branch used to assert tokens.empty(). That
is wrong under the new freestanding-wchar rule: -fno-short-wchar is
emitted regardless of presents, because the wchar realisation is
about width (the toolchain's host-contaminated default), not about
identity (what macros the preprocessor states). Updated to assert the
flag's presence and the absence of any identity macros.
* test_cenv_probe: pin the strip parameter end-to-end against a name no host predefines
* test: re-trigger CI
---------
Co-authored-by: sunrisepeak <x.d2learn.org@gmail.com>
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
0 commit comments