This is the mail archive of the gcc@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: Issue with LTO/-fwhole-program


On 14/06/2010 05:43, Ian Lance Taylor wrote:
> David Brown <david.brown@hesbynett.no> writes:
> 
>> After doing a bit more reading and thinking, it seems to me that
>> -fwhole-program will be used in most cases where LTO is used.  You use
>> -flto when compiling each source file, then link them with gcc with
>> -flto and -fwhole-program.  Except in the case of libraries or other
>> files which need external symbols, you will want that combination to
>> generate optimal code.  So if this combination alone, without common
>> symbols, is going to cause problems, then this would be a much bigger
>> issue than if it is only triggered by common symbols.
> 
> That scenario is fine.
> 
> You can look back to see the problematic case posted earlier.  It was
> a case where one file was compiled with -flto, one file was compiled
> without -flto, both files defined a common symbol with the same name,
> the object files were linked together using -flto -fwhole-program, and
> the gold plugin was not used.  All elements are essential to recreate
> the problem.

  Given how many standard libraries export common symbols, I wonder if it
won't actually happen quite often.  "nm /usr/lib/*.a | grep ' C '" gives a
fair few hits for me.

    cheers,
      DaveK


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