kernel "fun with flags"

Post Reply
User avatar
SalixManiac
Posts: 66
Joined: 15. Apr 2022, 02:26

kernel "fun with flags"

Post by SalixManiac » 27. May 2022, 06:03

retrieve the flags of your cpu:
$cat /proc/cpuinfo

convert your flags to gcc flags:
https://gcc.gnu.org/onlinedocs/gcc-5.5. ... 86-Options
exemple; sse2 becomes -msse2

add your flags in /usr/src/linux-4.4.302/Makefile like that:
KBUILD_CFLAGS += $(call cc-option,-mmmx)
KBUILD_CFLAGS += $(call cc-option,-msse)
KBUILD_CFLAGS += $(call cc-option,-msse2)
KBUILD_CFLAGS += $(call cc-option,-mssse3)
KBUILD_CFLAGS += $(call cc-option,-msse4.1)
KBUILD_CFLAGS += $(call cc-option,-msse4.2)
KBUILD_CFLAGS += $(call cc-option,-mfsgsbase)
KBUILD_CFLAGS += $(call cc-option,-mpopcnt)
KBUILD_CFLAGS += $(call cc-option,-mabm)
KBUILD_CFLAGS += $(call cc-option,-mfxsr)
KBUILD_CFLAGS += $(call cc-option,-mxsave)
KBUILD_CFLAGS += $(call cc-option,-mxsaveopt)

compile your kernel:
reboot:

check your kernel is using the flags:
sudo dmesg -H
:D
Colin Chapman “light is right” those last words "the middle pedal is for cowards"

Post Reply