Yet more OPTLINK woes

Don nospam at nospam.com
Thu May 13 11:38:21 PDT 2010


Daniel Keep wrote:
> Some general replies:
> 
> There have been three responses along the lines of "are you sure OPTLINK
> is running?".  Quoting myself:
> 
> "Invoking OPTLINK directly changes nothing."
> 
> Or to be more specific:
> 
>> link AstTest,AstTest,,user32+kernel32/noi+tango.lib;
> (zero-byte .map file pops into existence)
> 
> Yes, I'm sure.  I'm also sure it's the DigitalMars link.exe and in the
> correct directory.
> 
>> I've had problems before with DMD silently exiting without an error
>> message and with error success and leaving behind a corrupt .obj.
> 
> I had a look at the .obj file (I actually used lib to stuff it into a
> .lib file and then dump the symbols), and it looked fine.
> 
> Well, except for this:
> 
> _D11TokenStream<80><8d><8d>5_ctorMFC6Source<f6>P<80><90><91>
>   DFS8Location<80><89><89>AaYvJS6<80><85><cf>s5<f4>Zb<80>
>   <99><aa>ZC<81><9a><87>
> 
> (broken across 3 lines; <xx> are bytes in hex since several of them were
> non-printable.)
> 
> The same had happened to a number of symbols from tango.io.stream.Format.
> 
> In the case of the first one, the appropriate declarations (with
> fully-qualified module name commented) are:
> 
>> final class /*TokenStream.*/TokenStream
>> {
>>     alias bool function(Source, LocErr, out Token) NextToken;
>>     this(Source src, NextToken next, LocErr err) { ... }
>> }
>>
>> final class /*Source.*/Source { ... }
>>
>> alias void delegate(Location, char[], ...) /*Location.*/LocErr;
>>
>> struct /*Location.*/Location { ... }
> 
> As far as I understand D's name mangling, that symbol name is corrupt.
> 
>> CTFE recursion is the only reported unfixed bug that does that ...
> 
> There is exactly one CTFE function that calls itself.  However, it
> cannot recurse more than once (it does so to change types) *and* this
> function is used in the LexerTest program which does compile.
> 
> AstTest uses an additional CTFE function, but this just concatenates
> some strings together.
> 
>> Try and remove stuff until it starts working
> 
> I've gutted the changes between LexerTest and AstTest to the point that
> I get an .exe.  This involved stripping out more or less every global
> and member function that was added and every derived class.
> 
> What tipped it over into compiling was removing the reference to
> StructuredOutput from AstDumpVisitor.  Which is odd, because
> StructuredOutput is still being used in AstTest.
> 
> StructuredOutput, once gutted, is this:
> 
>> module StructuredOutput;
>>
>> import tango.io.model.IConduit : OutputStream;
>> import tango.io.stream.Format : FormatOutput;
>>
>> final class StructuredOutput
>> {
>>     alias StructuredOutput This;
>>     this(OutputStream os)
>>     {
>>     }
>> }
> 
> I honestly can't see what it could be upset about.
> 
>> Post the source and I'll try to help. I like debugging weird problems.
>> :)
> 
> Attached both regular and decaffeinated^Hgutted versions.

Thanks! I hope torhu is able to create a bug report from this.


More information about the Digitalmars-d-learn mailing list