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


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

Re: PATCH: Configure libstdc++-v3 against gthr.h


I wrote:

> alpha-unknown-freebsd4.2 (this version on 3.0 branch)

For the record, a patch was required to get __GXX_WEAK__ defined
properly for this alpha platform (and I think all alpha platforms
using ELF that support weak symbols).  It had not been publicly posted
for application yet since it hadn't passed bootstrap and I still
wasn't sure it is right.

Again, for the record only, here is what I had in my tree (with some
commentary as to how I arrived at it):

> I am trying to figure out why __GXX_WEAK__ is 0 on alpha-*-freebsd*
> when this was reported at configure time:

> checking assembler weak support... yes

Unless this part of gcc/cppinit.c is deemed to be in error (it does
appear to be a bizarre way to check whether a port supports #weak):

[...]
      if (SUPPORTS_ONE_ONLY)
        _cpp_define_builtin (pfile, "__GXX_WEAK__ 1");
      else
        _cpp_define_builtin (pfile, "__GXX_WEAK__ 0");
[...]

(Ignoring that this idiom appears in many places and is ripe for
better generalization,) Fixed with this patch taken from
gcc/config/elfos.h (which I am now testing with a full bootstrap):

Index: gcc/config/alpha/elf.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/alpha/elf.h,v
retrieving revision 1.38
diff -c -r1.38 elf.h
*** elf.h	2001/06/06 01:57:49	1.38
--- elf.h	2001/06/06 23:26:44
***************
*** 458,463 ****
--- 458,465 ----
      }						\
    while (0)
  
+ #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+ 
  #define UNIQUE_SECTION_P(DECL)   (DECL_ONE_ONLY (DECL))
  
  #undef  UNIQUE_SECTION


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