I'm sorry for posting this, because I bet it's very, very common, but have had no luck searching for it.
Now that Linux 3.8.1 is coming to the AUR (well... I guess...) I'd like to compile it by myself, disabling lots of things that I don't need, and of course optimizing it!
-march=native seems to be the best optimisation option, but I'm wondering if it's possible to use it to compile the Linux kernel.
Thank you all, best regards
P.S.: I have -O2 in my /etc/makepkg.conf. Is there any reason to not put -O3 instead? Does anybody know of any other optimisation options?
Last edited by Kalrish (2013-03-06 17:19:17)
There's some info in the files under gcc_patch.
So, it looks like you might get a *tiny* improvement.
-O3 does not make apps magically faster, sadly It can introduce compiler bugs, and make apps slower/buggy.
The Linux Kernel uses it's own HOSTCFLAGS & HOSTCXXFLAGS in the Makefile. Any changers will need to be done here. The stock optimisation is O2.
There is no "march=" as you you select your arch. from make menuconfig ---> Processor type and features ---> Processor family (Generic-x86-64) --->.
Suggested reading: http://forums.gentoo.org/viewtopic-t-24849-start-0.html
Ok, thank you all! Very useful info.
Maybe I'm a bit 'aggressive', but I think it's right to try to get the best performance - and also to choose what to use! Marking as "[SOLVED]", thank you.
In this commit of the patch, I added an option that will pass a literal `-march=native` to the compiler while making a kernel. Apply the patch yourself or try it out in v3.8.6-1 of linux-ck. Seems to be working fine on my box.
Last edited by graysky (2013-04-06 13:49:38)
Linux-pf has this patch applied too (currently a older version but in next release I'll use grayskys patch).
Linux odin 3.13.1-pf #1 SMP PREEMPT Wed Mar 5 21:47:28 CET 2014 x86_64 GNU/Linux
Does the patch of kernel-38-gcc47-2.patch.gz also applied for gcc v4.8?
Many packages used patch of gcc v4.7, whether these packages have no ploblem if i upgrade to gcc v4.8?
Sorry for my poor english.
@jim - Yes. Bad naming on my part which has now been corrected:
https://github.com/graysky2/kernel_gcc_ … d46e8707ea
Thanks for the report.