Bug 2378 – Win32 OPTLINK crashes when it links some kind of static library into a executeable.
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
tools
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2008-09-29T03:45:00Z
Last change time
2017-01-10T01:37:55Z
Keywords
link-failure, Optlink
Assigned to
bugzilla
Creator
hskwk
Comments
Comment #0 by hskwk — 2008-09-29T03:45:58Z
Windows dmd (later than 2.018) OPTLINK crashes (Unexpected OPTLINK termination) when it links some kind of static library into a executable.
Here is a small example as a quick report.
---- make following module into a static library
module test;
import std.random;
Mt19937 gen;
uint nonThreadSafeRandom() {return gen.next;}
---- OPTLINK crashes when making following code into a exe with linking the library just made before
import test;
void main() { uint a = nonThreadSafeRandom(); }
---- OPTLINK works if deeper module is imported
import test, std.random;
void main() { uint a = nonThreadSafeRandom(); }
This is a quick report, I have not found a true cause yet.
thanks,
p.s.
I'm sorry posting redundant news on digitalmars.D.bugs.
I wish this tracker is the proper channel to report bugs.
Comment #1 by bugzilla — 2008-10-02T03:35:39Z
Please include what commands you used to generate the problem.
Comment #2 by hskwk — 2008-10-02T08:33:47Z
(In reply to comment #1)
> Please include what commands you used to generate the problem.
>
Commands I used in the first report
dmd -c test.d
lib -c -p32 test.lib test.obj
dmd main.d test.lib
causes crash described before.
following commands
dmd -lib test.d
dmd main.d test.lib
causes this error, regardless of importing std.random:
test.lib
Warning 140: Library probably needs FIXLIB
--- error level 1
Only std.random causes this error, as I tested.
Comment #3 by bugzilla — 2010-09-01T17:32:23Z
I can't duplicate the optlink crash, but I can the needs FIXLIB problem.
Comment #4 by bugzilla — 2010-09-01T17:47:07Z
I'm not sure what the FIXLIB warning is about, but I think it can be safely ignored.
Comment #5 by bugzilla — 2010-09-01T20:36:30Z
Warning removed in link 8.00.7, the crash is not reproducible.