summaryrefslogtreecommitdiff
path: root/gcc/config.gcc
diff options
context:
space:
mode:
authormkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-27 11:54:48 +0000
committermkuvyrkov <mkuvyrkov@138bc75d-0d04-0410-961f-82ee72b054a4>2010-05-27 11:54:48 +0000
commit66fd9df95192d57d2a8720028f2b4ebd1aeff874 (patch)
treef583a304408b8d7b266afd0bba3b9cd4657fcb85 /gcc/config.gcc
parent34208e1834f283599d6216cd52bab652abe31a3e (diff)
downloadgcc-66fd9df95192d57d2a8720028f2b4ebd1aeff874.tar.gz
Add support for Bionic C library
gcc/ * config.gcc (LIBC_GLIBC, LIBC_BIONIC, LIBC_UCLIBC): New tm_define macro. (DEFAULT_LIBC): New tm_define macro set to one of LIBC_*. (bfin*-uclinux, moxie-*-uclinux*, m68k-*-uclinux*): Update. * config/linux.h (OPTION_GLIBC, OPTION_UCLIBC, OPTION_BIONIC): Define. (LINUX_TARGET_OS_CPP_BUILTINS): Define __gnu_linux__ only for GLIBC. (CHOOSE_DYNAMIC_LINKER1, CHOOSE_DYNAMIC_LINKER): Make it easier to support multiple C libraries. Handle Bionic. (BIONIC_DYNAMIC_LINKER, BIONIC_DYNAMIC_LINKER32,) (BIONIC_DYNAMIC_LINKER64): Define. (LINUX_DYNAMIC_LINKER, LINUX_DYNAMIC_LINKER32, LINUX_DYNAMIC_LINKER64): Update. (TARGET_HAS_SINCOS): Enable for Bionic. * config/linux.opt: Rewrite to handle more than 2 C libraries. Make the last option specified on command line take effect. (linux_uclibc): Rename to linux_libc, initialize using DEFAULT_LIBC. (mbionic): New. (mglibc, muclibc): Update. * config/alpha/linux-elf.h, config/rs6000/linux64.h, * config/rs6000/sysv4.h (CHOOSE_DYNAMIC_LINKER): Update to use DEFAULT_LIBC. * doc/invoke.texi (-mglibc, -muclibc): Update. (-mbionic): Document. gcc/testsuite/ * gcc.dg/glibc-uclibc-1.c, gcc.dg/glibc-uclibc-2.c: Remove, no longer necessary. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159917 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config.gcc')
-rw-r--r--gcc/config.gcc24
1 files changed, 15 insertions, 9 deletions
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 56f84e18c31..d3fcaca39ca 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -508,23 +508,29 @@ case ${target} in
*-*-gnu*)
tmake_file="$tmake_file t-gnu";;
esac
- # glibc / uclibc switch. uclibc isn't usable for GNU/Hurd and neither for
- # GNU/k*BSD.
+ # 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
*linux*)
extra_options="$extra_options linux.opt";;
*)
tm_defines="$tm_defines OPTION_GLIBC=1";;
esac
- case ${target} in
+ case $target in
+ *-*-*android*)
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_BIONIC"
+ ;;
*-*-*uclibc*)
- tm_defines="${tm_defines} UCLIBC_DEFAULT=1"
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_UCLIBC"
;;
*)
- tm_defines="${tm_defines} UCLIBC_DEFAULT=0"
+ tm_defines="$tm_defines DEFAULT_LIBC=LIBC_GLIBC"
;;
esac
- # Assume that glibc or uClibc are being used and so __cxa_atexit is provided.
+ # Assume that glibc or uClibc or Bionic are being used and so __cxa_atexit
+ # is provided.
default_use_cxa_atexit=yes
use_gcc_tgmath=no
use_gcc_stdint=wrap
@@ -826,7 +832,7 @@ bfin*-elf*)
bfin*-uclinux*)
tm_file="${tm_file} dbxelf.h elfos.h bfin/elf.h linux.h glibc-stdint.h bfin/uclinux.h"
tmake_file=bfin/t-bfin-uclinux
- tm_defines="${tm_defines} UCLIBC_DEFAULT=1"
+ tm_defines="${tm_defines} DEFAULT_LIBC=LIBC_UCLIBC"
extra_options="${extra_options} linux.opt"
use_collect2=no
;;
@@ -907,7 +913,7 @@ moxie-*-uclinux*)
tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h glibc-stdint.h moxie/uclinux.h"
extra_parts="crti.o crtn.o crtbegin.o crtend.o"
tmake_file="${tmake_file} moxie/t-moxie moxie/t-moxie-softfp soft-fp/t-softfp"
- tm_defines="${tm_defines} UCLIBC_DEFAULT=1"
+ tm_defines="${tm_defines} DEFAULT_LIBC=LIBC_UCLIBC"
extra_options="${extra_options} linux.opt"
;;
h8300-*-rtems*)
@@ -1632,7 +1638,7 @@ m68k-*-uclinux*) # Motorola m68k/ColdFire running uClinux
default_m68k_cpu=68020
default_cf_cpu=5206
tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h glibc-stdint.h flat.h m68k/linux.h m68k/uclinux.h ./sysroot-suffix.h"
- tm_defines="${tm_defines} MOTOROLA=1 UCLIBC_DEFAULT=1"
+ tm_defines="${tm_defines} MOTOROLA=1 DEFAULT_LIBC=LIBC_UCLIBC"
extra_options="${extra_options} linux.opt"
tmake_file="m68k/t-floatlib m68k/t-uclinux m68k/t-mlibs"
;;