Hi,

Whether the *linux* target supports ifuncs or not is defined here:

linux_has_ifunc_p (void)
{
  return OPTION_BIONIC ? false : HAVE_GNU_INDIRECT_FUNCTION;
}

Bionic right now supports indirect functions, but there is no way to
notify the compiler about that (For Android OPTION_BIONIC is always on
and so configure time check with --enable-gnu-indirect-function does
not work)

The following patch makes the use of the default version of
TARGET_HAS_IFUNC_P for *linux*, so we can decide whether the Android
target supports indirect functions or not on configure time.

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f22bba8..d4d09d0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2014-12-08  Alexander Ivchenko  <alexander.ivche...@intel.com>
+
+       * config/linux.c (linux_has_ifunc_p): Remove.
+       * config/linux.h (TARGET_HAS_IFUNC_P): Use default version.
+
 2014-12-08  Ilya Tocar  <ilya.to...@intel.com>

        * config/i386/i386.c (ix86_expand_vec_perm_vpermi2): Handle v64qi.
diff --git a/gcc/config/linux.c b/gcc/config/linux.c
index 6242e11..15df213 100644
--- a/gcc/config/linux.c
+++ b/gcc/config/linux.c
@@ -23,14 +23,6 @@ along with GCC; see the file COPYING3.  If not see
 #include "tm.h"
 #include "linux-protos.h"

-/* Android does not support GNU indirect functions.  */
-
-bool
-linux_has_ifunc_p (void)
-{
-  return OPTION_BIONIC ? false : HAVE_GNU_INDIRECT_FUNCTION;
-}
-
 bool
 linux_libc_has_function (enum function_class fn_class)
 {
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index d38ef81..6ccacff 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -117,10 +117,6 @@ see the files COPYING3 and COPYING.RUNTIME
respectively.  If not, see

 #else /* !uClinux, i.e., normal Linux */

-/* IFUNCs are supported 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

Is the patch ok? Bootstrapped/regtested on x86_64-unknown-linux-gnu +
checked that the behavior of i686-linux-android is correct.

Alexander

Reply via email to