Repository navigation
cfront: -J makes kencc agree with the translator on all seven - #596
Merged
Merged
Conversation
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
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.
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