Skip to content

cfront: -J makes kencc agree with the translator on all seven - #596

Merged
staalmannen merged 1 commit into
mainfrom
claude/upgrade-ape-c-library-mmZGd
Oct 7, 2026
Merged

staalmannen merged 1 commit into
mainfrom
claude/upgrade-ape-c-library-mmZGd

Conversation

@staalmannen

Copy link
Copy Markdown
Owner

14 of 97 -> 7 with pcc -J. Every type cfront owns falls into line: node 3, name 144, basic_inst 168, funct_inst 200, state 88, templ_compilation 1, templ_inst 200. The seven left are the glibc types, which -J cannot touch because they describe the machine that generated the C, and the two _Q3 entries confirm the reading rather than vanishing: _C4 is 20 with kencc's 32-bit __clock_t against Linux's 32, _C6 is 8 against 16.

The two instruments never disagreed. structalign-test was compiled with -J and cfrontsz-probe without it, and I read them as the same compile for two rounds.

apeabi-probe.c is the instrument for the question that comes next. It is never run: compiled twice, pcc -a against pcc -J -a, and the diff of the two acid dumps names every APE struct whose layout -J moves, from the compiler itself, before a single object is rebuilt. 0 errors against the staged headers on the host.

And it is needed because the obvious way to turn -J on does not work. In sys/src/ape/config's CFLAGS it reaches 32 of 137 mkfiles: the other 105 assign CFLAGS= rather than appending $CFLAGS, and cmd/cfront/mkfile:52 is one of them. CC is no better, 59 mkfiles reassign it. Either would have produced the silent ABI split rather than a clean change. The only mechanism that reaches every APE compile is pcc itself, since all 59 reassignments still name pcc, and native 6c builds then keep the 9front rule that cmd2/vts and vtwin need against the host's libc.a.

Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs

14 of 97 -> 7 with pcc -J. Every type cfront owns falls into line:
node 3, name 144, basic_inst 168, funct_inst 200, state 88,
templ_compilation 1, templ_inst 200. The seven left are the glibc
types, which -J cannot touch because they describe the machine that
generated the C, and the two __Q3_ entries confirm the reading rather
than vanishing: _C4 is 20 with kencc's 32-bit __clock_t against
Linux's 32, _C6 is 8 against 16.

The two instruments never disagreed. structalign-test was compiled
with -J and cfrontsz-probe without it, and I read them as the same
compile for two rounds.

apeabi-probe.c is the instrument for the question that comes next.
It is never run: compiled twice, pcc -a against pcc -J -a, and the
diff of the two acid dumps names every APE struct whose layout -J
moves, from the compiler itself, before a single object is rebuilt.
0 errors against the staged headers on the host.

And it is needed because the obvious way to turn -J on does not
work. In sys/src/ape/config's CFLAGS it reaches 32 of 137 mkfiles:
the other 105 assign CFLAGS= rather than appending $CFLAGS, and
cmd/cfront/mkfile:52 is one of them. CC is no better, 59 mkfiles
reassign it. Either would have produced the silent ABI split rather
than a clean change. The only mechanism that reaches every APE
compile is pcc itself, since all 59 reassignments still name pcc,
and native 6c builds then keep the 9front rule that cmd2/vts and
vtwin need against the host's libc.a.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
@staalmannen
staalmannen merged commit a225409 into main Oct 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants