John,

The program that I was trying to compile is net-snmp. The flag that you
suggested didn't seem to affect the output of the binaries for some reason.
The older SUN machine actually runs solaris 2.7 while the "newer" one still
runs 2.6.  I would have thought that programs compiled in 2.6 should be
forward compatible with 2.7.  I was using gcc 3.1.1 on the sun4u machine.

When I compiled a simple "Hello World" program without the "-mcpu=v8" flag
on the sun4u machine, the executable was a simple "SPARC Version 1" - which
leads me to believe that there is probably either something funky in
net-snmp configuration file or I am using an incompatible gcc. Part of the
compilation messages is shown below:

gcc -mcpu=v8 -Dsolaris2 -I../../include -I../../include -I. -I../.. -I. -I./
../.. -I./../../snmplib -I./.. -I.. -I/usr/local/ssl/include -c
mibII/system_mib.c -o mibII/system_mib.o

I downgraded to gcc 2.8.1 but that didn't seem to fix it. Looks like I'll
have to try gcc 3.2.

Matt,

The error message I was getting in the sun4m machine was "Exec format error.
Binary file not executable".

Thanks,
--SH

-----Original Message-----
From: John Clarke [mailto:johnc+slug@;kirriwa.net]
Sent: Wednesday, 13 November 2002 5:19 PM

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.
-- 
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug

Reply via email to