r207520 - Pass -pie to linker when generating executable on Android

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Apr 29 06:06:23 PDT 2014


duh ,sorry for the noise.

On 29 April 2014 09:06, Alexey Volkov <avolkov.intel at gmail.com> wrote:
> I added this comment in the next revision 207521.
>
>
> 2014-04-29 17:01 GMT+04:00 Rafael EspĂ­ndola <rafael.espindola at gmail.com>:
>
>> On 29 April 2014 06:25, Alexey Volkov <avolkov.intel at gmail.com> wrote:
>> > Author: volkalex
>> > Date: Tue Apr 29 05:25:20 2014
>> > New Revision: 207520
>> >
>> > URL: http://llvm.org/viewvc/llvm-project?rev=207520&view=rev
>> > Log:
>> > Pass -pie to linker when generating executable on Android
>> > This fixes problem with LTO on Android.
>> >
>> > Differential Revision: http://reviews.llvm.org/D2668
>> >
>> > Modified:
>> >     cfe/trunk/lib/Driver/Tools.cpp
>> >     cfe/trunk/test/Driver/gold-lto.c
>> >
>> > Modified: cfe/trunk/lib/Driver/Tools.cpp
>> > URL:
>> > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=207520&r1=207519&r2=207520&view=diff
>> >
>> > ==============================================================================
>> > --- cfe/trunk/lib/Driver/Tools.cpp (original)
>> > +++ cfe/trunk/lib/Driver/Tools.cpp Tue Apr 29 05:25:20 2014
>> > @@ -6917,7 +6917,10 @@ void gnutools::Link::ConstructJob(Compil
>> >      ToolChain.getTriple().getEnvironment() == llvm::Triple::Android;
>> >    const bool IsPIE =
>> >      !Args.hasArg(options::OPT_shared) &&
>> > -    (Args.hasArg(options::OPT_pie) || ToolChain.isPIEDefault());
>> > +    !Args.hasArg(options::OPT_static) &&
>> > +    (Args.hasArg(options::OPT_pie) || ToolChain.isPIEDefault() ||
>> > +     // On Android every code is PIC so every executable is PIE
>> > +     isAndroid);
>>
>> You forgot about the comment saying why you can't just change
>> isPIEDefault.
>>
>> Cheers,
>> Rafael
>
>
>
>
> --
> Alexey Volkov
> Intel Corporation




More information about the cfe-commits mailing list