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/ Thanks, Scott ]Also, in terms of edk2-related resources, if anyone's interested I've been ]running doxygen on the sources and putting the results in ]http://bluestop.org/edk2/docs - the log files contain the tons of warnings the ]tool generates, while the directories (http://bluestop.org/edk2/docs/trunk, ]http://bluestop.org/edk2/docs/UDK2014.SP1 etc.) ]contain the API docs themselves. I started generating them since I noticed ]feishare.com hadn't been updated for a couple of years and wasn't aware of any ]other sites hosting a copy. ] ]-- ]Bruce ------------------------------------------------------------------------------ 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