f



gcc 4 linking to a file compiled with gcc 2.96 question

Hi,

I've been told there is a switch for gcc which will match the ABI of 
code compiled with previous versions. I don't have the gcc manual to 
hand and man gcc isn't showing much (web access is down currently). 
Anyone know what the switch is?

Reason I'm asking is this.

If you've ever used the PS2 SDK from Sony, you'll know what an abhorent 
mess it is. Sony provide the object files without the source (which is a 
pain) and version 2.95.4 of gcc.

My idea is to use a modern Linux distro (Mandriva, FC or SuSE) on a dual 
boot machine, use KDevelop to build the software and test the resultant 
code on the PS2. To do that, I need to compile the source with ABI 
compatibility.

TTFN

Paul
0
Paul
8/8/2005 3:16:11 PM
comp.unix.programmer 10848 articles. 0 followers. kokososo56 (350) is leader. Post Follow

4 Replies
791 Views

Similar Articles

[PageSpeed] 11

Paul F. Johnson wrote:

> I've been told there is a switch for gcc which will match the ABI of 
> code compiled with previous versions. I don't have the gcc manual to 
> hand and man gcc isn't showing much (web access is down currently). 
> Anyone know what the switch is?

"A switch" is an understatement. The ABI has change many time between
gcc 2.x to gcc 4 (roughly speaking, every gcc 3.x minor release had a
new ABI).

The ABI changes are mainly due to C++ name mangling. The exact changes
are documented in the change files for gcc 3 and gcc 4.

> code on the PS2. To do that, I need to compile the source with ABI 
> compatibility.

gcc provides no such thing.

As a rule of thumb, if the PS2 code is written in C then it should work,
but if it is written in C++ then all bets are off.

-- 
mail1dotstofanetdotdk
0
Bjorn
8/9/2005 9:50:47 AM
"Paul F. Johnson" <paul@all-the-johnsons.co.uk> writes:

> I've been told there is a switch for gcc which will match the ABI of
> code compiled with previous versions.

From 'info gcc':
`-fabi-version=N'
     Use version N of the C++ ABI.  Version 1 is the version of the C++
     ABI that first appeared in G++ 3.2.  Version 0 will always be the
     version that conforms most closely to the C++ ABI specification.
     Therefore, the ABI obtained using version 0 will change as ABI
     bugs are fixed.

     The default is version 1.


> Reason I'm asking is this.
>
> If you've ever used the PS2 SDK from Sony, you'll know what an
> abhorent mess it is. Sony provide the object files without the source
> (which is a pain) and version 2.95.4 of gcc.

If you have C source, the libraries should link just fine.
If C++, all bets are off. You are quite unlikely to make it work.

> My idea is to use a modern Linux distro (Mandriva, FC or SuSE) on a
> dual boot machine, use KDevelop to build the software and test the
> resultant code on the PS2. To do that, I need to compile the source
> with ABI compatibility.

Why not just use gcc-2.95.4 and spare yourself the trouble?
You can install it with --prefix=/usr/local/gcc-2.95.4 so it will
not destroy gcc already on the system.
You'll need a cross-compiler anyway, wouldn't you?

Cheers,
-- 
In order to understand recursion you must first understand recursion.
Remove /-nsp/ for email.
0
Paul
8/9/2005 2:07:35 PM
Paul Pluzhnikov <ppluzhnikov-nsp@charter.net> wrote:
: Why not just use gcc-2.95.4 and spare yourself the trouble?
: You can install it with --prefix=/usr/local/gcc-2.95.4 so it
will
: not destroy gcc already on the system.

Different versions of gcc, installed into same prefix normally do not
destroy each other. There are special provisions in gcc for it.
You even can start all of them with just gcc command, specifying desired
version with -V switch. (you need gcc driver from newest of installed
versions of gcc, however)

-- 
0
vitus
8/9/2005 2:39:29 PM
Paul F. Johnson wrote:
> Hi,
> 
> I've been told there is a switch for gcc which will match the ABI of 
> code compiled with previous versions. I don't have the gcc manual to 
> hand and man gcc isn't showing much (web access is down currently). 
> Anyone know what the switch is?
> 
> Reason I'm asking is this.
> 
> If you've ever used the PS2 SDK from Sony, you'll know what an abhorent 
> mess it is. Sony provide the object files without the source (which is a 
> pain) and version 2.95.4 of gcc.
> 
> My idea is to use a modern Linux distro (Mandriva, FC or SuSE) on a dual 
> boot machine, use KDevelop to build the software and test the resultant 
> code on the PS2. To do that, I need to compile the source with ABI 
> compatibility.
So - you need a cross-compiler. iirc Sony added various gcc patches for
targeting the ps2 processors - are they ported to newer gcc versions ?
http://playstation2-linux.com/ would probably have some informative
information - not just for the linux kit.
0
ISO
8/9/2005 4:44:12 PM
Reply: