linux-misc icon indicating copy to clipboard operation
linux-misc copied to clipboard

Linux 3.15?

Open arter97 opened this issue 10 years ago • 9 comments

How can we use LTO to build Linux 3.15 on x86?

Upstream mainline Linux 3.15 does not has LTO Kconfig, merging 3.14 changes from this repository ends up in lots of "undefined reference to `.L1'"

arter97 avatar Jun 20 '14 09:06 arter97

It's a gcc bug. in net/core/filter.c __sk_run_filter has a computed goto jump table in a static. But the gcc LTO partitioner moves the jump table into a different LTO partition, which breaks the references to the code labels.

For now I disabled LTO for the file until a better workaround is found or gcc is fixed.

I pushed a new branch lto-linus-3.15 with this change (subset of full LTO tree)

andikleen avatar Jun 27 '14 21:06 andikleen

Thanks a million!

arter97 avatar Jun 27 '14 23:06 arter97

gcc bug tracked in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61635

andikleen avatar Jun 28 '14 15:06 andikleen

Hope to see that in fixed in GCC 4.9.1...

Man, you are doing an enormous contribution not only to the Linux kernel but also GNU.

Thanks a zillion! On Jun 29, 2014 12:57 AM, "andikleen" [email protected] wrote:

gcc bug tracked in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61635

— Reply to this email directly or view it on GitHub https://github.com/andikleen/linux-misc/issues/12#issuecomment-47431101.

arter97 avatar Jun 28 '14 16:06 arter97

Maybe I'm missing something out here... My Linux 3.14(x86) with LTO, 3.15(x86) with LTO, 3.4(ARM) with LTO all fails to load every kernel modules.

Do you have any idea why?

arter97 avatar Jun 29 '14 08:06 arter97

What's the error message in dmesg ?

andikleen avatar Jun 29 '14 16:06 andikleen

Correction : it doesn't fails but it doesn't probes or do anything. lsmod tells me the modules are live, but dmesg does not show anything related to probing kernel modules.

It may be the compiler or the linker's fault.. I actually added some arflag because my compiled gcc-ar seems to be not loading liblto. https://bitbucket.org/arter97/zen-kernel/commits/c9ff16fedf8feed78cddadf562a5bc78bdce6439

Without this patch, linking fails with bunch of undefined references just like we are on normal GNU binutils instead of Linux's.

arter97 avatar Jun 29 '14 16:06 arter97

This is my binutils configure options : ./configure --prefix=/home/arter97/lto --enable-lto --disable-gold --enable-ld --enable-plugins --disable-werror

arter97 avatar Jun 30 '14 11:06 arter97

Weird. Merging linux-misc(from here) just breaks modules loading.

Even if I disable LTO_MENU. I'll dig a further and report back...

arter97 avatar Jul 04 '14 07:07 arter97