compiler: separate package exports from entry roots

This commit is contained in:
2026-08-12 21:59:51 +09:00
parent a88078faf8
commit fc4bde703e
15 changed files with 420 additions and 190 deletions

View File

@@ -1519,8 +1519,8 @@ mod_collect(Cg *c, Node *file)
* #99: under sep a dep unit's main is imported==0 too (its body
* is composed with a path-carrying `//ww:module-reset`, #57), so
* imported==0 no longer means "root unit" per-unit. Gate on
* !sep_isdep (wwiout==NULL <=> root/link-entry unit, #69) so only
* the root's main stays bare; a dep's main mangles on its path. */
* !sep_isdep, which the explicit --entry mode controls independently
* of export output, so only the root's main stays bare. */
if (d->str && strcmp(d->str, "main") == 0 && !d->imported
&& !c->sep_isdep)
continue;