make check failed due to 32/64 bits problem

Marc Glisse marc.glisse at
Mon Nov 3 16:15:48 CET 2008

On Mon, 3 Nov 2008, Ling Shi wrote:

> t-bswap: fatal: /usr/sfw/lib/ wrong ELF class: 

Sun still hasn't fixed the specs of the gcc they ship? :-(

You can try adding -R/usr/sfw/lib/amd64 to LDFLAGS.
Search this list for other emails where I explain the issue if needed.

> I don't have a 64 bits gcc yet. If you have a "force to 32 bits" option,
> that'd fix the problem.

Read the doc. ABI=32 is the "force to 32 bits" option. And indeed, unless 
you want to build a 64 bits gcc, it is probably what you need.

> BTW, I tried using Sun Studio 12 instead of gcc,
> [ling at mure] gmp-4.2.4 [2:1406] CC=cc ./configure 
> --prefix=/usr/local/apps/gmp-4.2.4
>  :
> checking size of mp_limb_t... 4
> configure: error: Oops, mp_limb_t is 32 bits, but the assembler code
> in this configuration expects 64 bits.
> [ling at mure] gmp-4.2.4 [2:1415] cc -V
> cc: Sun C 5.9 SunOS_i386 Patch 124868-01 2007/07/12
> config.log from this run is attached.

I think the gmp configure tries 64 bits by default but does not know how 
to force 64-bit mode on x86_64 with the Sun compiler (-xarch=whatever, or 
-m64 for the latest version), so it just uses the default mode, sees that 
it happily compiles, does not check that the result is indeed 64 bits, and 
decides that 64 bits it is. If that is it, I had the same issue on linux 
with suncc but never got round to submitting an actual bug report. In any 
case you can specify whatever options are appropriate with CFLAGS.

Future versions of solaris should ship with gmp included (I think it was 
accepted recently), but I have no idea when that is.

Marc Glisse

PS: I notice the latest sparc64 processors have FPMADDXHI, maybe a first 
step to reconcile gmp and Sun (well Fujitsu really) :-)

More information about the gmp-bugs mailing list