Repository navigation
edg: LIB= must precede the mkone include, or the archive never links - #613
Merged
Merged
Conversation
-C works: every `redefinition:' is gone, and what is underneath is `undefined:' on `_ZN3edg...I...E' names -- template instantiations, every one, with no vtable, no typeinfo and no plain C function among them. That is the prediction this file recorded, confirmed. But `_ZnwyPv' -- placement new, the one symbol cpfe needs from libedg.a -- is undefined too, and that is mine. I wrote `LIB=' AFTER `<$APEXPROOT/sys/src/cmd/mkone'. mkone's rule is `$O.out: $OFILES $LIB' and mk binds a rule's prerequisites when it READS the rule, so the assignment expanded to nothing and the archive never reached the link line: the run ends `... types.6 unicode_name_fsm.6' with no archive on it. It fails in the quietest way available -- the link runs, looks right, and reports the archive's symbols as undefined. Every other cmd mkfile here (tclsh, wish, itclsh) sets LIB before the include; moved, with the reason written beside it. And the remaining fix is a RE-TRANSLATION rather than anything in a mkfile. EDG's own option table, readable in the committed corpus at src/cmd_line.c, gives `--instantiate' with values used/all/local/none and short form -t. -tused emits every used template in every translation unit with external linkage, which produces duplicates -- exactly what -C now discards, so the two go together and neither is sufficient alone. -tlocal would give each unit an internal-linkage copy and need no -C, at the cost of a copy per unit. -tused is the better pair, because -C is needed either way: the non-template duplicates (inline members like edg::skip_typerefs at 41 copies, and 499 function-local statics) are untouched by any instantiation mode. 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.
-C works: every
redefinition:' is gone, and what is underneath isundefined:' on `_ZN3edg...I...E' names -- template instantiations, every one, with no vtable, no typeinfo and no plain C function among them. That is the prediction this file recorded, confirmed.But
_ZnwyPv' -- placement new, the one symbol cpfe needs from libedg.a -- is undefined too, and that is mine. I wroteLIB=' AFTER<$APEXPROOT/sys/src/cmd/mkone'. mkone's rule is$O.out: $OFILES $LIB' and mk binds a rule's prerequisites when it READS the rule, so the assignment expanded to nothing and the archive never reached the link line: the run ends `... types.6 unicode_name_fsm.6' with no archive on it. It fails in the quietest way available -- the link runs, looks right, and reports the archive's symbols as undefined. Every other cmd mkfile here (tclsh, wish, itclsh) sets LIB before the include; moved, with the reason written beside it.And the remaining fix is a RE-TRANSLATION rather than anything in a mkfile. EDG's own option table, readable in the committed corpus at src/cmd_line.c, gives `--instantiate' with values used/all/local/none and short form -t. -tused emits every used template in every translation unit with external linkage, which produces duplicates -- exactly what -C now discards, so the two go together and neither is sufficient alone. -tlocal would give each unit an internal-linkage copy and need no -C, at the cost of a copy per unit. -tused is the better pair, because -C is needed either way: the non-template duplicates (inline members like edg::skip_typerefs at 41 copies, and 499 function-local statics) are untouched by any instantiation mode.
Claude-Session: https://claude.ai/code/session_01WGAwvvTwDg2yknFkmZ3qzs