kernel "fun with flags"

Post Reply
User avatar
Posts: 79
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: ... 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:

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

Post Reply