From 51b9db927f5dca75792b11cbc91266d6b842a6b2 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Thu, 27 May 2010 12:06:58 +0000 Subject: Support compilation for Android platform. Reimplement -mandroid. * config.gcc (*linux*): Include linux-android.h and linux-android.opt. (*android*): Set ANDROID_DEFAULT. (arm*-*-linux*): Include linux-android.h. (arm*-*-eabi*): Don't include previous -mandroid implementation. * config/arm/eabi.h: Remove, move Android-specific parts ... * config/linux-android.h: ... here. New file. * config/arm/eabi.opt: Rename to ... * config/linux-android.opt: ... this. (mandroid): Allow -mno-android option. Initialize based on ANDROID_DEFAULT. * config/linux.h (STARTFILE_SPEC, ENDFILE_SPEC, CC1_SPEC, LIB_SPEC): Move logic to corresponding LINUX_TARGET_* macros. (TARGET_OS_CPP_BUILTINS): Define __ANDROID__, when appropriate. * config/linux-eabi.h (LINK_SPEC, CC1_SPEC, CC1PLUS_SPEC, LIB_SPEC,) (STARTFILE_SPEC, ENDFILE_SPEC): Define to choose between Linux and Android definitions. (LINUX_TARGET_OS_CPP_BUILTINS): Define __ANDROID__ if TARGET_ANDROID. * doc/invoke.texi (-mandroid, -tno-android-cc, -tno-android-ld): Document. From-SVN: r159918 --- gcc/config.gcc | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'gcc/config.gcc') diff --git a/gcc/config.gcc b/gcc/config.gcc index d3fcaca..022997a 100644 --- a/gcc/config.gcc +++ b/gcc/config.gcc @@ -534,6 +534,22 @@ case ${target} in default_use_cxa_atexit=yes use_gcc_tgmath=no use_gcc_stdint=wrap + # Add Android userspace support to Linux targets. + case $target in + *linux*) + tm_file="$tm_file linux-android.h" + extra_options="$extra_options linux-android.opt" + ;; + esac + # Enable compilation for Android by default for *android* targets. + case $target in + *-*-*android*) + tm_defines="$tm_defines ANDROID_DEFAULT=1" + ;; + *) + tm_defines="$tm_defines ANDROID_DEFAULT=0" + ;; + esac ;; *-*-netbsd*) tmake_file="t-slibgcc-elf-ver t-libc-ok t-netbsd t-libgcc-pic" @@ -717,7 +733,7 @@ arm*-*-netbsd*) use_collect2=yes ;; arm*-*-linux*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h linux.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" + tm_file="dbxelf.h elfos.h linux.h linux-android.h glibc-stdint.h arm/elf.h arm/linux-gas.h arm/linux-elf.h" case $target in arm*b-*) tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" @@ -774,9 +790,8 @@ arm*-*-eabi* | arm*-*-symbianelf* ) tmake_file="arm/t-arm arm/t-arm-elf" case ${target} in arm*-*-eabi*) - tm_file="$tm_file arm/eabi.h newlib-stdint.h" + tm_file="$tm_file newlib-stdint.h" tmake_file="${tmake_file} arm/t-bpabi" - extra_options="${extra_options} arm/eabi.opt" use_gcc_stdint=wrap ;; arm*-*-symbianelf*) -- cgit v1.1