sparcv9-sun-solaris2.8 ABI=64 fails to build

Dennis Clarke dclarke at blastwave.org
Tue Jul 14 21:54:40 CEST 2009


I have tried this with GCC 4.3.3 and binutils 2.19.1 and the build process
fails at mpn/sparc64/dive_1.c because of a problem in
mpn/sparc64/sparc64.h

Studio compilers file also, of course.

The issue seems to be with the absence of HALF_ENDIAN_ADJ defined.

in mpn/sparc64/sparc64.h we have :

/* Halfword number i in src is accessed as src[i+HALF_ENDIAN_ADJ(i)].
   Plain src[i] would be incorrect in big endian, HALF_ENDIAN_ADJ has the
   effect of swapping the two halves in this case.  */
#if HAVE_LIMB_BIG_ENDIAN
#define HALF_ENDIAN_ADJ(i)  (1 - (((i) & 1) << 1))   /* +1 even, -1 odd */
#endif
#if HAVE_LIMB_LITTLE_ENDIAN
#define HALF_ENDIAN_ADJ(i)  0                        /* no adjust */
#endif
#ifndef HALF_ENDIAN_ADJ
Error, error, unknown limb endianness;
#endif

So if HALF_ENDIAN_ADJ is not defined we get an error.

That is what happens.

That last thing I see from GCC ( or Studio 12 etc ) is :

/bin/bash ../libtool --mode=compile /opt/csw/gcc4/bin/gcc -DHAVE_CONFIG_H
-I. -I../../gmp-4.3.1/mpn -I.. -D__GMP_WITHIN_GMP -I../../gmp-4.3.1
-DOPERATION_`echo dive_1 | sed 's/_$//'`  -I/opt/csw/include  -m64 -mptr64
-Wa,-xarch=v9 -mcpu=v9 -mno-app-regs -g -Qy -c -o dive_1.lo dive_1.c
 /opt/csw/gcc4/bin/gcc -DHAVE_CONFIG_H -I. -I../../gmp-4.3.1/mpn -I..
-D__GMP_WITHIN_GMP -I../../gmp-4.3.1 -DOPERATION_dive_1
-I/opt/csw/include -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9 -mno-app-regs -g
-Qy -c dive_1.c  -fPIC -DPIC -o .libs/dive_1.o
In file included from dive_1.c:28:
../../gmp-4.3.1/mpn/sparc64/sparc64.h:39: warning: data definition has no
type or storage class
../../gmp-4.3.1/mpn/sparc64/sparc64.h:39: error: expected '=', ',', ';',
'asm' or '__attribute__' before 'limb'
gmake[2]: *** [dive_1.lo] Error 1
gmake[2]: Leaving directory
`/export/medusa/dclarke/build/LIBGMP/sparc_v9_gcc/mpn'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory
`/export/medusa/dclarke/build/LIBGMP/sparc_v9_gcc'
gmake: *** [all] Error 2


I can isolate dive_1.c and all required headers and do this :

$ find . -type f
./config.h
./longlong.h
./gmp.h
./gmp-impl.h
./fib_table.h
./mp_bases.h
./mpn/sparc64/sparc64.h
./mpn/sparc64/gmp-mparam.h
./dive_1.c

The manually try to compile thus :

$ gcc -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9 -mno-app-regs -v -fPIC -DPIC \
> -I. -Impn/sparc64 -D__GMP_WITHIN_GMP -DHAVE_CONFIG_H \
> -DOPERATION_dive_1 -c -o dive_1.o dive_1.c
Using built-in specs.
Target: sparc-sun-solaris2.8
Configured with: ../gcc-4.3.3/configure --with-gnu-as
--with-as=/opt/csw/bin/gas --with-gnu-ld --with-ld=/opt/csw/bin/gld
--with-cpu=v7 --enable-threads=posix --enable-nls --prefix=/opt/csw/gcc4
--with-local-prefix=/opt/csw --enable-shared --enable-multilib
--with-included-gettext --with-libiconv-prefix=/opt/csw --with-system-zlib
--with-gmp=/opt/csw --with-mpfr=/opt/csw
--enable-languages=c,c++,fortran,objc,ada --enable-bootstrap
Thread model: posix
gcc version 4.3.3 (GCC)
COLLECT_GCC_OPTIONS='-m64' '-mptr64' '-mcpu=v9' '-mno-app-regs' '-v'
'-fPIC' '-DPIC' '-I.' '-Impn/sparc64' '-D__GMP_WITHIN_GMP'
'-DHAVE_CONFIG_H' '-DOPERATION_dive_1' '-c' '-o' 'dive_1.o'
 /opt/csw/gcc4/libexec/gcc/sparc-sun-solaris2.8/4.3.3/cc1 -quiet -v -I.
-Impn/sparc64 -imultilib sparcv9 -D__arch64__ -D__sparcv9 -DPIC
-D__GMP_WITHIN_GMP -DHAVE_CONFIG_H -DOPERATION_dive_1 dive_1.c -mptr64
-mstack-bias -mno-v8plus -quiet -dumpbase dive_1.c -m64 -mptr64 -mcpu=v9
-mno-app-regs -auxbase-strip dive_1.o -version -fPIC -o
/var/tmp//ccmzQWL5.s
ignoring nonexistent directory
"/opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/../../../../sparc-sun-solaris2.8/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 mpn/sparc64
 /opt/csw/include
 /opt/csw/gcc4/include
 /opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/include
 /opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/include-fixed
 /usr/include
