Skip to content

kencc: asm qualifiers and a lost character; php: the link's missing t… - #728

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

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

Conversation

@staalmannen

Copy link
Copy Markdown
Owner

…hree

php's objects all compiled and `6l' named four undefined symbols.

_volatile__', referenced by __jit_debug_register_code', is this compiler's. Zend/zend_gdb.c:59' is asm volatile("")', and GNU's grammar is asm [volatile] [inline] [goto] ( ... )' -- the lexer knew asm' and none of the qualifiers, so it looked for the opening paren, found an identifier and handed it to the parser, which called it. The qualifiers are skipped now and an identifier that is none of them is diagnosed, since the construct admits nothing else there. 50 vendored files use that spelling, across php, pcre2, m4, libpng, perl, libressl, gnulib, diffutils, coreutils, zlib and zstd.

Writing the two-line test for that found the second one, in the same block and much older: the no-argument branch ended unget(ac); goto l0;', and unget' only sets peekc' while l0' is below the peekc' test at the top of yylex' -- so the character was read straight past. __extension__ int yy;' compiled as nt yy;'. It lexes the character already in hand now, which is the idiom the `func' case below it already used.

The other three undefined names were lxb_dom_collection_create', _init' and _destroy', and the cause is a difference between the two compilers rather than a mistake: lxb_dom_collection_make' is a static inline' in a header that node.h' and element.h' both include, kencc emits an unused static function and gcc at -O2 discards it, and upstream's ext/lexbor/config.m4' therefore never needs to compile `dom/collection.c'. This build does, so the mkfile lists it.

And php-mirror.sh --undefined' now asks the link's question without a linker, which the previous commit's notes said was impossible: 6c -S' names every symbol a unit defines and references, so references minus global definitions minus each unit's own statics, over all 515, is what 6l' would complain about. php wants 283 symbols from outside itself and libap has all of them -- 273 that apfunc-sweep' names outright, and ten it misreports because they are assembly (getcontext, swapcontext), data (stdin, stdout, stderr, environ, h_errno, _ctype, _errnoloc) or spelled so that no definition-shaped regex matches (signal). Each of the ten was opened. Its positive control narrows the program to one unit and names the three lexbor symbols the VM's `6l' named.

So the link is predicted to succeed, and the refutation condition is a name outside those 283.

agree.c identical, --probe ten regpair-min and eight regpair-probe with kc and vc at :242, clisp's 31 TUs clean, php 515 of 515.

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

…hree

php's objects all compiled and `6l' named four undefined symbols.

`_volatile__', referenced by `__jit_debug_register_code', is this
compiler's.  `Zend/zend_gdb.c:59' is `__asm__ __volatile__("")', and
GNU's grammar is `asm [volatile] [inline] [goto] ( ... )' -- the
lexer knew `__asm__' and none of the qualifiers, so it looked for the
opening paren, found an identifier and handed it to the parser, which
called it.  The qualifiers are skipped now and an identifier that is
none of them is diagnosed, since the construct admits nothing else
there.  50 vendored files use that spelling, across php, pcre2, m4,
libpng, perl, libressl, gnulib, diffutils, coreutils, zlib and zstd.

Writing the two-line test for that found the second one, in the same
block and much older: the no-argument branch ended `unget(ac); goto
l0;', and `unget' only sets `peekc' while `l0' is below the `peekc'
test at the top of `yylex' -- so the character was read straight
past.  `__extension__ int yy;' compiled as `nt yy;'.  It lexes the
character already in hand now, which is the idiom the `__func__' case
below it already used.

The other three undefined names were `lxb_dom_collection_create',
`_init' and `_destroy', and the cause is a difference between the two
compilers rather than a mistake: `lxb_dom_collection_make' is a
`static inline' in a header that `node.h' and `element.h' both
include, kencc emits an unused static function and gcc at -O2
discards it, and upstream's `ext/lexbor/config.m4' therefore never
needs to compile `dom/collection.c'.  This build does, so the mkfile
lists it.

And `php-mirror.sh --undefined' now asks the link's question without
a linker, which the previous commit's notes said was impossible: `6c
-S' names every symbol a unit defines and references, so references
minus global definitions minus each unit's own statics, over all 515,
is what `6l' would complain about.  php wants 283 symbols from
outside itself and libap has all of them -- 273 that `apfunc-sweep'
names outright, and ten it misreports because they are assembly
(getcontext, swapcontext), data (stdin, stdout, stderr, environ,
h_errno, _ctype, _errnoloc) or spelled so that no definition-shaped
regex matches (signal).  Each of the ten was opened.  Its positive
control narrows the program to one unit and names the three lexbor
symbols the VM's `6l' named.

So the link is predicted to succeed, and the refutation condition is
a name outside those 283.

agree.c identical, --probe ten regpair-min and eight regpair-probe
with kc and vc at :242, clisp's 31 TUs clean, php 515 of 515.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs
@staalmannen
staalmannen merged commit 70f92cb into main Nov 5, 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