Jordan Justen [mailto:jordan.l.jus...@intel.com] wrote:
]On 2014-11-07 07:33:24, Scott Duplichan wrote: ]> The summary of the 4 changes needed is not detailed enough for easy ]> application. Instead, apply this patch: ]> ]> http://sourceforge.net/projects/edk2developertoolsforwindows/files/Patches/ ]> Link%20Time%20Optimization/ ] ]Patches should be contributed using the process documented in ]BaseTools/Contributions.txt. Otherwise, we cannot use the ]contribution. Hello Jordan, Gcc link time optimization is not working smoothly enough for submitting a patch. I just wanted a way to gauge interest in the idea. I might have been overly optimistic about the status of gcc lto. For example, debug information in lto mode is said to be at the 'experimental' stage. So gcc lto is probably not suitable for non-release builds. Even with x86 builds there are some problems. For example, Ovmf fails to link when -DSECURE_BOOT_ENABLE is used (undefined reference to malloc, free, etc). ]The work looks promising though! :) ] ]Other feedback: What is up with all the environment variables? It ]seems to be to allow GCC49 to be used with/without lto... I know that environment variables are not the normal way EDK2 build options are set. I just did it this way for now because the patch is at the experimental stage. For example, a few new warnings appear when lto is used. When this happens passing CC flags through an environment variables makes it easy to temporarily disable the EDK2 standard setting of -Werror so that the build can complete. For example, AutoGen.h:50:20: warning: type of '_gPcd_FixedAtBuild_PcdShellFile' does not match original declaration extern const VOID* _gPcd_FixedAtBuild_PcdShellFile[]; AutoGen.c:277:43: note: previously declared here GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gPcd_FixedAtBuild_PcdShellFile[16] = { 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }; ]Instead, I think we should do one of these: ]* Convert GCC49 to LTO only This might be possible, but a lot more work is needed before it is known if gcc49 lto mode can be used with all EDK2 projects. ]* Wait for GCC50 to enable LTO ]* Add GCC49LTO This would be one way to enable/disable lto mode without using an environment variable. ]-Jordan ] ]> From: Sergey Isakov [mailto:isakov...@bk.ru] > Sent: Friday, November 07, 2014 07:06 AM > To: edk2-devel@lists.sourceforge.net > Subject: Re: [edk2] Status of gcc link time optimization for EDK2 use > > > > It is very interesting and I hope someone can apply this to EDK2. I failed. > > I created gcc-4.9.2 for linux-gnu target with --enable-plugin. And binutils > with --enable-plugins. Success. > > But option -flto brakes building. > > This advice > > --------- > > 2) Use gcc to launch the ld instead of invoking ld directly > > ----------- > > failed because of build options for ld > > ----- > > x86_64-linux-gnu-gcc: error: unrecognized command line option '-Map' > > x86_64-linux-gnu-gcc: error: unrecognized command line option '-melf_x86_64' > > x86_64-linux-gnu-gcc: error: unrecognized command line option '--oformat= > elf64-x86-64' > > x86_64-linux-gnu-gcc: error: unrecognized command line option '-(' > > ----- > > and so on. > > Using ld I got another problems like error adding symbols: Bad value > > As well as losing _ModuleEntryPoint or .text section at all. > > > > I pass waiting for a good news. > > > > > > > > On 07.11.2014, at 9:05, Scott Duplichan wrote: > > > > http://notabs.org/uefi/gcc-lto.htm > > Thanks, > Scott > > > > ------------------------------------------------------------------------------ > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/edk2-devel > > > ------------------------------------------------------------------------------ _______________________________________________ edk2-devel mailing list edk2-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/edk2-devel