public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Cross Compiler and Name Mangling Differences
@ 2000-12-27 11:19 Jonathan Pryor
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Pryor @ 2000-12-27 11:19 UTC (permalink / raw)
  To: gcc-help

Please ignore the previous message.  The name mangling differences
are due to squangling enabled by default on the Solaris compiler.
This hadn't occurred to me until after I sent the message.

Thanks,
- Jon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Cross Compiler and Name Mangling Differences
  2000-12-27 11:05 Jonathan Pryor
@ 2000-12-27 11:25 ` Alexandre Oliva
  0 siblings, 0 replies; 3+ messages in thread
From: Alexandre Oliva @ 2000-12-27 11:25 UTC (permalink / raw)
  To: Jonathan Pryor; +Cc: gcc-help

On Dec 27, 2000, Jonathan Pryor <jpryor@image.kodak.com> wrote:

> It appears that the name mangling is different between the solaris
> native gcc compiler and the linux->Solaris cross compiler.

Are you sure you're using the same version of GCC in both cases, and
that -fsquangle isn't enabled by default in one of the compilers?
That's often done to overcome a limitation of the Solaris assembler.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                  aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist    *Please* write to mailing lists, not to me

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Cross Compiler and Name Mangling Differences
@ 2000-12-27 11:05 Jonathan Pryor
  2000-12-27 11:25 ` Alexandre Oliva
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Pryor @ 2000-12-27 11:05 UTC (permalink / raw)
  To: gcc-help

I built a cross compiler to generate sparc-sun-solaris2.5.1 code
from i686-pc-linux-gnu (Red Hat 7.0).

The Solaris "native" compiler is GCC-2.95.2 with binutils-2.9.5.0.31,
so the cross compiler is using the same versions of binutils and gcc.

I have the cross-compiler built, but I'm facing a problem when
moving object files between platforms.  It appears that the name
mangling is different between the solaris native gcc compiler and
the linux->Solaris cross compiler.

For example, the output of ``nm'' of the linux object file is:

   00000000 a *ABS*
            U _Q_qtod
   00000000 ? __FRAME_BEGIN__
            U __ls__7ostreamPCc
            U __ls__7ostreamPFR7ostream_R7ostream
            U __throw
            U cout
            U endl__FR7ostream
   00000000 t gcc2_compiled.
   00000000 T main

The output of ``nm'' for the solaris-gcc compiler object file is:

   00000000 a *ABS*
            U _Q_qtod
   00000000 ? __FRAME_BEGIN__
            U __ls__7ostreamPCc
            U __ls__7ostreamPFRB0_RB0
            U __throw
            U cout
            U endl__FR7ostream
   00000000 t gcc2_compiled.
   00000000 T main

The only difference is the 5th line.  The Linux cross-compiler
mangling and the Solaris native mangling are different for the
function type ``ostream::operator<<(ostream &(*)(ostream &)).''

Is there any reason for this to be happening, and is there any
way to fix it?

Thanks.

- Jon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-12-27 11:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-27 11:19 Cross Compiler and Name Mangling Differences Jonathan Pryor
  -- strict thread matches above, loose matches on Subject: below --
2000-12-27 11:05 Jonathan Pryor
2000-12-27 11:25 ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).