BTW, to deal with annoying errors like this, how hard would it be to compare implementations when a symbol is defined multiple times and, if the implementations are identical, just pick one and use it?  Of course I know in the short term this is hard b/c OPTLINK isn't translated to C yet, but let's assume longer term that we will have a sane linker codebase.<br>
<br><div class="gmail_quote">On Tue, Feb 15, 2011 at 12:33 PM, David Simcha <span dir="ltr"><<a href="mailto:dsimcha@gmail.com">dsimcha@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Never mind, I got it.  <a href="http://d.puremagic.com/issues/show_bug.cgi?id=5592" target="_blank">http://d.puremagic.com/issues/show_bug.cgi?id=5592</a>  The thing that made it hard to reproduce was that I was using the wrong array op.  What the heck is the difference between __arrayExpSliceMulSliceAddass_d and <br>

__arraySliceExpMulSliceAddass_d anyhow?  From what I can tell, which one gets called depends on the order you write your array op in.  arr1[] += num * arr2[] calls __arrayExpSliceMulSliceAddass_d and arr1[] += arr2[] * num calls __arraySliceExpMulSliceAddass_d .  Isn't multiplication commutative even in inexact floating point arithmetic?  Why two functions?<div>
<div></div><div class="h5"><br>
<br><div class="gmail_quote">On Tue, Feb 15, 2011 at 12:07 PM, Jason House <span dir="ltr"><<a href="mailto:jason.james.house@gmail.com" target="_blank">jason.james.house@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

The complete linker error with mangled symbol name and the candidate code generating the symbol in the first place is probably enough. At one point, I posted an error message, and Don was able to infer everything else without seeing a line of my code. That might not be the case here, but it's probably the bulk of the needed info.<br>


<br>
Sent from my iPhone<br>
<div><br>
On Feb 15, 2011, at 11:33 AM, David Simcha <<a href="mailto:dsimcha@gmail.com" target="_blank">dsimcha@gmail.com</a>> wrote:<br>
<br>
> Whenever I use array ops in multi-module projects, I always seem to run into "Previous definition different" linker errors.  This seems to occur when I call the same array op using library function from multiple modules in the same project.  Moving things around to different modules and recompiling always seems to solve them at the expense of uglifying my code.  Unfortunately, this is one of those frustrating bugs that only seems to occur on real-world code, i.e. code that has multiple modules, lots of indirection, libraries, etc.  I can't for the life of me come up with a reduced test case.<br>


><br>
> Has anyone else been experiencing similar issues?  Alternatively, can someone with a better mental model of how things work at the binary level please suggest how this bug might be reproduced in a test case that's less than 20 thousand lines of code?  (I find linker bugs very difficult to isolate and file bug reports on because I have no mental model of how things work at that low a level.  My mental model basically only goes down to assembly language, not the process of turning a pile of assembly language files into a working executable or shared library.)<br>


</div>> _______________________________________________<br>
> dmd-internals mailing list<br>
> <a href="mailto:dmd-internals@puremagic.com" target="_blank">dmd-internals@puremagic.com</a><br>
> <a href="http://lists.puremagic.com/mailman/listinfo/dmd-internals" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-internals</a><br>
_______________________________________________<br>
dmd-internals mailing list<br>
<a href="mailto:dmd-internals@puremagic.com" target="_blank">dmd-internals@puremagic.com</a><br>
<a href="http://lists.puremagic.com/mailman/listinfo/dmd-internals" target="_blank">http://lists.puremagic.com/mailman/listinfo/dmd-internals</a><br>
</blockquote></div><br>
</div></div></blockquote></div><br>