This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Android] Enable ifuncs on Android
- From: Alexander Ivchenko <aivchenk at gmail dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: Andrew Hsieh <andrewhsieh at google dot com>, enh <enh at google dot com>, Jeff Law <law at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 14 Nov 2014 08:35:11 +0400
- Subject: Re: [Android] Enable ifuncs on Android
- Authentication-results: sourceware.org; auth=none
- References: <CACysShhcx+rmo5MVNOZf8La3_wMaTPZD0PE-phP07PSMkiB2UA at mail dot gmail dot com> <5464EC1A dot 6070709 at redhat dot com> <CAJgzZopFPL=5y8ts36Jd_+tH1UOz+2SG7BLZkRj5JnihuACOUw at mail dot gmail dot com> <546556ED dot 8060808 at redhat dot com> <CAJgzZor_Wc10NtYmTQJZqLmGJbAT_+Q1eUJFGgEGg=ToE0dt6A at mail dot gmail dot com> <CABySjRtUAotbHguEY5mg1hkj2BFC=YF+b9QZByWjxjWfza+=PA at mail dot gmail dot com> <CAMe9rOptiUUvdTTes-x9QNb=ziWgcQLvVyTT7eC_KGPpxtQWEQ at mail dot gmail dot com>
-bool
-linux_has_ifunc_p (void)
-{
- return OPTION_BIONIC ? false : HAVE_GNU_INDIRECT_FUNCTION;
-}
That is what prevent us from doing so. We need to remove OPTION_BIONIC
from that hook and that is what the patch does.
2014-11-14 8:32 GMT+04:00 H.J. Lu <hjl.tools@gmail.com>:
> On Thu, Nov 13, 2014 at 8:27 PM, Andrew Hsieh <andrewhsieh@google.com> wrote:
>> What about overloading the existing option -mbionic ? -mbionic=21 and
>> above enable ifunc (so NDK can help enforce it)
>>
>> On Fri, Nov 14, 2014 at 11:51 AM, enh <enh@google.com> wrote:
>>> On Thu, Nov 13, 2014 at 5:12 PM, Jeff Law <law@redhat.com> wrote:
>>>> On 11/13/14 10:46, enh wrote:
>>>>>
>>>>> 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...
>>>>
>>>> That doesn't make it the right thing to do. I would argue that's a bug that
>>>> really needs to be fixed.
>>>
>>> it's not a bug. no one wants 22 different compilers or configuration
>>> options, with a new one every six months or so.
>>>
>>>>> 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 the developers, though. they get their
>>>>> prebuilt compilers from us, and we'll just turn all the latest options
>>>>> on. we don't ship a compilers for each Android version. we already have
>>>>> 6 architectures * {clang,gcc} * {current,previous}version to ship.
>>>>
>>>> But that's no reason to have a compiler which produces bogus binaries.
>>>>
>>>> I really think this patch is a bad idea.
>>>
>>> so we should just change linux_has_ifunc_p to return
>>> HAVE_GNU_INDIRECT_FUNCTION; instead?
>>
>
> I don't know exactly what kind problem you are trying to solve. Why don't
> you configure GCC with --enable-gnu-indirect-function? If it doesn't work
> for your purpose, please tell me exactly what you want to to do and I will
> find a solution for you.
>
> --
> H.J.