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?

yes, but that's already true of PIE or gnu-style hash or...

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

this won't make any difference to developers, though. they get their
prebuilt compilers from us, and we'll just turn all the latest options
on anyway. we don't ship a compilers for each Android version. we
already have 6 architectures * {clang,gcc} * {current,previous}version
to ship.

it doesn't seem worth having configuration in GCC that no one will ever use.


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