This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Android] Enable ifuncs on Android


On Thu, Nov 13, 2014 at 9:36 AM, Jeff Law <law@redhat.com> wrote:
> 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.ivchenko@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.

Hi Jeff,

I believe the patch is correct.  Not all glibcs support IFUNC. It doesn't mean
we should disable IFUNC for all glibcs.  By default, we do a configure time
check for IFUNC.  We DO want to use configure time check for IFUNC for
Android NDK.

Alexander, configure time check for IFUNC should work for Android.  If
it doesn't,
please let me know and I will fix it.


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]