Subject: Re: C++ ___builtin_new.
To: None <tv@NetBSD.ORG>
From: Adam Gundy <adam@impala.demon.co.uk>
List: port-arm32
Date: 05/26/1998 20:39:14
In message <Pine.NEB.3.96.980525164247.14443E-100000@like.duh.org> you wrote:

> On Mon, 25 May 1998, Alex Hayward wrote:
> 
> : I've been unable to build C++ recently because anything I built would
> : throw up linker errors about the undefined symbols ___builtin_new,
> : ___builtin_delete, ___builtin_vec_new etc. I've only been able to get it
> : working again by removing the #define WEAK_ALIAS from
> : /usr/src/gnu/usr.bin/gcc/libgcc/libgcc2.c (well, the linker doesn't
> : complain and moc from qt doesn't crash immediately, I don't know if it
> : actually /works/ yet...).
> 
> I'll see what I can do about this:  I'm working on getting gcc from egcs
> working, and it's doing similar things.

I had this problem several months ago when I built gcc 2.8.0; it is
caused by gcc not explicitly declaring WEAK symbols as GLOBAL.

Since a STATIC WEAK is completely pointless, it can be fixed by changing
the definition of ASM_WEAKEN_LABEL in gcc/config/netbsd.h to:


/* This is how we tell the assembler that a symbol is weak.  */

#undef ASM_WEAKEN_LABEL
#define ASM_WEAKEN_LABEL(FILE,NAME) \
  do { fputs ("\t.global\t", FILE); assemble_name (FILE, NAME); \
       fputc ('\n', FILE); \
       fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
       fputc ('\n', FILE); } while (0)


Seeya,
 Adam.
-- 
As the year 2000 approaches, the carefully planned Millenium 'bug'
begins to manifest itself in the computing job market...
Real programmers don't comment their code. If it was hard to write, it
should be harder to modify. These are all my own opinions.