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: Fix -fPIC issue with GNU LD and LTO


2011/1/7 Jan Hubicka <hubicka@ucw.cz>:
>> On Wed, Jan 5, 2011 at 2:21 PM, Jan Hubicka <hubicka@ucw.cz> wrote:
>> >> On Wed, Jan 05, 2011 at 02:15:25PM +0100, Jan Hubicka wrote:
>> >> > + ?/* Flag_shlib is usually set by finish_options, but we are issing flag_pic
>> >>
>> >> issing?
>> > issuing. Fixed in my local copy.
>>
>> Hm, I suppose we might want to call finish_options again after
>> re-issuing options instead.
>
> Hmm, I didn't do that since finish_options seems to contain guard against
> repeated execution
> ?if (!opts->x_flag_opts_finished)
> ? ?{
> ? ? ?if (opts->x_flag_pie)
> ? ? ? ?opts->x_flag_pic = opts->x_flag_pie;
> ? ? ?if (opts->x_flag_pic && !opts->x_flag_pie)
> ? ? ? ?opts->x_flag_shlib = 1;
> ? ? ?opts->x_flag_opts_finished = false;
> ? ?}
> only now I noticed that opts_finished is set to false that it is already. This looks like typo.
> What was original motivation for that thing?
>
> I am not sure if we want to finish options again since it has all that tristate handling in it
> that would need to be saved into opts section.
> But basically I have no idea, option handling seemed like magic to me all the time and lto
> opts like a mess... ?We just need to fix the shlib issue somehow or most of PIC builds with
> LTO will be broken.

I guess we can sort out things when we fix LTO option handling for
real in 4.7.  Your original
patch is ok.

Thanks,
Richard.

> Honza
>>
>> Richard.
>>
>> > Honza
>> >>
>> >> > + ? ? too late. ?*/
>> >> > + ?if (flag_pic && !flag_pie)
>> >> > + ? ?flag_shlib = 1;
>> >> > ? ?VEC_free (opt_t, heap, opts);
>> >> > ?}
>> >>
>> >> ? ? ? Jakub
>> >
>


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