Re: Fwd: Eorror compiling GCC-4.8.0 for Solaris 2.9 and 2.10

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lincoln,

> I am getting the error below when I try to compile gcc-4.8.0.  Can someone
> assist me with a possible solution:

it usually helps if you provide some context:

* What host compiler did you use?

* How exactly did you configure gcc?

> "/tmp/gcc-4.8.0/libcpp/files.c", line 1268: Error: Cannot assign char* to int.
> "/tmp/gcc-4.8.0/libcpp/files.c", line 1371: Warning (Anachronism): Formal
> argument 2 of type extern "C" int(*)(void**,void*) in call to
> htab_traverse(htab*, extern "C" int(*)(void**,void*), void*) is being
> passed int(*)(void**,void*).
> "/tmp/gcc-4.8.0/libcpp/files.c", line 1380: Warning (Anachronism): Formal
> argument 4 of type extern "C" int(*)(const void*,const void*) in call to
> std::qsort(void*, unsigned, unsigned, extern "C" int(*)(const void*,const
> void*)) is being passed int(*)(const void*,const void*).
> "/tmp/gcc-4.8.0/libcpp/files.c", line 1386: Error: The function "__flsbuf"
> must have a prototype.
> "/tmp/gcc-4.8.0/libcpp/files.c", line 1530: Error: The function "__filbuf"
> must have a prototype.
> "/tmp/gcc-4.8.0/libcpp/files.c", line 1570: Error: The function "__filbuf"
> must have a prototype.
> "/tmp/gcc-4.8.0/libcpp/files.c", line 1584: Error: The function "__filbuf"
> must have a prototype.
> "/tmp/gcc-4.8.0/libcpp/files.c", line 1597: Error: The function "__filbuf"
> must have a prototype.
> "/tmp/gcc-4.8.0/libcpp/files.c", line 1677: Error: The function "__flsbuf"
> must have a prototype.
> "/tmp/gcc-4.8.0/libcpp/files.c", line 1834: Warning (Anachronism): Formal
> argument 4 of type extern "C" int(*)(const void*,const void*) in call to
> std::qsort(void*, unsigned, unsigned, extern "C" int(*)(const void*,const
> void*)) is being pa
> ssed int(*)(const void*,const void*).
> "/tmp/gcc-4.8.0/libcpp/files.c", line 1932: Warning (Anachronism): Formal
> argument 5 of type extern "C" int(*)(const void*,const void*) in call to
> std::bsearch(const void*, const void*, unsigned, unsigned, extern "C"
> int(*)(const void*,cons
> t void*)) is being passed int(*)(const void*,const void*).
> 7 Error(s) and 11 Warning(s) detected.
> make[3]: *** [Makefile:223: files.o] Error 7
> make[3]: Leaving directory '/tmp/gcc-4.8.0/objdir/libcpp'
> make[2]: *** [Makefile:9816: all-stage1-libcpp] Error 2
> make[2]: Leaving directory '/tmp/gcc-4.8.0/objdir'
> make[1]: *** [Makefile:20357: stage1-bubble] Error 2
> make[1]: Leaving directory '/tmp/gcc-4.8.0/objdir'
> make: *** [Makefile:889: all] Error 2

>From the format of the error messages I suppose you've been trying to
use some version of the Studio compilers?  If so, you'll probably have a
hard time with anything newer than GCC 4.7 which is the last version
that can be compiled with a C90 compiler.  While in theory GCC 4.8 and
up should work with any C++98 compiler, this hasn't been tried with
anything but g++ (and probably clang++) in a long time, so you're almost
guaranteed to run into lots of problems.

On Solaris 9, I'd strongly suggest to either build GCC 4.7 with a
preexisting version of gcc (pretty much any version should do) or
probably even Studio cc.  If you like (and I'd recommend to try this),
you should use this freshly built version of gcc 4.7 to bootstrap GCC
4.9 (the last version supporting Solaris 9).

On Solaris 10, you have a preinstalled version of gcc 3.4.3 in
/usr/sfw/bin to start from.   In theory (I haven't tried this myself),
this should be good enough to build even GCC 9, the last version
supported on Solaris 10.  If that fails for some reason, you can try to
go via some intermediate version of gcc instead.

In both cases I strongly recommend you thoroughly review the
installation docs for the version of gcc you're building not to fall
into traps that are already known.

Besides, unless you're strictly wedded to GCC 4.8 for some reason, it's
in your best interest to go for the last version of GCC supported on
your Solaris versions which are certain to have all sorts of bugs
already fixed.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux