[openbeos] Re: Wonderbrush/Other R5 apps under Haiku

  • From: Ingo Weinhold <bonefish@xxxxxxxxxxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Sat, 28 Jan 2006 00:52:22 +0100

On 2006-01-27 at 18:50:00 [+0100], Oliver Tappe <openbeos@xxxxxxxxxxxxxxx> 
wrote:
> On 2006-01-27 at 17:08:35 [+0100], François Revol <revol@xxxxxxx> wrote:
> > > 
> > > 
> > > No, not yet, but I can verify that the symbol is mangled differently
> > > when
> > > built under Linux, namely to "GetFamilyAndStyle__C5BFontPA63_cT1".
> > > I'll
> > > look into this tonight.
> > 
> > [revol@patrick ~]$ echo GetFamilyAndStyle__C5BFontPA64_cPA64_c | c++
> > filt
> > BFont::GetFamilyAndStyle(char (*)[64], char (*)[64]) const
> > [revol@patrick ~]$ echo GetFamilyAndStyle__C5BFontPA63_cT1 | c++filt
> > BFont::GetFamilyAndStyle(char (*)[63], char (*)[63]) const
> > 
> > Seems like the font_style and font_family types have 1 less char or
> > something...
> > I guess the T1 thingy is something like "same as first last type"
> 
> Yep, these are what the gcc-guys call 'repetition codes'.
> 
> There used to be a bug in the gcc's c++-mangler with respect to these
> repetition codes for array types that causes problems with the symbol
> mentioned by Simon.
> I remember having to patch gcc-2.95.3 to deal with this (aka: to actually
> mangle the names in the way the older compilers did in order to match what
> lives in libbe.so).
> 
> I suppose Ingo has not applied the respective patch
> (beos-specific/name-mangling.patch), as it probably doesn't go down well
> with gcc-4's completely different and all new C++-parser >:o/

This time I'm not to blame. We're actually talking about the good old gcc 
2.95.3. :-P

As it looks, the name-mangling.patch is not cross-compilation safe, since 
it uses "#ifdef __BEOS__". This would explain both the off-by-one array 
size and the use of repetition codes.

> Ingo, please tell if I can give you a hand on this.

I guess I'll simply define a TARGET_BEOS macro in "i386/beos-elf.h" and 
replace the occurrences of __BEOS__ respectively.
It would be nice, though, if you would look through the other patches and 
identify similar problems. I suppose you know the patches best and can 
judge with little effort where BeOS is meant as host and where as target 
platform. This concerns only places in the compiler proper, of course; 
everything compiled with the cross compiler should be safe, anyway.

CU, Ingo

Other related posts: