www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Harmonia and DMD 0.157

reply "Andrew Fedoniouk" <news terrainformatica.com> writes:
I have a template in Harmonia (code reduced):

struct array(T)
{
  T[] elements;
  ....
  struct ENUM // bidirectional enumerator
  {
    int opApply(int delegate(inout T) dg)  {  ...  }
  }

  ENUM items(bool forward) { ENUM w; w._forward = forward; w._a = elements; 
return w; }
  ENUM forward() { return items(true); }
  ENUM backward() { return items(false); }
}

And its instantiation in other module:

array!(Doc.Brick*) bricks;

Since DMD 0.157(probably 0.156 too) compilation is yelding to:

OPTLINK :
C:\d\build\lib\release\view.obj(view)  Offset 03958H Record Type 0091
Error 1: Previous Definition Different : 
__init_8harmonia5types46__T5arrayTPS8harmonia4html8document3Doc5BrickZ5array4ENUM

This is in Release mode, in Debug mode everything is fine.

I cannot understand how to solve this. Instantiation of array!(Doc.Brick*) 
is in single place and
I have no idea what "Previous Definition Different" means here.

If pattern looks familiar to somebody - please let me know as Harmonia is 
broken now.

Andrew.
May 14 2006
parent reply "Andrew Fedoniouk" <news terrainformatica.com> writes:
Working DMD version (for Harmonia) was DMD 0.150
Since then something was changed in the way how it links/compiles.

Andrew. 
May 14 2006
parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Andrew Fedoniouk" <news terrainformatica.com> wrote in message 
news:e47jup$21kb$1 digitaldaemon.com...
 Working DMD version (for Harmonia) was DMD 0.150
 Since then something was changed in the way how it links/compiles.

 Andrew.

Looks kind of like when the template name mangling algorithm changes, and so the compiler's looking for one thing when the library has another which uses the old name mangling (happened, for example, when Walter added string and float template params). But if you're not linking to any precompiled libraries, hmm..
May 14 2006
parent reply "Andrew Fedoniouk" <news terrainformatica.com> writes:
"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote in message 
news:e491l3$dg9$1 digitaldaemon.com...
 "Andrew Fedoniouk" <news terrainformatica.com> wrote in message 
 news:e47jup$21kb$1 digitaldaemon.com...
 Working DMD version (for Harmonia) was DMD 0.150
 Since then something was changed in the way how it links/compiles.

 Andrew.

Looks kind of like when the template name mangling algorithm changes, and so the compiler's looking for one thing when the library has another which uses the old name mangling (happened, for example, when Walter added string and float template params). But if you're not linking to any precompiled libraries, hmm..

Thanks Jarrett. Probably this information will be useful: I am able to compile in release but only if I'll remove -inline flag. Dflags which does not work: DFLAGS = -c -inline -O -release Dflags which does work: DFLAGS = -c -O -release No inlining anymore? Andrew Fedoniouk. http://terrainformatica.com
May 14 2006
parent reply Deewiant <deewiant.doesnotlike.spam gmail.com> writes:
Andrew Fedoniouk wrote:
 I am able to compile in release but only if I'll remove -inline flag.
 
 Dflags which does not work:
 DFLAGS  = -c -inline -O -release
 
 Dflags which does work:
 DFLAGS  = -c -O -release
 
 No inlining anymore?
 
 Andrew Fedoniouk.
 http://terrainformatica.com
 

Since DMD 0.151, with -inline -release, inlining is done for all imported modules as well as compiled ones. I don't know how this affects templates, but that might have something to do with it.
May 15 2006
parent "Andrew Fedoniouk" <news terrainformatica.com> writes:
"Deewiant" <deewiant.doesnotlike.spam gmail.com> wrote in message 
news:e499rk$upp$1 digitaldaemon.com...
 Andrew Fedoniouk wrote:
 I am able to compile in release but only if I'll remove -inline flag.

 Dflags which does not work:
 DFLAGS  = -c -inline -O -release

 Dflags which does work:
 DFLAGS  = -c -O -release

 No inlining anymore?

Since DMD 0.151, with -inline -release, inlining is done for all imported modules as well as compiled ones. I don't know how this affects templates, but that might have something to do with it.

Sounds suspiciously close.... Sideffect of fixing these? http://d.puremagic.com/bugzilla/show_bug.cgi?id=67 http://d.puremagic.com/bugzilla/show_bug.cgi?id=73 Andrew Fedoniouk. http://terrainformatica.com
May 15 2006