Build error in gmp 4.2.2

Michael J. Bauer mjbauer at
Tue Mar 25 17:34:41 CET 2008

I am attempting to build gmp 4.2.2 from source on a Sunfire V120 running 
Solaris 10.  I am finding a build error with a 64-bit build and C++ 
support enabled.  I am using gcc and the stock Solaris build tools 
(make, ld, ar, ranlib, and so on)

Pertinent information:

# gcc --version
gcc (GCC) 3.4.6
# ./configure --prefix=/usr/local/package2 
--oldincludedir=/usr/local/package2/include --enable-cxx
(The error only happens with C++ support enabled.  The peculiar location 
is so I can make a Solaris package; the real install will happen in 
# setenv ABI 64
(This error does not happen with ABI 32, but does happen with ABI unset.)

I've hand-compiled dummy.o as 64-bit, but several other .o files also 
come up 32-bit.

The actual error sequence:

/bin/bash ./libtool --mode=compile g++ -DHAVE_CONFIG_H -I. -I. -I. 
-D__GMP_WITHIN_GMP    -g -O2 -c -o dummy.lo `test -f 'cxx/' || 
echo './'`cxx/
 g++ -DHAVE_CONFIG_H -I. -I. -I. -D__GMP_WITHIN_GMP -g -O2 -c 
cxx/  -fPIC -DPIC -o .libs/dummy.o
 g++ -DHAVE_CONFIG_H -I. -I. -I. -D__GMP_WITHIN_GMP -g -O2 -c 
cxx/ -o dummy.o >/dev/null 2>&1
/bin/bash ./libtool --mode=link g++  -g -O2    -o -rpath 
/usr/local/package2/lib -Wc,-m64   -version-info 4:2:0 dummy.lo 
cxx/isfuns.lo cxx/ismpf.lo cxx/ismpq.lo cxx/ismpz.lo 
cxx/ismpznw.lo         cxx/osdoprnti.lo 
cxx/osfuns.lo                                  cxx/osmpf.lo cxx/osmpq.lo 
g++ -shared -nostdlib  
.libs/dummy.o cxx/.libs/isfuns.o cxx/.libs/ismpf.o cxx/.libs/ismpq.o 
cxx/.libs/ismpz.o cxx/.libs/ismpznw.o cxx/.libs/osdoprnti.o 
cxx/.libs/osfuns.o cxx/.libs/osmpf.o cxx/.libs/osmpq.o 
cxx/.libs/osmpz.o  -Wl,-R -Wl,/tmp/Software/gmp-4.2.2-64/.libs -Wl,-R 
-Wl,/usr/local/lib/sparcv9 -Wl,-R -Wl,/usr/local/package2/lib -Wl,-R 
-Wl,/usr/local/lib/sparcv9 -Wl,-R -Wl,/usr/local/lib -Wl,-R 
-Wl,/usr/local/ssl/lib -Wl,-R -Wl,/usr/openwin/lib ./.libs/ 
-L/usr/ccs/bin/sparcv9 -L/usr/ccs/bin -L/usr/ccs/lib/sparcv9 
-L/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/../../.. -L/lib/sparcv9 
-L/usr/lib/sparcv9 /usr/local/lib/sparcv9/ 
-L/usr/local/lib -L/usr/local/ssl/lib -L/usr/openwin/lib 
-L/sol10/SOURCES/S10/gcc-3.4.6/objdir/gcc -L/usr/local/lib/sparcv9 -lm 
/usr/local/lib/gcc/sparc-sun-solaris2.10/3.4.6/sparcv9/crtn.o  -m64 
-Wl,-h -Wl, -o .libs/
ld: fatal: file .libs/dummy.o: wrong ELF class: ELFCLASS32
ld: fatal: File processing errors. No output written to 
collect2: ld returned 1 exit status

More information about the gmp-bugs mailing list