Cleanup definitions of libc-related target hooks.
authorMaxim Kuvyrkov <maxim@kugelworks.com>
Sat, 7 Dec 2013 08:47:21 +0000 (08:47 +0000)
committerMaxim Kuvyrkov <mkuvyrkov@gcc.gnu.org>
Sat, 7 Dec 2013 08:47:21 +0000 (08:47 +0000)
* 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

gcc/ChangeLog
gcc/config/bfin/uclinux.h
gcc/config/c6x/uclinux-elf.h
gcc/config/linux-android.h
gcc/config/linux.h
gcc/config/lm32/uclinux-elf.h
gcc/config/m68k/uclinux.h
gcc/config/moxie/uclinux.h

index 42c623eb4dfc139e48cb9818a7c9510049c43101..ec5e34f5228b200ff99a9b8b7799249c6257faac 100644 (file)
@@ -1,3 +1,14 @@
+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.
index 848515c1bbc138351d31acda43d56daa13e37c0c..10a52f353e77cb2146ad1d3d69828929126b6789 100644 (file)
@@ -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
index fa0937ed2680c29293b4fd60a2f5d610a7daefd2..928c2b9ec061400346c26365585c25d84957198d 100644 (file)
@@ -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
index 30ce5aef4e8f40c8a4f4286d33660c72676cbad0..2c87c846cd73e6f63374652a1de292ad0e389482 100644 (file)
@@ -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
index 507471be938696a88ffcf69e3e0c98b545c26bc7..d7ca300c8db2088b138378ca5d31589e5c2b8f10 100644 (file)
@@ -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
index a5e8163cf6f30a2bd08d12ac83c7b038441c61c8..f2a94f19a237d2d3a3a792ebabdbdc3ef8961e6e 100644 (file)
@@ -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
index b1af7d2c585ca496c6c7a998c4681252b388d874..8d7431265471a1a5587f6bcbcc1881b81f7f2aa0 100644 (file)
@@ -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
index fb8c92542b569dcb631b96fc33397b71ab5352a4..a29d38075c8987089bd9bd05822deeff2eeee5e7 100644 (file)
@@ -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}"