Friday May 26, 2017 18:45:33 UTC
GCC 4.9+ - Kernel Patch
The original patch listed on this page was built for the purpose of being able to compile the Linux kernel with optimizations for more recent AMD and Intel CPU microarchitectures as supported by newer GCC compiler versions.

-------
Graysky has been keeping the patch updated with the new kernel versions up to kernel 4.9 and GCC versions 4.9+. I would like to say thanks for keeping this updated.

https://github.com/graysky2/kernel_gcc_patch
-------


GCC has changes with the naming conventions for the Intel -march flags to use the processor code names. For example, Nehalem instead of corei7. I used the old naming convention for now for backwards compatibility with older compiler versions.

CPU Family GCC option
AMD Barcelona -march=barcelona
AMD Bobcat -march=btver1
AMD Jaguar -march=btver2
AMD Bulldozer -march=bdver1
AMD Piledriver -march=bdver2
AMD Steamroller -march=bdver3
AMD Excavator -march=bdver4
AMD Zen -march=znver1
Intel 1st Gen Core - Nehalem -march=corei7, ALT -march=nehalem
Intel 1st Gen Core - Westmere -march=westmere
Intel 2nd Gen Core - Sandy Bridge -march=corei7-avx, ALT -march=sandybridge
Intel 3rd Gen Core - Ivy Bridge -march=core-avx-i, ALT -march=ivybridge
Intel 4th Gen Core - Haswell -march=core-avx2, ALT -march=haswell
Intel 5th Gen Core - Broadwell -march=broadwell
Intel 6th Gen Core - Skylake -march=skylake
Intel Core Skylake with AVX-512 -march=skylake-avx512
Intel Core Broadwell -march=broadwell
Intel Atom Bonnell -march=bonnell
Intel Atom Silvermont -march=silvermont


Older patches:

Kernel 3.14 GCC 4.9 Patch

GCC Change History:

GCC x86 Options
GCC 6 Changes
GCC 5 Changes
GCC 4.9 Changes
GCC 4.8 Changes
GCC 4.7 Changes
GCC 4.6 Changes