On Wed, Nov 13, 2002 at 04:41:32PM +1100, SH wrote:

> Thanks for the advice. I added "-mcpu=v8" in the CFLAGS during compilation
> but the executables generated are still limited to ultra sparc machines or
> higher. The original binary format is of form "ELF 32-bit MSB executable
> SPARC Version 1, dynamically linked, stripped" while the new one is "ELF
> 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, UltraSPARC1
> Extensions Required, dynamically linked, not stripped".

Here's what I get on my sun4u:

  [johnc@medusa ~/tmp]$ uname -a
  SunOS medusa.vastsystems.com.au 5.6 Generic_105181-13 sun4u sparc SUNW,Ultra-5_10
  [johnc@medusa ~/tmp]$ gcc -mcpu=v8 -o test test.c
  [johnc@medusa ~/tmp]$ file test
  test:           ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not 
stripped
  [johnc@medusa ~/tmp]$ gcc -mcpu=supersparc -o test test.c
  [johnc@medusa ~/tmp]$ file test
  test:           ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not 
stripped
  [johnc@medusa ~/tmp]$ gcc -o test test.c
  [johnc@medusa ~/tmp]$ file test
  test:           ELF 32-bit MSB executable SPARC Version 1, dynamically linked, not 
stripped
  [johnc@medusa ~/tmp]$ gcc -mcpu=ultrasparc -o test test.c
  [johnc@medusa ~/tmp]$ file test
  test:           ELF 32-bit MSB executable SPARC32PLUS Version 1, V8+ Required, 
dynamically linked, not stripped

I no longer have any older Suns to play with, so I can't check the
binaries, but before the older machines finally died I know I've built
binaries that ran on them with this compiler, without any special
compiler switches (I configured gcc so that the default cpu was the
older one).

Do you have different versions of Solaris on the two machines?  IIRC,
you can build a binary on 2.5.1, for example, that'll run on 2.6, but
not the other way around.

Have you tried a simple "Hello World" program?

What's the output of `gcc -dumpspecs'?

Which version of gcc are you using?

If you want me to build a test program and send it to you to try, let
me know.


Cheers,

John
-- 
whois [EMAIL PROTECTED]
GPG key id: 0xD59C360F
http://kirriwa.net/john/
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to