Package Details: linux-xanmod-headers 7.0.8-1

Git Clone URL: https://aur.archlinux.org/linux-xanmod.git (read-only, click to copy)
Package Base: linux-xanmod
Description: Headers and scripts for building modules for the Linux Xanmod - Stable Mainline [MAIN] kernel
Upstream URL: http://www.xanmod.org/
Licenses: GPL-2.0-only
Submitter: Yoshi2889
Maintainer: figue (figuepluto, jfigueras)
Last Packager: figue
Votes: 131
Popularity: 0.20
First Submitted: 2017-02-14 09:40 (UTC)
Last Updated: 2026-05-16 10:15 (UTC)

Pinned Comments

anlorsp commented on 2024-07-13 17:07 (UTC) (edited on 2024-07-15 04:53 (UTC) by anlorsp)

Adding

scripts/config --disable CONFIG_IMA_ARCH_POLICY

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.

##
## The following variables can be customized at build time. Use env or export to change at your wish
##
##   Example: env _microarchitecture=98 use_numa=n use_tracers=n makepkg -sc
##
## Look inside 'choose-gcc-optimization.sh' to choose your microarchitecture
## Valid numbers between: 0 to 99
## Default is: 0 => generic
## Good option if your package is for one machine: 98 (Intel native) or 99 (AMD native)
if [ -z ${_microarchitecture+x} ]; then
  _microarchitecture=0
fi

## Disable NUMA since most users do not have multiple processors. Breaks CUDA/NvEnc.
## Archlinux and Xanmod enable it by default.
## Set variable "use_numa" to: n to disable (possibly increase performance)
##                             y to enable  (stock default)
if [ -z ${use_numa+x} ]; then
  use_numa=y
fi

## Since upstream disabled CONFIG_STACK_TRACER (limits debugging and analyzing of the kernel)
## you can enable them setting this option. Caution, because they have an impact in performance.
## Stock Archlinux has this enabled. 
## Set variable "use_tracers" to: n to disable (possibly increase performance, XanMod default)
##                                y to enable  (Archlinux default)
if [ -z ${use_tracers+x} ]; then
  use_tracers=n
fi

# Unique compiler supported upstream is GCC
## Choose between GCC and CLANG config (default is GCC)
## Use the environment variable "_compiler=clang"
if [ "${_compiler}" = "clang" ]; then
  _compiler_flags="CC=clang HOSTCC=clang LLVM=1 LLVM_IAS=1"
fi

# Choose between the 4 main configs for stable branch. Default x86-64-v1 which use CONFIG_GENERIC_CPU2:
# Possible values: config_x86-64-v1 (default) / config_x86-64-v2 / config_x86-64-v3 / config_x86-64-v4
# This will be overwritten by selecting any option in microarchitecture script
# Source files: https://github.com/xanmod/linux/tree/5.17/CONFIGS/xanmod/gcc
if [ -z ${_config+x} ]; then
  _config=config_x86-64-v1
fi

# Compress modules with ZSTD (to save disk space)
if [ -z ${_compress_modules+x} ]; then
  _compress_modules=n
fi

# Compile ONLY used modules to VASTLY reduce the number of modules built
# and the build time.
#
# To keep track of which modules are needed for your specific system/hardware,
# give module_db script a try: https://aur.archlinux.org/packages/modprobed-db
# This PKGBUILD read the database kept if it exists
#
# More at this wiki page ---> https://wiki.archlinux.org/index.php/Modprobed-db
if [ -z ${_localmodcfg} ]; then
  _localmodcfg=n
fi

# Tweak kernel options prior to a build via nconfig
if [ -z ${_makenconfig} ]; then
  _makenconfig=n
fi

Personally I'm running now xanmod kernel compiled with this:

env _microarchitecture=98 use_tracers=n use_numa=n _localmodcfg=y _compress_modules=y makepkg -sic

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:

  for _myconfig in "${SRCDEST}/myconfig" "${HOME}/.config/linux-xanmod/myconfig" "${XDG_CONFIG_HOME}/linux-xanmod/myconfig" ; do
    if [ -f "${_myconfig}" ] && [ "$(wc -l <"${_myconfig}")" -gt "0" ]; then
      if grep -q 'scripts/config' "${_myconfig}"; then
        # myconfig is a partial file. Executing as a script
        msg2 "Applying myconfig..."
        bash -x "${_myconfig}"
      else
        # myconfig is a full config file. Replacing default .config
        msg2 "Using user CUSTOM config..."
        cp -f "${_myconfig}" .config
      fi
      echo
      break
    fi
  done

Latest Comments

1 2 3 4 5 6 .. 53 Next › Last »

j1simon commented on 2026-02-28 09:19 (UTC) (edited on 2026-02-28 11:28 (UTC) by j1simon)

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?

figue commented on 2025-12-17 08:52 (UTC)

@grdgkjrpdihe ok. I also checked it and unflagged :)

grdgkjrpdihe commented on 2025-12-17 06:47 (UTC)

sorry for wrong flag. 6.18 seems still in edge rather than main

derfehler commented on 2025-11-16 20:18 (UTC)

Here's some information about how people fixed the issue with the script for selecting microarchitecture and the CONFIG_X86_L1_CACHE_SHIFT identifier: https://gitlab.com/xanmod/linux/-/issues/446#note_2729829934

derfehler commented on 2025-08-28 22:02 (UTC) (edited on 2025-08-29 11:16 (UTC) by derfehler)

I'm building this package like this: env _compiler=clang _microarchitecture=99 use_tracers=n use_numa=n _compress_modules=y _localmodcfg=y makepkg -sficC. During the build, an error appears: ./arch/x86/include/asm/tlbflush.h:153:1: error: use of undeclared identifier 'CONFIG_X86_L1_CACHE_SHIFT'. As far as I understand, the identifier 'CONFIG_X86_L1_CACHE_SHIFT' is missing from .config. According to the patch, it modifies src/linux-6.16/CONFIGS/x86_64/config, then this config is copied to src/linux-6.16/.config, and something else happens to this file afterward, after which 'CONFIG_X86_L1_CACHE_SHIFT=6' disappears from it.

The problem occurs only when I select "Native optimizations autodetected" (98, 99) as the microarchitecture. When I specifically choose my processor's architecture (Zen2 - 12), the build proceeds without errors.

figue commented on 2025-02-23 13:34 (UTC)

@derfehler sorry about that. I merged PKGBUILD with -edge yesterday, but I didn't test it. Should be fixed now.

@smn try to delete src directory before building it again

smn commented on 2025-02-23 09:03 (UTC)

Even when pointing cp -vf CONFIGS/xanmod/gcc/${_config} .config to CONFIGS/x86-64/config, the package does not build for me (patches fail to apply).

derfehler commented on 2025-02-22 21:21 (UTC) (edited on 2025-02-22 21:22 (UTC) by derfehler)

when compiling there is an error that there is no file at the path “CONFIGS/xanmod/gcc/config_x86-64-v2”. Now the config is in a different path “CONFIGS/x86-64/config”

BytEvil commented on 2025-02-04 05:16 (UTC)

Hi. Module compression does not work without

scripts/config --enable CONFIG_MODULE_COMPRESS

figue commented on 2025-01-27 13:05 (UTC) (edited on 2025-01-27 13:05 (UTC) by figue)

@murlakatamenka thank you. Will be added in next release.