On 2015-07-08 19:31:09, Scott Duplichan wrote:
> Bruce Cran [mailto:br...@cran.org.uk] wrote:
> 
> ]Sent: Wednesday, July 08, 2015 05:12 PM
> ]To: edk2-devel@lists.sourceforge.net
> ]Subject: Re: [edk2] [PATCH] BaseTools/GCC: allow unused but set variables
> ]
> ]On Wed, Jul 08, 2015 at 10:43:38PM +0200, Laszlo Ersek wrote:
> ]
> ]> I think it would make a difference if -flto *actually* worked, but from
> ]> a quick google search, I think it either doesn't work with gcc-4.8 at
> ]> all, *or* the edk2 build system would have to use FLTO-aware binutils
> ]> and linker wrappers (or parameters). I have no clue how to set that up.
> ]> So for now we'll have to stick with MDEPKG_NDEBUG I guess.
> ]
> ]I've been trying to get -flto working this week, but without success (yet!).
> ]I'm currently running into a problem of ld (built from source) apparently not
> ]knowing about the lto plugin (and passing the liblto.so file via -plugin 
> causes
> ]an assert failure), but I'll keep trying.
> 
> Last year I spent some time to get gcc -flto working properly with EDK2.
> At that time, the people here were busy with other things and there didn't
> seem to be a lot of interest in gcc link time optimization. So I never
> submitted a patch. Maybe it is time to revive this effort. Here is what I
> found:
> 
>     http://notabs.org/uefi/gcc-lto.htm
> 
> So 6 conditions need to be met for ghcc link time optimization to work
> properly with EDK2:
> 
>     1) Add -flto to the compile flags
>     2) Use gcc to launch ld instead of invoking ld directly
>     3) Include the compile flags on the link command line
>     4) Use gcc-ar in place of ar when building static libraries
>     5) Library code that resolves helper function calls generated by the 
> compiler must be compiled without the -flto flag
>     6) These libraries must be prefixed with -Wl,-plugin-opt=-pass-through= 
> on the link command line.
> 
> A patch from late 2014 is here:
> http://sourceforge.net/projects/edk2developertoolsforwindows/files/Patches/Link%20Time%20Optimization/

BaseTools/Contributions.txt (Contributed-under...)

If you don't submit it edk2-devel, and continue to follow up on it,
then work can easily slip through the cracks.

That said, I've spent a little time looking at your work, so it's not
true that there was no interest. But, if you have something that is
*actually working* for DuetPkg, EmulatorPkg and OvmfPkg, can you put
together a patch series?

I don't see how we can manage 5 & 6 with our current BaseTools. How
did you manage it? Searching for 'pass-through' in your patch doesn't
yield any results.

Thanks,

-Jordan

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/edk2-devel

Reply via email to