Repository navigation
kencc: asm qualifiers and a lost character; php: the link's missing t… - #728
Merged
Merged
Conversation
…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
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.
…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' isasm volatile("")', and GNU's grammar isasm [volatile] [inline] [goto] ( ... )' -- the lexer knewasm' 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;', andunget' only setspeekc' whilel0' is below thepeekc' test at the top ofyylex' -- so the character was read straight past.__extension__ int yy;' compiled asnt 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 astatic inline' in a header thatnode.h' andelement.h' both include, kencc emits an unused static function and gcc at -O2 discards it, and upstream'sext/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 what6l' would complain about. php wants 283 symbols from outside itself and libap has all of them -- 273 thatapfunc-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