You are not logged in.

#1 2021-09-01 05:55:55

mabod
Member
Registered: 2016-09-09
Posts: 7

How to compile kernel with PKGBUILD and -march=native ?

Hi,

I am struggling to build my own arch kernel with -march=native compiler option for my Ryzen processor.

I use the default linux PKGBUILD. I download the package source with "paru -G linux"

I am following this guideline https://wiki.archlinux.org/title/Kernel … ompilation . But when I edit arch/x86/Makefile the changes are reverted as soon as the build() section from the PKGBUILD is executed.

This is also true if I change the config option in .config with

prepare() {
  ...
  scripts/config --disable CONFIG_GENERIC_CPU
  scripts/config --enable  CONFIG_MZEN2
  ...
}

This works with the linux-zen package but not with linux package.

If I check the .config file at the end of the prepare() function I see the new option. But as soon as "make all" is executed in the build() section, the .config file is reverted to the original and my customization are found in .config.old

So, long story short: How can I compile a customized arch kernel with -march=native?

Last edited by mabod (2021-09-01 05:57:34)

Offline

#2 2021-09-01 07:22:13

loqs
Member
Registered: 2014-03-06
Posts: 18,911

Re: How to compile kernel with PKGBUILD and -march=native ?

Offline

#3 2021-09-01 11:41:25

mabod
Member
Registered: 2016-09-09
Posts: 7

Re: How to compile kernel with PKGBUILD and -march=native ?

That worked very well. Thank you!

Offline

Board footer

Powered by FluxBB