www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Reducing Linker Bugs

reply dsimcha <dsimcha yahoo.com> writes:
Two questions:

1.  What's the best way to file a bug report against Optlink when I get 
one of those "Optlink terminated unexpectedly" windows and I'm linking 
in libraries that I don't have the source code to and thus can't reduce?

2.  I'm getting on the Optlink hating bandwagon.  How hard would it be 
to use Objconv (http://www.agner.org/optimize/#objconv) to convert the 
OMF object files DMD outputs to COFF and then use the MinGW linker to 
link the COFF files, and automate this process in DMD?
Dec 18 2011
next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
I've tried #2 before but it only worked for the most trivial code.

As a workaround you could try unilink (OMF-compatible):
ftp://ftp.styx.cabel.net/pub/UniLink/ulnb0329.zip

Change ulink.cfg to e.g.:
-zsnn.lib
-LC:\dmd\windows\lib
-LC:\dm\lib
-Go

-zkernel32;advapi32;user32;wsock32;shell32;snn.lib
-LC:\dmd2\windows\lib
-Go

I've only ever tried manually linking object files and it worked good,
but maybe you can change sc.ini so DMD can invoke unilink itself. Good
luck!
Dec 18 2011
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 12/18/2011 8:38 PM, dsimcha wrote:
 Two questions:

 1. What's the best way to file a bug report against Optlink when I get one of
 those "Optlink terminated unexpectedly" windows and I'm linking in libraries
 that I don't have the source code to and thus can't reduce?

In that case, the best thing is to zip it all up and file a bugzilla report on it.
 2. I'm getting on the Optlink hating bandwagon. How hard would it be to use
 Objconv (http://www.agner.org/optimize/#objconv) to convert the OMF object
files
 DMD outputs to COFF and then use the MinGW linker to link the COFF files, and
 automate this process in DMD?

You can try it manually and see what happens.
Dec 18 2011
next sibling parent reply dsimcha <dsimcha yahoo.com> writes:
On 12/19/2011 12:54 AM, Walter Bright wrote:
 On 12/18/2011 8:38 PM, dsimcha wrote:
 Two questions:

 1. What's the best way to file a bug report against Optlink when I get
 one of
 those "Optlink terminated unexpectedly" windows and I'm linking in
 libraries
 that I don't have the source code to and thus can't reduce?

In that case, the best thing is to zip it all up and file a bugzilla report on it.

Do you need the sources or just the object/library binaries?
Dec 19 2011
parent Walter Bright <newshound2 digitalmars.com> writes:
On 12/19/2011 5:51 AM, dsimcha wrote:
 On 12/19/2011 12:54 AM, Walter Bright wrote:
 On 12/18/2011 8:38 PM, dsimcha wrote:
 Two questions:

 1. What's the best way to file a bug report against Optlink when I get
 one of
 those "Optlink terminated unexpectedly" windows and I'm linking in
 libraries
 that I don't have the source code to and thus can't reduce?

In that case, the best thing is to zip it all up and file a bugzilla report on it.

Do you need the sources or just the object/library binaries?

For linker problems, doan need no steenkin' sources. BTW, optlink is known to have problems with weak extern records. Where did your omf libraries come from?
Dec 19 2011
prev sibling parent "dsimcha" <dsimcha yahoo.com> writes:
The OMF library that I don't have the source to is a BLAS/LAPACK 
stub library that calls into a DLL.  It was uploaded ~5 years ago 
to DSource by Bill Baxter.  I know absolutely no details about 
how he compiled it.

On Monday, 19 December 2011 at 18:04:26 UTC, Walter Bright wrote:
 On 12/19/2011 5:51 AM, dsimcha wrote:
 On 12/19/2011 12:54 AM, Walter Bright wrote:
 On 12/18/2011 8:38 PM, dsimcha wrote:
 Two questions:

 1. What's the best way to file a bug report against Optlink 
 when I get
 one of
 those "Optlink terminated unexpectedly" windows and I'm 
 linking in
 libraries
 that I don't have the source code to and thus can't reduce?

In that case, the best thing is to zip it all up and file a bugzilla report on it.

Do you need the sources or just the object/library binaries?

For linker problems, doan need no steenkin' sources. BTW, optlink is known to have problems with weak extern records. Where did your omf libraries come from?

Dec 19 2011