Bug 24496 – "Undefined reference to internal" when -c with SysTime.max in init

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2024-04-11T12:02:58Z
Last change time
2024-12-13T19:34:38Z
Keywords
backend, industry
Assigned to
No Owner
Creator
FeepingCreature
Moved to GitHub: dmd#20439 →

Comments

Comment #0 by default_357-line — 2024-04-11T12:02:58Z
Consider this code: a.d: module a; import std.datetime; struct AStruct { SysTime time = SysTime.max; } void main() { } b.d: module b; import std.datetime; struct BStruct { SysTime time = SysTime.max; } Compile it directly and it works: $ dmd a.d b.d -oftest $ But compile it incrementally: $ dmd a.d b.d -c $ dmd a.o b.o -oftest /usr/bin/ld: b.o:(.data.rel.ro+0x8): undefined reference to `internal' collect2: error: ld returned 1 exit status
Comment #1 by default_357-line — 2024-04-11T13:01:39Z
Simplified: a.d: import b; static second = first; void main() { } b.d: static first = new immutable Object; /usr/bin/ld: b.o:(.data+0x0): undefined reference to `internal'
Comment #2 by kinke — 2024-04-29T12:25:21Z
Oh nice, thx for the test case! We have been hitting these weird issues too, especially with enabled coverage.
Comment #3 by robert.schadek — 2024-12-13T19:34:38Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20439 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB