While doing a canadian cross build I ran into a problem with the caddr_t type. configure.ac is using an obsolete version of AC_CHECK_TYPE to create #define's of caddr_t and ssize_t if they are not defined by the system. In addition to using an obsolete version of AC_CHECK_TYPE this was causing a problem in my build because caddr_t was also getting set via a typedef by the mingw compilers.
Here is my fix, tested with a canadian cross build and with a native x86 linux build. OK to checkin? 2013-11-01 Steve Ellcey <sell...@mips.com> * configure.ac: Add header checks for fenv.h and complex.h. * configure: Regenerate. * config.in: Regnerate. * system.h: Add default caddr_t and ssize_t typedefs. diff --git a/gcc/configure.ac b/gcc/configure.ac index 5e686db..bc87073 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -1075,8 +1075,8 @@ int main() fi fi -AC_CHECK_TYPE(ssize_t, int) -AC_CHECK_TYPE(caddr_t, char *) +AC_CHECK_TYPES([ssize_t]) +AC_CHECK_TYPES([caddr_t]) GCC_AC_FUNC_MMAP_BLACKLIST diff --git a/gcc/system.h b/gcc/system.h index a1fc6de..108ec0e 100644 --- a/gcc/system.h +++ b/gcc/system.h @@ -1060,6 +1060,14 @@ helper_const_non_const_cast (const char *p) #define DEBUG_VARIABLE #endif +#ifndef HAVE_CADDR_T +typedef char *caddr_t; +#endif + +#ifndef HAVE_SSIZE_T +typedef int ssize_t +#endif + /* Get definitions of HOST_WIDE_INT and HOST_WIDEST_INT. */ #include "hwint.h"