Fix -fPIC issue with GNU LD and LTO

Jan Hubicka hubicka@ucw.cz
Fri Jan 7 19:22:00 GMT 2011


> On Fri, 7 Jan 2011, Jan Hubicka wrote:
> 
> > 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.
> 
> That's definitely a mistake.
> 
> > What was original motivation for that thing?
> 
> x_flag_opts_finished is meant to be a replacement (avoiding global state) 
> for code that ran only the first time options were processed (i.e., from 
> the command line but not from attributes).  It's a hack in that ideally 
> we'd save the options structures before passing them through 
> finish_options, options from attributes would apply to the saved 
> structures and then all the finishing (including bits that aren't 
> currently in finish_options) would be rerun - hopefully fixing some of the 
> bugs relating to target and optimize attributes.

OK, thanks for explanation.  Could you please care fixing this, or shall I drop
it into TODO?

Honza



More information about the Gcc-patches mailing list