Hi, Bionic - Android libc - supports indirect functions right now, but they are disabled in gcc;
We cannot do the configure-time check for that, because there is only one version of each compiler shipped in ndk for all Android platforms. On the other hand, having different runtime targets like -mandroid-19, -mandroid-20 would be a nightmare. But, keeping in mind that the last version of Android is a priority, I think that enabling ifuncs unconditionally would be the right thing. Is the patch ok? Bootstrapped/regtested on x86_64-unknown-linux-gnu + checked that the behavior of i686-linux-android is correct. diff --git a/gcc/ChangeLog b/gcc/ChangeLog index eac19cf..9932323 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-11-11 Alexander Ivchenko <alexander.ivche...@intel.com> + + * config/linux.c (linux_has_ifunc_p): Remove. + * config/linux.h (TARGET_HAS_IFUNC_P): Use the default version. + 2014-11-11 Uros Bizjak <ubiz...@gmail.com> * sreal.c (sreal::to_int): Use INTTYPE_MAXIMUM (int64_t) 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 --Alexander