Repository navigation
php: all 514 translation units compile, via a host-built kencc - #727
Merged
Merged
Conversation
`sys/lib/tests/hostkencc/php-mirror.sh --compile' answers
`compiled 514, errors 0, missing 0'. The eight rounds before this
one each cost a VM rebuild to learn about one compile error; the new
mirror returned all eight at once, in six files, and all six are
fixed and re-measured here without the VM. The flag set and the
514-entry source list are both DERIVED from `cmd/php/mkfile' with
sed, so the mirror cannot drift from the build.
Three of the eight were kencc's:
* a pointer could not be assigned to a `bool'. `sub.c's stcompat
refused it -- tasign[TUCHAR] is BNUMBER, which excludes BIND --
before `com.c's boolnorm, which was already there at all four
converting sites, could run. C99 6.5.16.1 allows it outright.
boolptr-test.c covers the four sites at three pointer values;
sections 1 and 2 catch the wrong fix, which keeps the low byte.
* `bool visible;' declared nothing. lex.c's indeclname lists every
type specifier that can precede a declarator and was missing
LBOOL, so the declarator was swallowed as a GNU visibility
attribute. LCOMPLEX, LIMAGINARY, LCOMPLEXF and LCOMPLEXD are the
rest of that set and were added from the same reading.
* the __attribute__/__asm__ argument scanner counted parentheses
inside string literals, so php's generated debug_gdb_scripts.c --
one __asm__ holding 1680 .ascii lines with one unmatched `(' in
the text -- consumed the whole file. Literals are skipped whole
now, escapes included, and the diagnostic names the construct it
was actually scanning rather than __attribute__ for all six.
agree.c is identical before and after all three, and --probe still
answers ten regpair-min and eight regpair-probe with kc and vc
failing at :242. clisp's 31 TUs still compile clean.
Three were APE headers':
* <sys/time.h> had none of the BSD timeval macros; timerisset,
timerclear, timercmp, timeradd and timersub are there now, each
guarded, as bash's and libressl's own copies are.
* <syslog.h> was missing facilities 2, 6, 7, 8 and 11 -- LOG_MAIL,
LOG_LPR, LOG_NEWS, LOG_UUCP, LOG_FTP -- four of which are POSIX.
* <arpa/nameser.h> had the ns_ half and no compat half, so HEADER,
C_IN, T_A and GETSHORT did not exist. <arpa/nameser_compat.h> is
new and included from it as every other libc does; HEADER's
layout is checked byte for byte against the host's own header.
Fixing it uncovered that <resolv.h> had been defining the same
sixteen constants itself, which nothing could notice while no
translation unit included both. It now includes
<arpa/nameser.h> and keeps only the resolver's own names.
dn_skipname, defined by libap and declared by no header, is
declared there too.
One was the hand-answered config.h: HAVE_GETHOSTBYNAME_R yes with
every arity no, so main/network.c's gethostname_re was defined by no
arm. libap's is the glibc six-argument form.
One was php's: arithmetic on a `void *' in ext/random/csprng.c, a GNU
extension, in the one of that file's four sites this platform
compiles.
And one was the harness. A host-built 6c exited 1, deleted its own
output and printed nothing for one input: go1.4's lib9/await.c mallocs
its Waitmsg with a 200-byte message buffer and memsets only the
struct, so a child that exits 0 leaves msg[0] as whatever malloc left
there, and cc/lex.c:349 reads it as "the child failed". The file is
+build !plan9, so nothing on the VM reads it.
What is NOT measured is the link: the host has no libap and hostkencc
deliberately does not build the linkers.
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.
sys/lib/tests/hostkencc/php-mirror.sh --compile' answerscompiled 514, errors 0, missing 0'. The eight rounds before this one each cost a VM rebuild to learn about one compile error; the new mirror returned all eight at once, in six files, and all six are fixed and re-measured here without the VM. The flag set and the 514-entry source list are both DERIVED from `cmd/php/mkfile' with sed, so the mirror cannot drift from the build.Three of the eight were kencc's:
a pointer could not be assigned to a
bool'.sub.c's stcompat refused it -- tasign[TUCHAR] is BNUMBER, which excludes BIND -- before `com.c's boolnorm, which was already there at all four converting sites, could run. C99 6.5.16.1 allows it outright. boolptr-test.c covers the four sites at three pointer values; sections 1 and 2 catch the wrong fix, which keeps the low byte.`bool visible;' declared nothing. lex.c's indeclname lists every type specifier that can precede a declarator and was missing LBOOL, so the declarator was swallowed as a GNU visibility attribute. LCOMPLEX, LIMAGINARY, LCOMPLEXF and LCOMPLEXD are the rest of that set and were added from the same reading.
the attribute/asm argument scanner counted parentheses inside string literals, so php's generated debug_gdb_scripts.c -- one asm holding 1680 .ascii lines with one unmatched `(' in the text -- consumed the whole file. Literals are skipped whole now, escapes included, and the diagnostic names the construct it was actually scanning rather than attribute for all six.
agree.c is identical before and after all three, and --probe still answers ten regpair-min and eight regpair-probe with kc and vc failing at :242. clisp's 31 TUs still compile clean.
Three were APE headers':
<sys/time.h> had none of the BSD timeval macros; timerisset, timerclear, timercmp, timeradd and timersub are there now, each guarded, as bash's and libressl's own copies are.
<syslog.h> was missing facilities 2, 6, 7, 8 and 11 -- LOG_MAIL, LOG_LPR, LOG_NEWS, LOG_UUCP, LOG_FTP -- four of which are POSIX.
<arpa/nameser.h> had the ns_ half and no compat half, so HEADER, C_IN, T_A and GETSHORT did not exist. <arpa/nameser_compat.h> is new and included from it as every other libc does; HEADER's layout is checked byte for byte against the host's own header. Fixing it uncovered that <resolv.h> had been defining the same sixteen constants itself, which nothing could notice while no translation unit included both. It now includes <arpa/nameser.h> and keeps only the resolver's own names. dn_skipname, defined by libap and declared by no header, is declared there too.
One was the hand-answered config.h: HAVE_GETHOSTBYNAME_R yes with every arity no, so main/network.c's gethostname_re was defined by no arm. libap's is the glibc six-argument form.
One was php's: arithmetic on a `void *' in ext/random/csprng.c, a GNU extension, in the one of that file's four sites this platform compiles.
And one was the harness. A host-built 6c exited 1, deleted its own output and printed nothing for one input: go1.4's lib9/await.c mallocs its Waitmsg with a 200-byte message buffer and memsets only the struct, so a child that exits 0 leaves msg[0] as whatever malloc left there, and cc/lex.c:349 reads it as "the child failed". The file is +build !plan9, so nothing on the VM reads it.
What is NOT measured is the link: the host has no libap and hostkencc deliberately does not build the linkers.
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs