Date: Sun, 28 May 2000 10:24:43 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Neil Townsend cc: djgpp AT delorie DOT com Subject: Re: Building a cross compiler In-Reply-To: <2000May25.121307.17959@arragonrobots.ox.ac.uk> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Thu, 25 May 2000, Neil Townsend wrote: > In file included from ../../gcc-2.95.2/gcc/libgcc2.c:48: > include/stddef.h:170: warning: redefinition of `size_t' > /users/neil/bli/sun4-sunos/lib/gcc-lib/i386-pc-msdosdjgpp/2.95.2/../../../../i386-pc-msdosdjgpp/sys-include/stdlib.h:36: warning: `size_t' previously declared here > include/stddef.h:255: conflicting types for `wchar_t' > /users/neil/bli/sun4-sunos/lib/gcc-lib/i386-pc-msdosdjgpp/2.95.2/../../../../i386-pc-msdosdjgpp/sys-include/stdlib.h:39: previous declaration of `wchar_t' > make[2]: *** [libgcc2.a] Error 1 > make[2]: Leaving directory `/tmp/djgpp/cross/build-gcc/gcc' > make[1]: *** [all-gcc] Error 2 > make[1]: Leaving directory `/tmp/djgpp/cross/build-gcc' > > [End quoted failure message] > > ie. There appears to be a conflict between the djgpp headers and the > stddef.h file generated by the gcc build process. It would be possible > to resolve this and complete the compilation by adding #define _SIZE_T > and #define _WCHAR_T at appropriate places in djgpp's stdlib.h. However, > if one does this one can compile 'hello world' with the resulting > compiler just fine. However, problems like this: > > /users/neil/bli/sun4/lib/gcc-lib/i386-pc-msdosdjgpp/2.95.2/../../../../i386-pc-msdosdjgpp/sys-include/go32.h:19: warning: redefinition of `size_t' > /users/neil/bli/sun4/lib/gcc-lib/i386-pc-msdosdjgpp/2.95.2/include/stddef.h:170: warning: `size_t' previously declared here > > arise when using multiple system header files and repeated clashes > occur between DJGPP files and stddef.h This is a known issue with current versions of GCC: it uses its own versions of stddef.h and a few other headers, which redefine key data types and macros without paying attention to system headers of whatever librray is used to build GCC. Moreover, GCC also installs those invasive headers when you say "make install" in a way that you will always see such conflicts. A simple solution is to hack the GCC headers (as you did) during the build, and then remove them from the GCC's own include directory (the second one in the last error message you posted above). You don't need those headers anyway, they are just a pest. A better solution would be to modify GCC's headers so that they will not conflict with the ones supplied by DJGPP. But that requires cooperation from the GCC maintainers. Hopefully, it will be solved in some future version of GCC.