End of search list.
GNU C (GCC) version 4.3.3 (sparc-sun-solaris2.8)
        compiled by GNU C version 4.3.3, GMP version 4.3.1, MPFR version
2.4.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 8a6b1c839f0760e9974489a01b9216f6
In file included from dive_1.c:28:
mpn/sparc64/sparc64.h:39: warning: data definition has no type or storage
class
mpn/sparc64/sparc64.h:39: error: expected '=', ',', ';', 'asm' or
'__attribute__' before 'limb'
$


see that failure there ?

Now we just define HALF_ENDIAN_ADJ and we see this :

$ gcc -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9 -mno-app-regs -v -fPIC -DPIC \
> -I. -Impn/sparc64 -D__GMP_WITHIN_GMP -DHAVE_CONFIG_H \
> -DOPERATION_dive_1 -DHALF_ENDIAN_ADJ -c -o dive_1.o dive_1.c
Using built-in specs.
Target: sparc-sun-solaris2.8
Configured with: ../gcc-4.3.3/configure --with-gnu-as
--with-as=/opt/csw/bin/gas --with-gnu-ld --with-ld=/opt/csw/bin/gld
--with-cpu=v7 --enable-threads=posix --enable-nls --prefix=/opt/csw/gcc4
--with-local-prefix=/opt/csw --enable-shared --enable-multilib
--with-included-gettext --with-libiconv-prefix=/opt/csw --with-system-zlib
--with-gmp=/opt/csw --with-mpfr=/opt/csw
--enable-languages=c,c++,fortran,objc,ada --enable-bootstrap
Thread model: posix
gcc version 4.3.3 (GCC)
COLLECT_GCC_OPTIONS='-m64' '-mptr64' '-mcpu=v9' '-mno-app-regs' '-v'
'-fPIC' '-DPIC' '-I.' '-Impn/sparc64' '-D__GMP_WITHIN_GMP'
'-DHAVE_CONFIG_H' '-DOPERATION_dive_1' '-DHALF_ENDIAN_ADJ' '-c' '-o'
'dive_1.o'
 /opt/csw/gcc4/libexec/gcc/sparc-sun-solaris2.8/4.3.3/cc1 -quiet -v -I.
-Impn/sparc64 -imultilib sparcv9 -D__arch64__ -D__sparcv9 -DPIC
-D__GMP_WITHIN_GMP -DHAVE_CONFIG_H -DOPERATION_dive_1 -DHALF_ENDIAN_ADJ
dive_1.c -mptr64 -mstack-bias -mno-v8plus -quiet -dumpbase dive_1.c -m64
-mptr64 -mcpu=v9 -mno-app-regs -auxbase-strip dive_1.o -version -fPIC -o
/var/tmp//cc1IVowX.s
ignoring nonexistent directory
"/opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/../../../../sparc-sun-solaris2.8/include"
#include "..." search starts here:
#include <...> search starts here:
 .
 mpn/sparc64
 /opt/csw/include
 /opt/csw/gcc4/include
 /opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/include
 /opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/include-fixed
 /usr/include
End of search list.
GNU C (GCC) version 4.3.3 (sparc-sun-solaris2.8)
        compiled by GNU C version 4.3.3, GMP version 4.3.1, MPFR version
2.4.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 8a6b1c839f0760e9974489a01b9216f6
COLLECT_GCC_OPTIONS='-m64' '-mptr64' '-mcpu=v9' '-mno-app-regs' '-v'
'-fPIC' '-DPIC' '-I.' '-Impn/sparc64' '-D__GMP_WITHIN_GMP'
'-DHAVE_CONFIG_H' '-DOPERATION_dive_1' '-DHALF_ENDIAN_ADJ' '-c' '-o'
'dive_1.o'
 /opt/csw/bin/gas -v -I. -Impn/sparc64 -V -Qy -s -K PIC -TSO -64 -Av9
-xarch=v9 -o dive_1.o /var/tmp//cc1IVowX.s
GNU assembler version 2.19.1 (sparc-sun-solaris2.8) using BFD version (GNU
Binutils) 2.19.1
COMPILER_PATH=/opt/csw/gcc4/libexec/gcc/sparc-sun-solaris2.8/4.3.3/:/opt/csw/gcc4/libexec/gcc/sparc-sun-solaris2.8/4.3.3/:/opt/csw/gcc4/libexec/gcc/sparc-sun-solaris2.8/:/opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/:/opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/:/usr/ccs/bin/
LIBRARY_PATH=/opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/sparcv9/:/usr/ccs/lib/sparcv9/:/opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/../../../sparcv9/:/lib/sparcv9/:/usr/lib/sparcv9/:/opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/:/usr/ccs/lib/:/opt/csw/gcc4/lib/gcc/sparc-sun-solaris2.8/4.3.3/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-m64' '-mptr64' '-mcpu=v9' '-mno-app-regs' '-v'
'-fPIC' '-DPIC' '-I.' '-Impn/sparc64' '-D__GMP_WITHIN_GMP'
'-DHAVE_CONFIG_H' '-DOPERATION_dive_1' '-DHALF_ENDIAN_ADJ' '-c' '-o'
'dive_1.o'

$ ls -lap dive_1.o
-rw-r--r--   1 dclarke  csw         2656 Jul 14 20:00 dive_1.o
$ file dive_1.o
dive_1.o:       ELF 64-bit MSB relocatable SPARCV9 Version 1

But that won't happen when doing the libgmp build and the process fails of
course.

any thoughts ?



-- 
Dennis Clarke






More information about the gmp-bugs mailing list