On Tue, 11 Nov 2008 10:48:11 +0100, Don <[EMAIL PROTECTED]> wrote: >Max Samukha wrote: >> On Thu, 06 Nov 2008 11:42:01 +0100, Don <[EMAIL PROTECTED]> wrote: >> >>> [EMAIL PROTECTED] wrote: >>>> http://d.puremagic.com/issues/show_bug.cgi?id=2436 >>>> >>>> Summary: Unexpected OPTLINK termination >>>> Product: D >>>> Version: 2.020 >>>> Platform: PC >>>> OS/Version: Windows >>>> Status: NEW >>>> Keywords: link-failure >>>> Severity: normal >>>> Priority: P2 >>>> Component: DMD >>>> AssignedTo: [EMAIL PROTECTED] >>>> ReportedBy: [EMAIL PROTECTED] >>>> >>>> >>>> optlink fails to link an object file compiled with dmd 2.020 with -g or -gc >>>> switch. >>>> >>>> CL: link test,,,user32+kernel32/co/noi; >>>> >>>> >>> I don't think that's an OPTLINK bug -- that obj file seems to be >>> defective. >> >> Then I think it's both dmd and optlink bug. The former is buggy >> because it produces invalid object file. The latter cannot gracefully >> recover from invalid input, so it's buggy as well. > >I checked again, and the obj file seems to be OK. So I'm wrong about >that -- it's just an OPTLINK problem. >> >>> And it's a really complicated obj file! Provide the source >>> code for the smallest case which reproduces the problem. >>> >> >> Changing/removing seemingly arbitrary stuff makes the error disappear. >> I don't have a smaller example yet. > >Yeah. But it probably won't get fixed unless you can simplify it. >Mind you, OPTLINK is unlikely to get fixed, anyway. But maybe Walter can >change DMD slightly to work around the optlink bug. I'll try to reduce it when I have time. > >>> Is it the same as #1439? >#1439 shows that something bad happens when the symbol length is a >particular length (out-by-1 error?). I think this is quite likely to be >the same issue, since you have so many templates in there.
It may be that issue. But it seems to depend not only on the length of a particular symbol generated by a template instantiation. For example, the error dissapears when I remove an unreferenced non-templated function, while other declarations can be safely removed without affecting the bug. No clue