aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/gcc/config
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.4.3/gcc/config')
-rw-r--r--gcc-4.4.3/gcc/config/alpha/linux-elf.h8
-rw-r--r--gcc-4.4.3/gcc/config/alpha/linux.h2
-rw-r--r--gcc-4.4.3/gcc/config/arm/arm.h4
-rw-r--r--gcc-4.4.3/gcc/config/arm/eabi.h132
-rw-r--r--gcc-4.4.3/gcc/config/arm/linux-eabi.h25
-rw-r--r--gcc-4.4.3/gcc/config/arm/t-arm-elf4
-rw-r--r--gcc-4.4.3/gcc/config/arm/t-linux-androideabi10
-rw-r--r--gcc-4.4.3/gcc/config/arm/t-mlib-armv7a4
-rw-r--r--gcc-4.4.3/gcc/config/arm/t-mlib-mandroid5
-rw-r--r--gcc-4.4.3/gcc/config/linux-android.h54
-rw-r--r--gcc-4.4.3/gcc/config/linux-android.opt (renamed from gcc-4.4.3/gcc/config/arm/eabi.opt)8
-rw-r--r--gcc-4.4.3/gcc/config/linux.h72
-rw-r--r--gcc-4.4.3/gcc/config/linux.opt12
-rw-r--r--gcc-4.4.3/gcc/config/rs6000/linux.h2
-rw-r--r--gcc-4.4.3/gcc/config/rs6000/linux64.h10
-rw-r--r--gcc-4.4.3/gcc/config/rs6000/sysv4.h8
16 files changed, 174 insertions, 186 deletions
diff --git a/gcc-4.4.3/gcc/config/alpha/linux-elf.h b/gcc-4.4.3/gcc/config/alpha/linux-elf.h
index c48fc9350..262404b23 100644
--- a/gcc-4.4.3/gcc/config/alpha/linux-elf.h
+++ b/gcc-4.4.3/gcc/config/alpha/linux-elf.h
@@ -29,10 +29,12 @@ along with GCC; see the file COPYING3. If not see
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
-#if UCLIBC_DEFAULT
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
+#if DEFAULT_LIBC == LIBC_UCLIBC
+#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+#elif DEFAULT_LIBC == LIBC_GLIBC
+#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
#else
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}"
+#error "Unsupported DEFAULT_LIBC"
#endif
#define LINUX_DYNAMIC_LINKER \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
diff --git a/gcc-4.4.3/gcc/config/alpha/linux.h b/gcc-4.4.3/gcc/config/alpha/linux.h
index 0a32479d5..712d66d86 100644
--- a/gcc-4.4.3/gcc/config/alpha/linux.h
+++ b/gcc-4.4.3/gcc/config/alpha/linux.h
@@ -64,6 +64,8 @@ along with GCC; see the file COPYING3. If not see
/* Define this so that all GNU/Linux targets handle the same pragmas. */
#define HANDLE_PRAGMA_PACK_PUSH_POP
+#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
+
/* Determine whether the entire c99 runtime is present in the
runtime library. */
#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
diff --git a/gcc-4.4.3/gcc/config/arm/arm.h b/gcc-4.4.3/gcc/config/arm/arm.h
index 602973828..a413dd323 100644
--- a/gcc-4.4.3/gcc/config/arm/arm.h
+++ b/gcc-4.4.3/gcc/config/arm/arm.h
@@ -2865,9 +2865,9 @@ enum arm_builtins
ARM_BUILTIN_MAX = ARM_BUILTIN_NEON_BASE /* FIXME: Wrong! */
};
-/* Do not emit .note.GNU-stack by default. */
+/* Do emit .note.GNU-stack by default. */
#ifndef NEED_INDICATE_EXEC_STACK
-#define NEED_INDICATE_EXEC_STACK 0
+#define NEED_INDICATE_EXEC_STACK 1
#endif
#endif /* ! GCC_ARM_H */
diff --git a/gcc-4.4.3/gcc/config/arm/eabi.h b/gcc-4.4.3/gcc/config/arm/eabi.h
deleted file mode 100644
index e312cbc65..000000000
--- a/gcc-4.4.3/gcc/config/arm/eabi.h
+++ /dev/null
@@ -1,132 +0,0 @@
-/* Configuration file for ARM EABI targets.
- Copyright (C) 2008
- Free Software Foundation, Inc.
- Contributed by Doug Kwan (dougkwan@google.com)
-
- This file is part of GCC.
-
- GCC is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published
- by the Free Software Foundation; either version 3, or (at your
- option) any later version.
-
- GCC is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
- License for more details.
-
- You should have received a copy of the GNU General Public License
- along with GCC; see the file COPYING3. If not see
- <http://www.gnu.org/licenses/>. */
-
-/* This file contains macro overrides for EABI targets. */
-
-#undef TARGET_OS_CPP_BUILTINS
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- TARGET_BPABI_CPP_BUILTINS (); \
- if (TARGET_ANDROID) \
- builtin_define ("__ANDROID__"); \
- } \
- while (false)
-
-#undef SUBSUBTARGET_EXTRA_SPECS
-#define SUBSUBTARGET_EXTRA_SPECS \
- { "link_android", ANDROID_LINK_SPEC }, \
- { "link_default", BPABI_LINK_SPEC }, \
- { "cc1_android", ANDROID_CC1_SPEC }, \
- { "cc1_default", CC1_DEFAULT_SPEC }, \
- { "cc1plus_android", ANDROID_CC1PLUS_SPEC }, \
- { "cc1plus_default", CC1PLUS_DEFAULT_SPEC }, \
- { "lib_android", ANDROID_LIB_SPEC }, \
- { "lib_default", LIB_DEFAULT_SPEC }, \
- { "startfile_android", ANDROID_STARTFILE_SPEC }, \
- { "startfile_default", UNKNOWN_ELF_STARTFILE_SPEC }, \
- { "endfile_android", ANDROID_ENDFILE_SPEC }, \
- { "endfile_default", UNKNOWN_ELF_ENDFILE_SPEC }, \
-
-#undef ANDROID_LINK_SPEC
-#define ANDROID_LINK_SPEC \
-"%{mbig-endian:-EB} %{mlittle-endian:-EL} " \
-"%{static:-Bstatic} %{shared:-shared} %{symbolic:-Bsymbolic} " \
-"%{!static:" \
- "%{shared: -Bsymbolic} " \
- "%{!shared:" \
- "-Bdynamic " \
- "%{rdynamic:-export-dynamic} " \
- "%{!dynamic-linker:-dynamic-linker /system/bin/linker}}} " \
-"-X" SUBTARGET_EXTRA_LINK_SPEC
-
-/* Override LINK_SPEC in bpabi.h. */
-#undef LINK_SPEC
-#define LINK_SPEC \
-"%{mandroid: %(link_android) ;" \
-" : %(link_default)}"
-
-/* Android uses "-fno-exceptions -fpic -fno-short-enums -mthumb-interwork" by
- default. -mthumb-interwork is implied by EABI. */
-#undef ANDROID_CC1_SPEC
-#define ANDROID_CC1_SPEC \
-"%{!fexceptions:-fno-exceptions} " \
-"%{!fno-pic:%{!fno-PIC:-fpic}} " \
-"%{!fshort-enums:-fno-short-enums} "
-
-/* Default CC1_SPEC as in arm.h. */
-#undef CC1_DEFAULT_SPEC
-#define CC1_DEFAULT_SPEC ""
-
-#undef CC1_SPEC
-#define CC1_SPEC \
-"%{mandroid: %(cc1_android) ;" \
-" : %(cc1_default)}"
-
-/* Android uses -fno-rtti by default. */
-#undef ANDROID_CC1PLUS_SPEC
-#define ANDROID_CC1PLUS_SPEC "%{!frtti:-fno-rtti}"
-
-/* Default CC1PLUS_SPEC as in gcc.c. */
-#undef CC1PLUS_DEFAULT_SPEC
-#define CC1PLUS_DEFAULT_SPEC ""
-
-#undef CC1PLUS_SPEC
-#define CC1PLUS_SPEC \
-"%{mandroid: %(cc1plus_android) ;" \
-" : %(cc1plus_default)}"
-
-#undef ANDROID_LIB_SPEC
-#define ANDROID_LIB_SPEC "-lc %{!static:-ldl}"
-
-/* Default LIB_SPEC as in gcc.c. */
-#undef LIB_DEFAULT_SPEC
-#define LIB_DEFAULT_SPEC \
-"%{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"
-
-#undef LIB_SPEC
-#define LIB_SPEC \
-"%{mandroid: %(lib_android) ;" \
-" : %(lib_default)}"
-
-#undef ANDROID_STARTFILE_SPEC
-#define ANDROID_STARTFILE_SPEC \
-"%{!shared:" \
- "%{static: crtbegin_static%O%s ;" \
- " : crtbegin_dynamic%O%s}}"
-
-/* Override STARTFILE_SPEC in unknown-elf.h. */
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
-"%{mandroid: %(startfile_android) ;" \
-" : %(startfile_default)}"
-
-#undef ANDROID_ENDFILE_SPEC
-#define ANDROID_ENDFILE_SPEC "%{!shared:crtend_android%O%s}"
-
-/* Override ENDFILE_SPEC in unknown-elf.h. */
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
-"%{mandroid: %(endfile_android) ;" \
-" : %(endfile_default)}"
-
-#undef NEED_INDICATE_EXEC_STACK
-#define NEED_INDICATE_EXEC_STACK 1
diff --git a/gcc-4.4.3/gcc/config/arm/linux-eabi.h b/gcc-4.4.3/gcc/config/arm/linux-eabi.h
index 4174d70db..6dd44436a 100644
--- a/gcc-4.4.3/gcc/config/arm/linux-eabi.h
+++ b/gcc-4.4.3/gcc/config/arm/linux-eabi.h
@@ -66,7 +66,30 @@
/* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
use the GNU/Linux version, not the generic BPABI version. */
#undef LINK_SPEC
-#define LINK_SPEC LINUX_TARGET_LINK_SPEC
+#define LINK_SPEC \
+ LINUX_OR_ANDROID_LD (LINUX_TARGET_LINK_SPEC, \
+ LINUX_TARGET_LINK_SPEC " " ANDROID_LINK_SPEC)
+
+#undef CC1_SPEC
+#define CC1_SPEC \
+ LINUX_OR_ANDROID_CC (LINUX_TARGET_CC1_SPEC, \
+ LINUX_TARGET_CC1_SPEC " " ANDROID_CC1_SPEC)
+
+#define CC1PLUS_SPEC \
+ LINUX_OR_ANDROID_CC ("", ANDROID_CC1PLUS_SPEC)
+
+#undef LIB_SPEC
+#define LIB_SPEC \
+ LINUX_OR_ANDROID_LD (LINUX_TARGET_LIB_SPEC, \
+ LINUX_TARGET_LIB_SPEC " " ANDROID_LIB_SPEC)
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC \
+ LINUX_OR_ANDROID_LD (LINUX_TARGET_STARTFILE_SPEC, ANDROID_STARTFILE_SPEC)
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC \
+ LINUX_OR_ANDROID_LD (LINUX_TARGET_ENDFILE_SPEC, ANDROID_ENDFILE_SPEC)
/* Use the default LIBGCC_SPEC, not the version in linux-elf.h, as we
do not use -lfloat. */
diff --git a/gcc-4.4.3/gcc/config/arm/t-arm-elf b/gcc-4.4.3/gcc/config/arm/t-arm-elf
index b99b9ee4b..9f6068258 100644
--- a/gcc-4.4.3/gcc/config/arm/t-arm-elf
+++ b/gcc-4.4.3/gcc/config/arm/t-arm-elf
@@ -47,10 +47,6 @@ MULTILIB_MATCHES += $(MLMATCH_armv7a)
# MULTILIB_OPTIONS += mno-thumb-interwork/mthumb-interwork
# MULTILIB_DIRNAMES += normal interwork
-MULTILIB_OPTIONS += $(MLOPT_mandroid)
-MULTILIB_DIRNAMES += $(MLDIR_mandroid)
-MULTILIB_EXCEPTIONS += $(MLEXCEPT_mandroid)
-
# MULTILIB_OPTIONS += fno-leading-underscore/fleading-underscore
# MULTILIB_DIRNAMES += elf under
#
diff --git a/gcc-4.4.3/gcc/config/arm/t-linux-androideabi b/gcc-4.4.3/gcc/config/arm/t-linux-androideabi
new file mode 100644
index 000000000..8f1307c55
--- /dev/null
+++ b/gcc-4.4.3/gcc/config/arm/t-linux-androideabi
@@ -0,0 +1,10 @@
+MULTILIB_OPTIONS = march=armv7-a mthumb
+MULTILIB_DIRNAMES = armv7-a thumb
+MULTILIB_EXCEPTIONS =
+MULTILIB_MATCHES =
+MULTILIB_OSDIRNAMES =
+
+# The "special" multilib can be used to build native applications for Android,
+# as opposed to native shared libraries that are then called via JNI.
+#MULTILIB_OPTIONS += tno-android-cc
+#MULTILIB_DIRNAMES += special
diff --git a/gcc-4.4.3/gcc/config/arm/t-mlib-armv7a b/gcc-4.4.3/gcc/config/arm/t-mlib-armv7a
deleted file mode 100644
index c18407f61..000000000
--- a/gcc-4.4.3/gcc/config/arm/t-mlib-armv7a
+++ /dev/null
@@ -1,4 +0,0 @@
-# Config armv7-a multilib.
-MLOPT_armv7a = march=armv7-a
-MLDIR_armv7a = armv7a
-MLMATCH_armv7a = march?armv7-a=mcpu?cortex-a8
diff --git a/gcc-4.4.3/gcc/config/arm/t-mlib-mandroid b/gcc-4.4.3/gcc/config/arm/t-mlib-mandroid
deleted file mode 100644
index dd4b24344..000000000
--- a/gcc-4.4.3/gcc/config/arm/t-mlib-mandroid
+++ /dev/null
@@ -1,5 +0,0 @@
-# Config mandroid multilib.
-# -mandroind implies -mthumb-interwork.
-MLOPT_mandroid = mandroid
-MLDIR_mandroid = android
-MLEXCEPT_mandroid = *mthumb-interwork/*mandroid*
diff --git a/gcc-4.4.3/gcc/config/linux-android.h b/gcc-4.4.3/gcc/config/linux-android.h
new file mode 100644
index 000000000..a43bab5b0
--- /dev/null
+++ b/gcc-4.4.3/gcc/config/linux-android.h
@@ -0,0 +1,54 @@
+/* Configuration file for Linux Android targets.
+ Copyright (C) 2008, 2010
+ Free Software Foundation, Inc.
+ Contributed by Doug Kwan (dougkwan@google.com)
+ Rewritten by CodeSourcery, Inc.
+
+ This file is part of GCC.
+
+ GCC is free software; you can redistribute it and/or modify it
+ under the terms of the GNU General Public License as published
+ by the Free Software Foundation; either version 3, or (at your
+ option) any later version.
+
+ GCC is distributed in the hope that it will be useful, but WITHOUT
+ ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
+ License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING3. If not see
+ <http://www.gnu.org/licenses/>. */
+
+#if ANDROID_DEFAULT
+# define NOANDROID "mno-android"
+#else
+# define NOANDROID "!mandroid"
+#endif
+
+#define LINUX_OR_ANDROID_CC(LINUX_SPEC, ANDROID_SPEC) \
+ "%{" NOANDROID "|tno-android-cc:" LINUX_SPEC ";:" ANDROID_SPEC "}"
+
+#define LINUX_OR_ANDROID_LD(LINUX_SPEC, ANDROID_SPEC) \
+ "%{" NOANDROID "|tno-android-ld:" LINUX_SPEC ";:" ANDROID_SPEC "}"
+
+#define ANDROID_LINK_SPEC \
+ "%{shared: -Bsymbolic}"
+
+#define ANDROID_CC1_SPEC \
+ "%{!mglibc:%{!muclibc:%{!mbionic: -mbionic}}} " \
+ "%{!fno-pic:%{!fno-PIC:%{!fpic:%{!fPIC: -fPIC}}}}"
+
+#define ANDROID_CC1PLUS_SPEC \
+ "%{!fexceptions:%{!fno-exceptions: -fno-exceptions}} " \
+ "%{!frtti:%{!fno-rtti: -fno-rtti}}"
+
+#define ANDROID_LIB_SPEC \
+ "%{!static: -ldl}"
+
+#define ANDROID_STARTFILE_SPEC \
+ "%{!shared:" \
+ " %{static: crtbegin_static%O%s;: crtbegin_dynamic%O%s}}"
+
+#define ANDROID_ENDFILE_SPEC \
+ "%{!shared: crtend_android%O%s}"
diff --git a/gcc-4.4.3/gcc/config/arm/eabi.opt b/gcc-4.4.3/gcc/config/linux-android.opt
index 0ea58bd6e..ad659caf0 100644
--- a/gcc-4.4.3/gcc/config/arm/eabi.opt
+++ b/gcc-4.4.3/gcc/config/linux-android.opt
@@ -1,6 +1,6 @@
-; EABI specific options for ARM port of the compiler.
+; Android specific options.
-; Copyright (C) 2008 Free Software Foundation, Inc.
+; Copyright (C) 2008, 2010 Free Software Foundation, Inc.
;
; This file is part of GCC.
;
@@ -19,5 +19,5 @@
; <http://www.gnu.org/licenses/>.
mandroid
-Target Report Mask(ANDROID)
-Generate code for the Android operating system.
+Target Report Mask(ANDROID) Var(flag_android) Init(ANDROID_DEFAULT ? OPTION_MASK_ANDROID : 0)
+Generate code for the Android platform.
diff --git a/gcc-4.4.3/gcc/config/linux.h b/gcc-4.4.3/gcc/config/linux.h
index 581c6c34e..443db22bd 100644
--- a/gcc-4.4.3/gcc/config/linux.h
+++ b/gcc-4.4.3/gcc/config/linux.h
@@ -42,16 +42,17 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
provides part of the support for getting C++ file-scope static
object constructed before entering `main'. */
-#undef STARTFILE_SPEC
#if defined HAVE_LD_PIE
-#define STARTFILE_SPEC \
+#define LINUX_TARGET_STARTFILE_SPEC \
"%{!shared: %{pg|p|profile:gcrt1.o%s;pie:Scrt1.o%s;:crt1.o%s}} \
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#else
-#define STARTFILE_SPEC \
+#define LINUX_TARGET_STARTFILE_SPEC \
"%{!shared: %{pg|p|profile:gcrt1.o%s;:crt1.o%s}} \
crti.o%s %{static:crtbeginT.o%s;shared|pie:crtbeginS.o%s;:crtbegin.o%s}"
#endif
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC LINUX_TARGET_STARTFILE_SPEC
/* Provide a ENDFILE_SPEC appropriate for GNU/Linux. Here we tack on
the GNU/Linux magical crtend.o file (see crtstuff.c) which
@@ -59,33 +60,44 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
object constructed before entering `main', followed by a normal
GNU/Linux "finalizer" file, `crtn.o'. */
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
+#define LINUX_TARGET_ENDFILE_SPEC \
"%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC LINUX_TARGET_ENDFILE_SPEC
/* This is for -profile to use -lc_p instead of -lc. */
+#define LINUX_TARGET_CC1_SPEC "%{profile:-p}"
#ifndef CC1_SPEC
-#define CC1_SPEC "%{profile:-p}"
+#define CC1_SPEC LINUX_TARGET_CC1_SPEC
#endif
/* The GNU C++ standard library requires that these macros be defined. */
#undef CPLUSPLUS_CPP_SPEC
#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
-#undef LIB_SPEC
-#define LIB_SPEC \
+#define LINUX_TARGET_LIB_SPEC \
"%{pthread:-lpthread} \
%{shared:-lc} \
%{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}"
+#undef LIB_SPEC
+#define LIB_SPEC LINUX_TARGET_LIB_SPEC
+
+/* C libraries supported on Linux. */
+#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
+#define OPTION_UCLIBC (linux_libc == LIBC_UCLIBC)
+#define OPTION_BIONIC (linux_libc == LIBC_BIONIC)
#define LINUX_TARGET_OS_CPP_BUILTINS() \
do { \
- builtin_define ("__gnu_linux__"); \
+ if (OPTION_GLIBC) \
+ builtin_define ("__gnu_linux__"); \
builtin_define_std ("linux"); \
builtin_define_std ("unix"); \
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)
@@ -105,13 +117,24 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#endif
/* Determine which dynamic linker to use depending on whether GLIBC or
- uClibc is the default C library and whether -muclibc or -mglibc has
- been passed to change the default. */
-#if UCLIBC_DEFAULT
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
++ uClibc or Bionic is the default C library and whether
++ -muclibc or -mglibc or -mbionic has been passed to change the default. */
+
+#define CHOOSE_DYNAMIC_LINKER1(LIBC1, LIBC2, LIBC3, LD1, LD2, LD3) \
+ "%{" LIBC2 ":" LD2 ";:%{" LIBC3 ":" LD3 ";:" LD1 "}}"
+
+#if DEFAULT_LIBC == LIBC_GLIBC
+#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+ CHOOSE_DYNAMIC_LINKER1 ("mglibc", "muclibc", "mbionic", G, U, B)
+#elif DEFAULT_LIBC == LIBC_UCLIBC
+#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+ CHOOSE_DYNAMIC_LINKER1 ("muclibc", "mglibc", "mbionic", U, G, B)
+#elif DEFAULT_LIBC == LIBC_BIONIC
+#define CHOOSE_DYNAMIC_LINKER(G, U, B) \
+ CHOOSE_DYNAMIC_LINKER1 ("mbionic", "mglibc", "muclibc", B, G, U)
#else
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}"
-#endif
+#error "Unsupported DEFAULT_LIBC"
+#endif /* DEFAULT_LIBC */
/* For most targets the following definitions suffice;
GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
@@ -123,12 +146,19 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define UCLIBC_DYNAMIC_LINKER RUNTIME_ROOT_PREFIX "/lib/ld-uClibc.so.0"
#define UCLIBC_DYNAMIC_LINKER32 RUNTIME_ROOT_PREFIX "/lib/ld-uClibc.so.0"
#define UCLIBC_DYNAMIC_LINKER64 RUNTIME_ROOT_PREFIX "/lib/ld64-uClibc.so.0"
-#define LINUX_DYNAMIC_LINKER \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
-#define LINUX_DYNAMIC_LINKER32 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
-#define LINUX_DYNAMIC_LINKER64 \
- CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64)
+#define BIONIC_DYNAMIC_LINKER "/system/bin/linker"
+#define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
+#define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
+
+#define LINUX_DYNAMIC_LINKER \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER, \
+ BIONIC_DYNAMIC_LINKER)
+#define LINUX_DYNAMIC_LINKER32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32, \
+ BIONIC_DYNAMIC_LINKER32)
+#define LINUX_DYNAMIC_LINKER64 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER64, UCLIBC_DYNAMIC_LINKER64, \
+ BIONIC_DYNAMIC_LINKER64)
/* Determine whether the entire c99 runtime
is present in the runtime library. */
diff --git a/gcc-4.4.3/gcc/config/linux.opt b/gcc-4.4.3/gcc/config/linux.opt
index fe8c075b3..289eadece 100644
--- a/gcc-4.4.3/gcc/config/linux.opt
+++ b/gcc-4.4.3/gcc/config/linux.opt
@@ -19,10 +19,14 @@
; along with GCC; see the file COPYING3. If not see
; <http://www.gnu.org/licenses/>.
+mbionic
+Target Report RejectNegative Var(linux_libc,LIBC_BIONIC) Init(DEFAULT_LIBC) Negative(mglibc)
+Use Bionic C library
+
muclibc
-Target RejectNegative Report Mask(UCLIBC) Var(linux_uclibc) Init(UCLIBC_DEFAULT ? OPTION_MASK_UCLIBC : 0)
-Use uClibc instead of GNU libc
+Target Report RejectNegative Var(linux_libc,LIBC_UCLIBC) VarExists Negative(mbionic)
+Use uClibc C library
mglibc
-Target RejectNegative Report InverseMask(UCLIBC, GLIBC) Var(linux_uclibc) VarExists
-Use GNU libc instead of uClibc
+Target RejectNegative Report Var(linux_libc,LIBC_GLIBC) VarExists Negative(muclibc)
+Use GNU C library
diff --git a/gcc-4.4.3/gcc/config/rs6000/linux.h b/gcc-4.4.3/gcc/config/rs6000/linux.h
index 4831273c5..d41c0dc56 100644
--- a/gcc-4.4.3/gcc/config/rs6000/linux.h
+++ b/gcc-4.4.3/gcc/config/rs6000/linux.h
@@ -30,6 +30,8 @@
/* We use glibc _mcount for profiling. */
#define NO_PROFILE_COUNTERS 1
+#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
+
/* glibc has float and long double forms of math functions. */
#undef TARGET_C99_FUNCTIONS
#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
diff --git a/gcc-4.4.3/gcc/config/rs6000/linux64.h b/gcc-4.4.3/gcc/config/rs6000/linux64.h
index a83cc24db..3ccbe21c8 100644
--- a/gcc-4.4.3/gcc/config/rs6000/linux64.h
+++ b/gcc-4.4.3/gcc/config/rs6000/linux64.h
@@ -283,6 +283,8 @@ extern int dot_symbols;
process. */
#define OS_MISSING_POWERPC64 !TARGET_64BIT
+#define OPTION_GLIBC (linux_libc == LIBC_GLIBC)
+
/* glibc has float and long double forms of math functions. */
#undef TARGET_C99_FUNCTIONS
#define TARGET_C99_FUNCTIONS (OPTION_GLIBC)
@@ -346,10 +348,12 @@ extern int dot_symbols;
#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
-#if UCLIBC_DEFAULT
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
+#if DEFAULT_LIBC == LIBC_UCLIBC
+#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+#elif DEFAULT_LIBC == LIBC_GLIBC
+#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
#else
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}"
+#error "Unsupported DEFAULT_LIBC"
#endif
#define LINUX_DYNAMIC_LINKER32 \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER32, UCLIBC_DYNAMIC_LINKER32)
diff --git a/gcc-4.4.3/gcc/config/rs6000/sysv4.h b/gcc-4.4.3/gcc/config/rs6000/sysv4.h
index a878a53ff..339d51847 100644
--- a/gcc-4.4.3/gcc/config/rs6000/sysv4.h
+++ b/gcc-4.4.3/gcc/config/rs6000/sysv4.h
@@ -903,10 +903,12 @@ SVR4_ASM_SPEC \
#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
-#if UCLIBC_DEFAULT
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
+#if DEFAULT_LIBC == LIBC_UCLIBC
+#define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+#elif DEFAULT_LIBC == LIBC_GLIBC
+#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:" U ";:" G "}"
#else
-#define CHOOSE_DYNAMIC_LINKER(G, U) "%{muclibc:%{mglibc:%e-mglibc and -muclibc used together}" U ";:" G "}"
+#error "Unsupported DEFAULT_LIBC"
#endif
#define LINUX_DYNAMIC_LINKER \
CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)