On Thu, Nov 13, 2014 at 8:46 PM, H.J. Lu <hjl.to...@gmail.com> wrote:
> On Thu, Nov 13, 2014 at 9:36 AM, Jeff Law <l...@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.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.
>
> 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.
>
>

Jeff, another thing.  Alexander original message:

---
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.
---

isn't precise.  That isn't what his patch does.  All his patch does is
to check IFUNC support at GCC configure-time when targetting
Android.  His patch alone won't "enabling ifuncs unconditionally" for
any targets, Android or not.


-- 
H.J.

Reply via email to