On 11/12/14 03:02, Alexander Ivchenko wrote:
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.
This feels like a bad idea to me simply because a new compiler with an old runtime will generate code that fails, right?

If you can't do a configure-time test, then the way to go is either a compile-time option, or to use a different target. If there's some minimum version of android that has this capability, then this isn't terribly hard. You may not even need a config file for this since you could define LIBC_BIONIC_USE_IFUNCS or something like that when configured for a suitably new android version.

jeff

Reply via email to