Bug 9333 – druntime module is not compiled into binary
Status
RESOLVED
Resolution
WORKSFORME
Severity
critical
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2013-01-17T08:13:00Z
Last change time
2013-01-29T11:58:55Z
Assigned to
nobody
Creator
maxim
Comments
Comment #0 by maxim — 2013-01-17T08:13:55Z
Two month ago etc.linux.memoryerror module was added into druntime (https://github.com/D-Programming-Language/druntime/blob/master/src/etc/linux/memoryerror.d) for converting linux segfaults into exceptions.
However, it seems to be absent:
----------------------------
import etc.linux.memoryerror;
import core.stdc.stdio : printf;
class A { int x; }
void main()
{
A a;
try
{
a.x = 0;
}
catch(NullPointerError er)
{
printf("catched\n");
}
}
------------------------------------------
main.o:(.data+0xd0): undefined reference to
`_D3etc5linux11memoryerror16NullPointerError7__ClassZ'
collect2: error: ld returned 1 exit status
--- errorlevel 1
As suggested in this thread(http://forum.dlang.org/thread/[email protected]?page=1) the module may not reach libdruntime/libphobos.a
I placed druntime sources and binaries (as well as phobos) not in default place on linux. I am using such installation for many month and have never experienced linker errors. It is strange that switching to ldc2 fixes linking problem.
Since it is linkable using default settings and nobody else complained, I blame myself and mark issue as WORKSFORME, despite this is strange.