This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Template Generation on AIX4.2 (gcc-2.95.2)


Philippe Nobili wrote:
> 
> Hello,
> 
> We have been  using 2.92.2 for C++ developments on Solaris platforms
> for several months.
> 
> It seems that I have problems to generate template's code on
> AIX platforms
> (AIX4.2). I use the '-frepo' directive to create a repository file
> together with
> each object file.
> 
> After compilation, I make a 'closure' with all object files, in order
> to archive
> object files with template instanciations. This worked pretty well on
> Solaris,
> but I cannot get it to work on AIX: the message 'recompiling ...'
> never appears
> and as I feared, templates are not instanciated.
> 
> Is it the expected behavior on AIX or did I do something wrong ?
> Thank you for your help and many thanks for your compiler.

Hi Philippe,

To implement -frepo option gcc should correctly recognize linker errors.
Currently this works well with GNU ld (and may be some others), but 
doesn't work with AIX native ld. Some time ago I wrote a patch which
worked for me in most cases. I attached this patch below but I can not
give you any warranty that this patch covers all cases correctly.
Unfortunately, I rarely use my old AIX box, so probably I also can not
do more work on this patch. But at least you'll have a point where to
look
for further improvements.

Regards,
Andrey.
*** gcc/tlink.c.orig	Mon Nov  3 15:55:39 1997
--- gcc/tlink.c	Fri Oct 24 22:27:57 1997
***************
*** 529,535 ****
  
    while ((line = tfgets (stream)) != NULL)
      {
!       char *p = line, *q;
        symbol *sym;
        int end;
        
--- 529,535 ----
  
    while ((line = tfgets (stream)) != NULL)
      {
!       char *p = line, *q, *q1;
        symbol *sym;
        int end;
        
***************
*** 549,555 ****
  	++p;
  
        end = ! *q;
!       *q = 0;
        sym = symbol_hash_lookup (p, false);
  
        if (! sym && ! end)
--- 549,555 ----
  	++p;
  
        end = ! *q;
!       *q = 0; q1 = q + 1;
        sym = symbol_hash_lookup (p, false);
  
        if (! sym && ! end)
***************
*** 575,580 ****
--- 575,593 ----
  	    sym = symbol_hash_lookup (dem->mangled, false);
  	}
  
+       if (! sym && ! end)
+         {
+ #define UND1 "Undefined symbol: "
+           p = (char *) strstr (q1, UND1);
+           if (p)
+             {
+               p += sizeof (UND1); p--;
+               for (q = p; *q && ! isspace (*q); ++q) ;
+               *q = 0;
+               if (*p == '.') p++;
+               sym = symbol_hash_lookup (p, false);
+             }
+         }
        if (sym && sym->tweaked)
  	return 0;
        if (sym && !sym->tweaking)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]