Index: gcc/config.gcc =================================================================== --- gcc/config.gcc (revision 162059) +++ gcc/config.gcc (working copy) @@ -405,6 +405,9 @@ case ${target} in ;; esac +# Common C libraries. There are mere constants. +tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" + # Common parts for widely ported systems. case ${target} in *-*-darwin*) @@ -508,8 +511,6 @@ case ${target} in *-*-gnu*) tmake_file="$tmake_file t-gnu";; esac - # Common C libraries. - tm_defines="$tm_defines LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3" # glibc / uclibc / bionic switch. # uclibc and bionic aren't usable for GNU/Hurd and neither for GNU/k*BSD. case $target in Index: gcc/config/linux.h =================================================================== --- gcc/config/linux.h (revision 162059) +++ gcc/config/linux.h (working copy) @@ -96,8 +96,6 @@ see the files COPYING3 and COPYING.RUNTI builtin_assert ("system=linux"); \ builtin_assert ("system=unix"); \ builtin_assert ("system=posix"); \ - if (OPTION_ANDROID) \ - builtin_define ("__ANDROID__"); \ } while (0) #if defined(HAVE_LD_EH_FRAME_HDR) Index: gcc/config/linux-android.h =================================================================== --- gcc/config/linux-android.h (revision 162059) +++ gcc/config/linux-android.h (working copy) @@ -20,6 +20,12 @@ along with GCC; see the file COPYING3. If not see . */ +#define ANDROID_TARGET_OS_CPP_BUILTINS() \ + do { \ + if (OPTION_ANDROID) \ + builtin_define ("__ANDROID__"); \ + } while (0) + #if ANDROID_DEFAULT # define NOANDROID "mno-android" #else Index: gcc/config/arm/linux-eabi.h =================================================================== --- gcc/config/arm/linux-eabi.h (revision 162059) +++ gcc/config/arm/linux-eabi.h (working copy) @@ -27,6 +27,7 @@ { \ TARGET_BPABI_CPP_BUILTINS(); \ LINUX_TARGET_OS_CPP_BUILTINS(); \ + ANDROID_TARGET_OS_CPP_BUILTINS(); \ } \ while (false)