Mail Archives: djgpp/2000/05/28/03:26:41
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.
- Raw text -