This is a workaround for gcc 4.8 not compiling (HAVE_DECL_* being set incorrectly) with the prehistoric host toolchain installed in android-build.linaro.org. This patch is not necessary for modern systems and should not be upstreamed. --- gcc/gcc/system.h.bero 2013-04-19 18:37:29.764527002 +0200 +++ gcc/gcc/system.h 2013-04-19 18:38:30.364769395 +0200 @@ -440,11 +440,11 @@ extern int getpagesize (void); extern char *getwd (char *); #endif -#if defined (HAVE_DECL_SBRK) && !HAVE_DECL_SBRK +#if 0 && defined (HAVE_DECL_SBRK) && !HAVE_DECL_SBRK extern void *sbrk (int); #endif -#if defined (HAVE_DECL_STRSTR) && !HAVE_DECL_STRSTR +#if 0 && defined (HAVE_DECL_STRSTR) && !HAVE_DECL_STRSTR extern char *strstr (const char *, const char *); #endif @@ -494,7 +494,7 @@ extern "C" { /* If the system doesn't provide strsignal, we get it defined in libiberty but no declaration is supplied. */ -#if !defined (HAVE_STRSIGNAL) \ - || (defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL) +#if 0 && (!defined (HAVE_STRSIGNAL) \ + || (defined (HAVE_DECL_STRSIGNAL) && !HAVE_DECL_STRSIGNAL)) # ifndef strsignal extern const char *strsignal (int); --- gcc/include/libiberty.h.bero 2013-04-19 18:38:38.884662882 +0200 +++ gcc/include/libiberty.h 2013-04-19 18:38:48.924537366 +0200 @@ -105,7 +105,7 @@ extern int countargv (char**); declaration without arguments. If it is 0, we checked and failed to find the declaration so provide a fully prototyped one. If it is 1, we found it so don't provide any declaration at all. */ -#if !HAVE_DECL_BASENAME +#if 0 && !HAVE_DECL_BASENAME #if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__MINGW32__) || defined (HAVE_DECL_BASENAME) extern char *basename (const char *); #else --- gcc/gcc/configure.ac.ubuntusucks 2013-04-21 10:46:57.515599697 +0200 +++ gcc/gcc/configure.ac 2013-04-21 10:47:29.145202060 +0200 @@ -1117,15 +1117,6 @@ #endif ]) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ -#include "ansidecl.h" -#include "system.h" -#ifdef HAVE_SYS_RESOURCE_H -#include -#endif -]], [[rlim_t l = 0;]])],[],[AC_DEFINE([rlim_t],[long], -[Define to `long' if doesn't define.])]) - # On AIX 5.2, conflicts with , as both define incompatible # FREAD and FWRITE macros. Fortunately, for GCC's single usage of ldgetname # in collect2.c, isn't visible, but the configure test below needs --- gcc/gcc/configure.ubuntusucks 2013-04-21 10:46:51.325733233 +0200 +++ gcc/gcc/configure 2013-04-21 10:47:56.774854882 +0200 @@ -10437,32 +10437,6 @@ done -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include "ansidecl.h" -#include "system.h" -#ifdef HAVE_SYS_RESOURCE_H -#include -#endif - -int -main () -{ -rlim_t l = 0; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - -else - -$as_echo "#define rlim_t long" >>confdefs.h - -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - # On AIX 5.2, conflicts with , as both define incompatible # FREAD and FWRITE macros. Fortunately, for GCC's single usage of ldgetname # in collect2.c, isn't visible, but the configure test below needs