fix(toolchain): clang cfg gains the C-header axis (v0.0.84)#198
Merged
Conversation
fixup_clang_cfg's regenerated cfg covered the link axis (-B/-L/loader/ rpath) but omitted the C library and kernel headers — a direct `clang hello.c` only worked when the HOST happened to ship /usr/include (silently non-hermetic; hard failure on header-less machines). The cfg now carries -isystem for the glibc payload headers and the linux-headers payload, ordered AFTER the libc++ block (its C-header wrappers reach libc via #include_next) — byte-consistent with what xim-pkgindex's llvm.lua install hook generates, so the two cfg writers can no longer diverge. The C driver cfg (clang.cfg) gets the headers directly; the C++ cfg gets them after the libc++ includes. Fixup rev bumped to hermetic-3 so existing payloads re-converge on their next build. Verified with host headers masked (--sysroot=<empty dir>): cfg-driven bare clang and clang++ both compile and run; negative control without the payload headers fails as expected. mcpp's own builds are unaffected (the link model has always supplied its own header flags).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Companion to openxlings/xim-pkgindex#340 (which fixes the install-time cfg writer): mcpp's cfg regenerator must emit identical content, otherwise the first mcpp resolve on a machine would overwrite the corrected cfg back to the header-less form.
What:
fixup_clang_cfgadds the missing header-search entries —-isystem <glibc payload>/include+-isystem <linux-headers payload>/include, ordered after the libc++ block to preserve the#include_nextchain. Fixup rev →hermetic-3so existing payloads re-converge on their next build (no reinstall required).Scope: the cfg serves direct invocations of the bundled
clang/clang++(outside mcpp). Without these entries such invocations compile only when the host system ships/usr/include— a host-environment dependency that violates the sandbox self-containment constraint, and a hard missing-header failure on hosts without development headers. mcpp's own build path is unaffected either way (build flags come from the link model; the cfg is never read).Verified: hermetic-3 regeneration on a real payload; direct
clang/clang++invocations with host headers masked (--sysroot=<empty dir>) compile and run; the control without the payload header entries fails as expected; unit suite + e2e 86/37 green.Version: 0.0.84 (behavior change in a released fixup artifact + rev bump).