Gcc3.2 build error on Solaris 10

Kai Ruottu karuottu@mbnet.fi
Wed Jul 19 17:40:00 GMT 2006


Dan Keating wrote (almost two weeks ago):
> I'm having problems building gcc3.2 on a solaris 10 system. Gcc2.95.3 builds
> fine, but 3.2 and 3.2.3 both fall down with the following error:
>
> /temp/bsm/gcc-sun10/gcc/xgcc -B/temp/bsm/gcc-sun10/gcc/
> -B/lang/gcc/3.2/sparc-sun-solaris2.10/bin/
> -B/lang/gcc/3.2/sparc-sun-solaris2.10/lib/ -isystem
> /lang/gcc/3.2/sparc-sun-solaris2.10/include -DHAVE_CONFIG_H -I.
> -I../../../../gcc-3.2/libstdc++-v3/libmath -I.. -g -O2 -c
> .../../../../gcc-3.2/libstdc++-v3/libmath/signbit.c -o signbit.o
> In file included from ../../../../gcc-3.2/libstdc++-v3/libmath/signbit.c:32:
> .../../../../gcc-3.2/libstdc++-v3/libmath/mathconf.h:84: conflicting types
> for `nan'
> /usr/include/iso/math_c99.h:145: previous declaration of `nan'
>
> Configure is being run with parameters "--enable-languages=c++
> --disable-shared".
>
> Hopefully there's someone who can see a cause for this.
>   
The newer GCCs like gcc-3.4.6 have fixed the 'libmath/mathconf.h' as 
follows:

-------------- clip ------------------------------------
*** mathconf.h Thu Aug 16 15:49:19 2001
--- ../../../gcc-3.4.6/libstdc++-v3/libmath/mathconf.h Fri Jan 23 
18:50:34 2004
***************
*** 79,89 ****
# include <nan.h>
#endif

- #ifndef NAN
- # define NAN (nan())
- double nan (void);
- #endif
-
#ifdef HAVE_IEEEFP_H
# include <ieeefp.h>
#endif
--- 79,84 ----
-------------- clip ------------------------------------

With this patch the error should disappear... But there are other things to
consider like the '*-*-solaris2.10' targets (x86 and sparc) totally 
being missing
from the 'gcc/config.gcc' template and from the libstdc++-v3 configure 
choices!
Assuming the '10' being "similar with the '9'" and these both being 
similar with
the '8', could help things, also the 'solaris2.9' support is missing 
from the 3.2.3
sources. So the beginning of the 'sparc-*-solaris2*' template in 
'gcc/config.gcc'
could be as follows:

-------------- clip ------------------------------------
sparc-*-solaris2*)
tm_file="${tm_file} dbxelf.h elfos.h svr4.h sparc/sysv4.h sparc/sol2.h"
if test x$gnu_ld = xyes; then
tm_file="${tm_file} sparc/sol2-gld.h"
fi
tmake_file="sparc/t-sol2 sparc/t-crtfm"
if test x$gnu_ld = xyes; then
tmake_file="$tmake_file t-slibgcc-elf-ver"
else
tmake_file="$tmake_file t-slibgcc-sld"
fi
case $machine in
*-*-solaris2.[789] | *-*-solaris2.1[0-9])
tm_file="sparc/biarch64.h ${tm_file} sparc/sol2-bi.h"
if test x$gnu_ld = xyes; then
tm_file="${tm_file} sparc/sol2-gld-bi.h"
fi
if test x$gas = xyes; then
tm_file="${tm_file} sparc/sol2-gas-bi.h"
fi
tmake_file="$tmake_file sparc/t-sol2-64"
;;
esac
-------------- clip ------------------------------------

and the 'libstdc++-v3/configure.target' have :

-------------- clip ------------------------------------
irix6.5)
os_include_dir="config/os/irix/irix6.5"
;;
mingw32*)
os_include_dir="config/os/mingw32"
;;
netbsd*)
os_include_dir="config/os/bsd/netbsd"
;;
solaris2.5*)
os_include_dir="config/os/solaris/solaris2.5"
;;
solaris2.6*)
os_include_dir="config/os/solaris/solaris2.6"
;;
solaris2.7* | solaris2.8* | solaris2.9* | solaris2.10*)
os_include_dir="config/os/solaris/solaris2.7"
;;
-------------- clip ------------------------------------

for defining the 'os_include_dir' being right....

This latter file was fixed years ago when producing crosstools for
Solaris8, and it can be that these choices were originally in the
'configure.in' there but were moved to the 'configure.target' for
some 'compatability' reasons (other similar choices were there?).
In any case "something should be done" in there to get this thing
right...

Unfortunately it took this long for me to look at this, fix what should
be fixed, and produce the tools (maybe a week ago), and to remember
telling these things :-(

,



More information about the Gcc-help mailing list