I have defined in my .zshrc this exports:
export _microarchitecture=99
export use_numa=n
export _compiler=clang
export _localmodcfg=y
export use_tracers=n
export _compress_modules=n
But when I compile this package with pikaur, it doesn't respect these settings (except march=native):
$ zgrep CONFIG_NUMA /proc/config.gz
CONFIG_NUMA=y
$ zgrep -i "march" /proc/config.gz
CONFIG_CC_HAS_MARCH_NATIVE=y
It doesn't respect _localmodcfg either, since even though I have an AMD graphics card and modprobed-db installed and configured, it compiles all graphics drivers.
The curious thing is that it receives the _compiler=clang value because it installs clang llvm lld but it seems that the compilation is actually done with gcc:
$ cat /proc/version
Linux version 6.18.13-x64v3-xanmod1-1 (makepkg@archlinux) (gcc (GCC) 15.2.1 20260209, GNU ld (GNU Binutils) 2.46) #1 SMP PREEMPT_DYNAMIC Sat, 28 Feb 2026 09:05:01 +0000
It would be more practical to be able to define these variables in a file (just as I can define my own myconfig) so that the compilation retrieves it if it exists.
I've changed the strategy. I edited the PKGBUILD (with pikaur) to add the variables at the beginning:
_microarchitecture=99
use_numa=n
_compiler=clang
_localmodcfg=y
use_tracers=n
_compress_modules=n
But now it gives errors when compiling:
...
In file included from ./arch/x86/include/asm/uaccess.h:17:
./arch/x86/include/asm/tlbflush.h:153:1: error: use of undeclared identifier 'CONFIG_X86_L1_CACHE_SHIFT'
153 | DECLARE_PER_CPU_ALIGNED(struct tlb_state, cpu_tlbstate);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/percpu-defs.h:150:2: note: expanded from macro 'DECLARE_PER_CPU_ALIGNED'
150 | ____cacheline_aligned
| ^~~~~~~~~~~~~~~~~~~~~
./include/vdso/cache.h:12:58: note: expanded from macro '____cacheline_aligned'
12 | #define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
| ^~~~~~~~~~~~~~~
./include/vdso/cache.h:8:25: note: expanded from macro 'SMP_CACHE_BYTES'
8 | #define SMP_CACHE_BYTES L1_CACHE_BYTES
| ^~~~~~~~~~~~~~
./arch/x86/include/asm/cache.h:9:30: note: expanded from macro 'L1_CACHE_BYTES'
9 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT)
| ^~~~~~~~~~~~~~
./arch/x86/include/asm/cache.h:8:25: note: expanded from macro 'L1_CACHE_SHIFT'
8 | #define L1_CACHE_SHIFT (CONFIG_X86_L1_CACHE_SHIFT)
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from arch/x86/kernel/asm-offsets.c:10:
In file included from ./include/crypto/aria.h:22:
In file included from ./include/linux/module.h:20:
In file included from ./include/linux/elf.h:6:
In file included from ./arch/x86/include/asm/elf.h:10:
In file included from ./arch/x86/include/asm/ia32.h:7:
In file included from ./include/linux/compat.h:17:
In file included from ./include/linux/fs.h:34:
In file included from ./include/linux/percpu-rwsem.h:7:
In file included from ./include/linux/rcuwait.h:6:
In file included from ./include/linux/sched/signal.h:9:
In file included from ./include/linux/sched/task.h:13:
In file included from ./include/linux/uaccess.h:12:
In file included from ./arch/x86/include/asm/uaccess.h:17:
./arch/x86/include/asm/tlbflush.h:173:1: error: use of undeclared identifier 'CONFIG_X86_L1_CACHE_SHIFT'
173 | DECLARE_PER_CPU_SHARED_ALIGNED(struct tlb_state_shared, cpu_tlbstate_shared);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/percpu-defs.h:142:2: note: expanded from macro 'DECLARE_PER_CPU_SHARED_ALIGNED'
142 | ____cacheline_aligned_in_smp
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
./include/linux/cache.h:65:38: note: expanded from macro '____cacheline_aligned_in_smp'
65 | #define ____cacheline_aligned_in_smp ____cacheline_aligned
| ^~~~~~~~~~~~~~~~~~~~~
./include/vdso/cache.h:12:58: note: expanded from macro '____cacheline_aligned'
12 | #define ____cacheline_aligned __attribute__((__aligned__(SMP_CACHE_BYTES)))
| ^~~~~~~~~~~~~~~
....
Why isn't the patch referenced in this note (https://gitlab.com/xanmod/linux/-/issues/446#note_2729829934) implemented and why isn't Microarchitecture modified for the case when native is chosen?
Pinned Comments
anlorsp commented on 2024-07-13 17:07 (UTC) (edited on 2024-07-15 04:53 (UTC) by anlorsp)
Adding
to myconfig does solve the "Failed to insert module 'nvidia': Key was rejected by service" problem.
Anyone who configured secure boot using sbctl and want to load dkms modules can try this solution.
figue commented on 2018-12-14 00:50 (UTC) (edited on 2023-02-27 20:00 (UTC) by figue)
This package have several variables to enable/disable features.
Personally I'm running now xanmod kernel compiled with this:
Also, you can now create the file myconfig in your local repo to build this package with a custom config or use ${XDG_CONFIG_HOME}/linux-xanmod/myconfig. This file can be a full kernel config or be a script with several entries to add/remove options (you have several examples in PKGBUILD by using scripts/config):
Code involved: