Andre:

On 07/20/10 01:25 PM, Andre Lue wrote:
getting  "ld: fatal: file smartd.o: wrong ELF class: ELFCLASS64" when trying to 
build 64 bit versions of programs for most things where the 32 bit version  builds fine.

if I recompose the failure line and add -m64 it completes. Am I doing something 
wrong or is there something wrong with the code? Can someone guide me on a 
proper fix for this?

You need to use the -m64 argument ot build ELFCLASS64 (amd64) code.  You
can refer to the following files to see what special arguments are
passed into the compiler for different architectures.

For arch64:

http://src.opensolaris.org/source/xref/jds/spec-files/trunk/include/arch64.inc

For x86:

http://src.opensolaris.org/source/xref/jds/spec-files/trunk/include/base.inc

Here is an example of a spec-file that builds both i386 and amd64:

http://src.opensolaris.org/source/xref/jds/spec-files/trunk/specs/SUNWliboil.spec
http://src.opensolaris.org/source/xref/jds/spec-files/trunk/base-specs/liboil.spec

Note the SUNWliboil.spec file uses the liboil.spec via "%use".

Note how the SUNWliboil.spec uses %ifarch amd64 sparcv9, and how
the %build/%install sections process the liboil.spec to build/install
the code twice.  Once for i386 and once for amd64.  This works well for
us, so I would recommend using this sort of technique.

Brian
_______________________________________________
opensolaris-discuss mailing list
opensolaris-discuss@opensolaris.org

Reply via email to