Skip to content

Claude/upgrade ape c library mm z gd - #598

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

staalmannen merged 2 commits into
mainfrom
claude/upgrade-ape-c-library-mmZGd

Conversation

@staalmannen

Copy link
Copy Markdown
Owner

No description provided.

claude added 2 commits October 7, 2026 03:20
apeabi-probe compiled twice and diffed on the VM.  Sixteen structs
move, in two families: the network address structs (each becoming the
value every other system reports -- sockaddr_in 24 -> 16) and the lock
and pthread structs (pthread_mutex_t 56 -> 40, QLock 32 -> 24), plus
termios.

Nothing in the stdio/stat core moves at all: FILE, struct stat, DIR,
jmp_buf, fd_set, tm, dirent, passwd, regex_t and sigset_t are byte for
byte identical, and those are the types the flag's own warning named as
the reason it has to be all-or-nothing.

/env/_fdinfo was checked rather than assumed: it is text, so there is
no cross-exec layout hazard there.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
pcc now passes -J on every compile.  It is done in pcc rather than
through CFLAGS or CC because both of those have holes: -J in
sys/src/ape/config reaches 32 of 137 mkfiles, since the other 105
assign CFLAGS= rather than appending $CFLAGS, and 59 mkfiles reassign
CC.  All 59 still name pcc.

The appends are unconditional and outside the if(!Aflag) block.  That
block does not run when -A or -B was given and cmd/cfront passes -B,
so putting them there would have missed the one package the flag was
built for.  They are also outside the argument loop, which runs once
per file.

Native 6c is untouched and keeps the 9front rule, which is what
cmd2/vts and vtwin need when they link the host's libc.a.

pcc -9 is the way back, and exists for the instruments rather than for
the build: structalign-test's control run and apeabi-probe's two
compiles are both differences between the two rules, and with no way to
ask for the old one neither could be taken again.  Nothing in the tree
passes -9.  -J is still accepted and now does nothing.

Measured before being turned on: sixteen structs move, the socket
family and the lock/pthread family plus termios, with nothing in the
stdio/stat core moving at all.

Needs mk distclean before mk install.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
@staalmannen
staalmannen merged commit 878697c 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