SUMMARY: Problem linking 64-bit binaries

From: Dieter Gobbers (
Date: Mon Aug 09 1999 - 07:18:05 CDT

Original question:
Hello everybody,

i've installed the Sun Workshop Compiler 5.0 and now I'm trying to compile some
programs in 64-bit mode for Solaris 7 (machine is an Enterprise 250).

Compiling with "-fast -xtarget=ultra -xarch=v9a" is OK, but at the linking
stage I get the following error:

ld: fatal: file ssh.o: wrong machine class

# file ssh.o
ssh.o: ELF 64-bit MSB relocatable SPARCV9 Version 1, UltraSPARC1
Extensions Required

can anybody give me a hint what the problem is?

> From: Tom Erickson <>
> When you installed Solaris 7, did you install the 64 bit
> version of the OS?

Yes, we've installed the 64 bit version of the OS.


> From: Casper Dik <>
> Are you linking with the -xarch=v9a flags as well?
> Check the link command line; the linker will use the machine type of the
> first object on the command line; make sure all the relevant 64 bits
> packages have been installed.

That's it! I've gone through the "ld" manpage but haven't found a hint like
this. Instead i found the following statement in the manpage:

        There is no specific option that tells ld to link 64-bit
        objects; the class of the first object that gets processed
        by ld determines whether it is to perform a 32-bit or a
        64-bit link edit.

I've set LDFLAGS to -xarch=v9a, rerun the configure script and the compiling
and linking worked!

Thank you both,

Dieter Gobbers
UNIX System and Network Administrator

im Auftrag des FAW Ulm (

Ingenieurbuero Dieter Gobbers; Unix- und Netzwerkberatung und -betreuung Kreuzstr. 19, 89160 Dornstadt, Tel.: 07348/928538 email:,

This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:13:24 CDT