aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Kuvyrkov <maxim@kugelworks.com>2013-12-07 08:47:21 +0000
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>2013-12-07 08:47:21 +0000
commit3e9310f4894ebe330b60eb5f07d55a7b9f854f2f (patch)
tree4cb5f17950d5d331b440312114e361ecb5adec94
parentcc0c3bf9a4bad4df72deb36c7f95270a0c7f36d3 (diff)
downloadgcc-3e9310f4894ebe330b60eb5f07d55a7b9f854f2f.zip
gcc-3e9310f4894ebe330b60eb5f07d55a7b9f854f2f.tar.gz
gcc-3e9310f4894ebe330b60eb5f07d55a7b9f854f2f.tar.bz2
Cleanup definitions of libc-related target hooks.
* config/bfin/uclinux.h, config/c6x/uclinux-elf.h, * config/lm32/uclinux-elf.h, config/m68k/uclinux.h, * config/moxie/uclinux.h (TARGET_LIBC_HAS_FUNCTION): Move definitions to linux.h. * config/linux-android.h (TARGET_HAS_IFUNC_P): Move definition to linux.h. * config/linux.h (TARGET_LIBC_HAS_FUNCTION, TARGET_HAS_IFUNC_P): Define appropriately for Linux and uClinux targets. From-SVN: r205780
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/bfin/uclinux.h3
-rw-r--r--gcc/config/c6x/uclinux-elf.h3
-rw-r--r--gcc/config/linux-android.h3
-rw-r--r--gcc/config/linux.h28
-rw-r--r--gcc/config/lm32/uclinux-elf.h3
-rw-r--r--gcc/config/m68k/uclinux.h3
-rw-r--r--gcc/config/moxie/uclinux.h8
8 files changed, 45 insertions, 17 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 42c623e..ec5e34f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,16 @@
2013-12-07 Maxim Kuvyrkov <maxim@kugelworks.com>
+ * config/bfin/uclinux.h, config/c6x/uclinux-elf.h,
+ * config/lm32/uclinux-elf.h, config/m68k/uclinux.h,
+ * config/moxie/uclinux.h (TARGET_LIBC_HAS_FUNCTION): Move definitions
+ to linux.h.
+ * config/linux-android.h (TARGET_HAS_IFUNC_P): Move definition
+ to linux.h.
+ * config/linux.h (TARGET_LIBC_HAS_FUNCTION, TARGET_HAS_IFUNC_P):
+ Define appropriately for Linux and uClinux targets.
+
+2013-12-07 Maxim Kuvyrkov <maxim@kugelworks.com>
+
* config/linux.c (linux_has_ifunc_p): Use correct test.
2013-12-07 Maxim Kuvyrkov <maxim@kugelworks.com>
diff --git a/gcc/config/bfin/uclinux.h b/gcc/config/bfin/uclinux.h
index 848515c..10a52f3 100644
--- a/gcc/config/bfin/uclinux.h
+++ b/gcc/config/bfin/uclinux.h
@@ -36,6 +36,3 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define TARGET_SUPPORTS_SYNC_CALLS 1
#define SUBTARGET_FDPIC_NOT_SUPPORTED
-
-#undef TARGET_LIBC_HAS_FUNCTION
-#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
diff --git a/gcc/config/c6x/uclinux-elf.h b/gcc/config/c6x/uclinux-elf.h
index fa0937e..928c2b9 100644
--- a/gcc/config/c6x/uclinux-elf.h
+++ b/gcc/config/c6x/uclinux-elf.h
@@ -61,6 +61,3 @@
: "=a" (_beg) \
: "0" (_beg), "b" (_end), "b" (_scno)); \
}
-
-#undef TARGET_LIBC_HAS_FUNCTION
-#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
diff --git a/gcc/config/linux-android.h b/gcc/config/linux-android.h
index 30ce5ae..2c87c84 100644
--- a/gcc/config/linux-android.h
+++ b/gcc/config/linux-android.h
@@ -57,6 +57,3 @@
#define ANDROID_ENDFILE_SPEC \
"%{shared: crtend_so%O%s;: crtend_android%O%s}"
-
-#undef TARGET_HAS_IFUNC_P
-#define TARGET_HAS_IFUNC_P linux_has_ifunc_p
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index 507471b..d7ca300 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -99,7 +99,31 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#undef TARGET_HAS_BIONIC
#define TARGET_HAS_BIONIC (OPTION_BIONIC)
+#if (DEFAULT_LIBC == LIBC_UCLIBC) && defined (SINGLE_LIBC) /* uClinux */
+/* This is a *uclinux* target. We don't define below macros to normal linux
+ versions, because doing so would require *uclinux* targets to include
+ linux.c, linux-protos.h, linux.opt, etc. We could, alternatively, add
+ these files to *uclinux* targets, but that would only pollute option list
+ (add -mglibc, etc.) without adding any useful support. */
+
+/* Define TARGET_LIBC_HAS_FUNCTION for *uclinux* targets to
+ no_c99_libc_has_function, because uclibc does not, normally, have
+ c99 runtime. If, in special cases, uclibc does have c99 runtime,
+ this should be defined to a new hook. Also please note that for targets
+ like *-linux-uclibc that similar check will also need to be added to
+ linux_libc_has_function. */
+# undef TARGET_LIBC_HAS_FUNCTION
+# define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
+
+#else /* !uClinux, i.e., normal Linux */
+
+/* IFUNCs are supportted by glibc, but not by uClibc or Bionic. */
+# undef TARGET_HAS_IFUNC_P
+# define TARGET_HAS_IFUNC_P linux_has_ifunc_p
+
/* Determine what functions are present at the runtime;
this includes full c99 runtime and sincos. */
-#undef TARGET_LIBC_HAS_FUNCTION
-#define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function
+# undef TARGET_LIBC_HAS_FUNCTION
+# define TARGET_LIBC_HAS_FUNCTION linux_libc_has_function
+
+#endif
diff --git a/gcc/config/lm32/uclinux-elf.h b/gcc/config/lm32/uclinux-elf.h
index a5e8163..f2a94f1 100644
--- a/gcc/config/lm32/uclinux-elf.h
+++ b/gcc/config/lm32/uclinux-elf.h
@@ -76,6 +76,3 @@
#undef CC1_SPEC
#define CC1_SPEC "%{G*} %{!fno-PIC:-fPIC}"
-
-#undef TARGET_LIBC_HAS_FUNCTION
-#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
diff --git a/gcc/config/m68k/uclinux.h b/gcc/config/m68k/uclinux.h
index b1af7d2..8d74312 100644
--- a/gcc/config/m68k/uclinux.h
+++ b/gcc/config/m68k/uclinux.h
@@ -67,6 +67,3 @@ along with GCC; see the file COPYING3. If not see
sections. */
#undef M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P
#define M68K_OFFSETS_MUST_BE_WITHIN_SECTIONS_P 1
-
-#undef TARGET_LIBC_HAS_FUNCTION
-#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
diff --git a/gcc/config/moxie/uclinux.h b/gcc/config/moxie/uclinux.h
index fb8c925..a29d380 100644
--- a/gcc/config/moxie/uclinux.h
+++ b/gcc/config/moxie/uclinux.h
@@ -32,3 +32,11 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#undef TARGET_LIBC_HAS_FUNCTION
#define TARGET_LIBC_HAS_FUNCTION no_c99_libc_has_function
+
+/* Like the definition in gcc.c, but for purposes of uClinux, every link is
+ static. */
+#define MFWRAP_SPEC " %{fmudflap|fmudflapth: \
+ --wrap=malloc --wrap=free --wrap=calloc --wrap=realloc\
+ --wrap=mmap --wrap=munmap --wrap=alloca\
+ %{fmudflapth: --wrap=pthread_create\
+}} %{fmudflap|fmudflapth: --wrap=main}"