Michal Jires <[email protected]> writes: > These patches allow us to handle toplevel assembly referencing symbols. > Previous linux kernel patches needed to mark any such referenced symbols > manually. Currently needed linux patches are here: > https://gitlab.com/mixal_iirec/linux_gcc_lto_patches > > Thanks for all the work.
I suspect some of the kernel patches can be simplified by leveraging the clang changes more, also probably we don't need need gcc-ld if we make it easier to use the plugin directly with the linker. I tried it actually, the main obstacle is that you need a unique resolution file for each target. LDFLAGS += -plugin $(shell $(CC) -print-prog-name=liblto_plugin.so) -plugin-opt=$(shell $(CC) -print-prog-name=lto-wrapper) -plugin-opt=-fresolution=$(shell mktemp).res # needs to be a lazy variable to get a unique tmp file for each target # lto-wrapper/plugin should just generate its own file name? COLLECT_GCC=gcc COLLECT_GCC_OPTIONS="-flto" make Or alternatively ship a cleaned up variant of gcc-ld with gcc. > First part of these patches allows toplevel assembly to be partitioned. > Seconds part heuristically detects which symbols are referenced from > toplevel assembly and disables optimizations so that they are correctly > partitioned. > > It works with 1to1 partitioning. The requirement is that the > partitioning puts local symbols and toplevel assembly from single file > into the same partition by default. Just 1:1 is slow, isn't it? -Andi
