public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Compiling gcc-3.0.2 - Solaris 2.5.1
@ 2001-10-28  6:39 cmeli
  0 siblings, 0 replies; only message in thread
From: cmeli @ 2001-10-28  6:39 UTC (permalink / raw)
  To: gcc-help

As I promised in my previous email, here are the errors I encountered in
trying to compile this fresh new version..

As you may recall, I kept gcc-2.95.2 on this SPARC solaris 2.5.1 system,
and installed gcc-2.95.3 in a different path, to keep both around for the
moment.
I followed the documentation hints to have a symlink called gcc2, this
links to gcc-2.95.3's gcc.

The configuration is a basic one: (except for the CC=gcc2)
CC=gcc2 <gcc source path>/configure --enable-languages="c,c++" --disable-nls

(before anyone suggests I should use the older gcc-2.95.2, there was no
difference with regards to the errors. I did try that. Every time I 
clear out the gccobj directory where I do the build in.

From my analysis of the problems in compilation, they seem to arise from
configure thinking locale.h is not available when it is available.



This is the first error I got, in gcc/toplev.c:
/path-to-gcc/gcc-3.0.2/gcc/toplev.c: In function `main':
/path-to-gcc/gcc-3.0.2/gcc/toplev.c:4655: warning: implicit declaration of function `setlocale'
/path-to-gcc/gcc-3.0.2/gcc/toplev.c:4655: `LC_ALL' undeclared (first use in this function)
/path-to-gcc/gcc-3.0.2/gcc/toplev.c:4655: (Each undeclared identifier is reported only once
/path-to-gcc/gcc-3.0.2/gcc/toplev.c:4655: for each function it appears in.)
make[2]: *** [toplev.o] Error 1

I included #include <locale.h> after the #include <setjmp.h> in toplev.c,
and this module compiled.

Then I got this error:
/path-to-gcc/gcc-3.0.2/gcc/collect2.c: In function `handler':
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:475: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c: In function `main':
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:869: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:879: warning: implicit declaration of function `setlocale'
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:879: `LC_ALL' undeclared (first use in this function)
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:879: (Each undeclared identifier is reported only once
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:879: for each function it appears in.)
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:938: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:938: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:941: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:941: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:944: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:944: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:948: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:948: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:951: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:951: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:954: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:954: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c: In function `scan_prog_file':
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:2177: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/collect2.c:2179: warning: function declaration isn't a prototype
make[2]: *** [collect2.o] Error 1


I solved it by adding #include <locale.h> after #include <signal.h>

I had a similar error, afterwards, in gcc/gcc.c
/path-to-gcc/gcc-3.0.2/gcc/gcc.c: In function `fatal_error':
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5439: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/gcc.c: In function `main':
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5481: warning: implicit declaration of function `setlocale'
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5481: `LC_ALL' undeclared (first use in this function)
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5481: (Each undeclared identifier is reported only once
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5481: for each function it appears in.)
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5487: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5487: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5490: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5490: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5493: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5493: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5496: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5496: warning: function declaration isn't a prototype
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:5502: warning: function declaration isn't a prototype
make[2]: *** [gcc.o] Error 1

Again I added #include <locale.h> after #include <signal.h>

Same thing happened in gcc/cppmain.c:
/path-to-gcc/gcc-3.0.2/gcc/cppmain.c: In function `general_init':
/path-to-gcc/gcc-3.0.2/gcc/cppmain.c:108: warning: implicit declaration of function `setlocale'
/path-to-gcc/gcc-3.0.2/gcc/cppmain.c:108: `LC_ALL' undeclared (first use in this function)
/path-to-gcc/gcc-3.0.2/gcc/cppmain.c:108: (Each undeclared identifier is reported only once
/path-to-gcc/gcc-3.0.2/gcc/cppmain.c:108: for each function it appears in.)
make[2]: *** [cppmain.o] Error 1

I tried adding #include <locale.h> after #include <signal.h>
but it gave me an error that localedir was undeclared and stopped.

I found that extracting LC_ALL's definition from /usr/include/locale.h
and #define-ing it in gcc/cppmain.c worked as a temporary fix. Compilation
proceeded.

Similarly:
/path-to-gcc/gcc-3.0.2/gcc/gcov.c: In function `main':
/path-to-gcc/gcc-3.0.2/gcc/gcov.c:252: warning: implicit declaration of function `setlocale'
/path-to-gcc/gcc-3.0.2/gcc/gcov.c:252: `LC_ALL' undeclared (first use in this function)
/path-to-gcc/gcc-3.0.2/gcc/gcov.c:252: (Each undeclared identifier is reported only once
/path-to-gcc/gcc-3.0.2/gcc/gcov.c:252: for each function it appears in.)
make[2]: *** [gcov.o] Error 1


I had to add the same #define in gcc/gcov.c as including <locale.h> would not 
work, as with the previous module.

There are some curious warnings given later on:
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:574: warning: string length `727' is greater than the length `509' ISO C89 compilers are required to support
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:611: warning: string length `930' is greater than the length `509' ISO C89 compilers are required to support
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:761: warning: string length `564' is greater than the length `509' ISO C89 compilers are required to support
In file included from specs.h:1,
                 from /path-to-gcc/gcc-3.0.2/gcc/gcc.c:779:
/path-to-gcc/gcc-3.0.2/gcc/cp/lang-specs.h:60: warning: string length `928' is greater than the length `509' ISO C89 compilers are required to support
/path-to-gcc/gcc-3.0.2/gcc/gcc.c:1259: warning: string length `674' is greater than the length `509' ISO C89 compilers are required to support

Compilation is still proceeding and I think it might be successful at the end.

Meanwhile can anyone point me to some info on why configure might be failing
to find locale.h ?

Regards,
Clyde Meli

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2001-10-28  6:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-10-28  6:39 Compiling gcc-3.0.2 - Solaris 2.5.1 cmeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).