Bug 14202 – Missing template instantiation (Phobos) with -inline
Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2015-02-19T21:35:00Z
Last change time
2015-02-19T22:20:03Z
Keywords
industry
Assigned to
nobody
Creator
justin
Comments
Comment #0 by justin — 2015-02-19T21:35:40Z
I am getting an "undefined reference" linker error with a trivial program that only imports std.stdio, but only when compiling with -inline. Minimized test case below.
$ cat missing_symbol.d
---------------
import std.stdio;
void main(string[] args)
{
auto f = File("");
float[3] parts;
auto n = f.rawRead(parts[]);
}
---------------
$ dmd -inline missing_symbol.d
missing_symbol.o: In function `_D3std5stdio4File14__T7rawReadTfZ7rawReadMFAfZAf':
missing_symbol.d:(.text._D3std5stdio4File14__T7rawReadTfZ7rawReadMFAfZAf+0x17d): undefined reference to `_D3std9exception196__T12errnoEnforceTbVAyaa81_2f686f6d652f6a757374696e2f2e64766d2f636f6d70696c6572732f646d642d322e3036372e302d62312f6c696e75782f62696e2f2e2e2f2e2e2f7372632f70686f626f732f7374642f737464696f2e64Vmi722Z12errnoEnforceFNfbLAyaZb'
collect2: error: ld returned 1 exit status
--- errorlevel 1
This code compiles and links properly with 2.065.0. I get the error above with 2.066.0, 2.066.1, and 2.067.0-b1.
Comment #1 by mk — 2015-02-19T21:57:10Z
Cannot reproduce in v2.067.0-b2. Don't know if it was fixed or just disappeared.
Comment #2 by justin — 2015-02-19T22:20:03Z
*** This issue has been marked as a duplicate of issue 13172 ***