Bug 24459 – Missing symbol from partial incremental compilation. allinst doesn't help.

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2024-03-27T17:00:41Z
Last change time
2024-12-13T19:34:10Z
Keywords
industry
Assigned to
No Owner
Creator
FeepingCreature
Moved to GitHub: dmd#20426 →

Comments

Comment #0 by default_357-line — 2024-03-27T17:00:41Z
Consider three files: module test1; import test2; void main() { A a = A(5); } module test2; import test3; struct A { mixin Constructor; } module test3; mixin template Constructor() { this()(int i) { } } You can build all three in one go: dmd test1.d test2.d test3.d -oftest You can also build them incremental: dmd test1.d test2.d test3.d -od. -c dmd test1.o test2.o test3.o -oftest But if you rebuild only test2.d: dmd test2.d -od. -c Then the link fails: /usr/bin/ld: test1.o: in function `_Dmain': test1.d:(.text._Dmain[_Dmain]+0x16): undefined reference to `_D5test21A8__mixin1__T6__ctorZQiMFNaNbNcNiNfiZSQBtQBq' And looking at test2.o, in the first run the constructor is emitted into it (despite not being called in it!), but when building it in isolation, it is not. `-allinst` changes nothing.
Comment #1 by robert.schadek — 2024-12-13T19:34:10Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20426 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB