Kernel 7.1.3-1 build failure on vmlinux.o

I’m trying to build the new 7.1.3-1 kernel using the Kernel Manager. However, when it gets to vmlinux.o, it gives the following errors;

make[2]: *** [scripts/Makefile.vmlinux_o:76: vmlinux.o] Error 135
make[1]: *** [/tmp/makepkg/linux-cachyos-native/src/cachyos-7.1.3-1/Makefile:1344: vmlinux_o] Error 2
make: *** [Makefile:248: __sub-make] Error 2
==> ERROR: A failure occurred in build().

Edit: Oh, here’s my KM config file, as well;

hardly_check = true
per_gov_check = true
tcp_bbr3_check = true
cachy_config_check = true
nconfig_check = false
xconfig_check = false
localmodcfg_check = false
use_current_check = false
builtin_zfs_check = false
builtin_nvidia_open_check = true
build_debug_check = false
hz_ticks_combo = "1000"
tickrate_combo = "full"
preempt_combo = "full"
hugepage_combo = "always"
lto_combo = "thin"
cpu_opt_combo = "native"
custom_name_edit = "$pkgbase-native"

Edit 2: I decided to try falling back to the default makepkg.conf, and compilation got past linking vmlinux.o and rest of compilation finished successfully. Here’s the contents of my custom makepkg.conf (which lives as .makepkg.conf in my Home directory)

#
# /etc/makepkg.conf
#

#########################################################################
# SOURCE ACQUISITION
#########################################################################
#
#-- The download utilities that makepkg should use to acquire sources
#  Format: 'protocol::agent'
DLAGENTS=('ftp::/usr/bin/curl -fC - --ftp-pasv --retry 3 --retry-delay 3 -o %o %u'
          'http::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'https::/usr/bin/curl -fLC - --retry 3 --retry-delay 3 -o %o %u'
          'rsync::/usr/bin/rsync -z %u %o'
          'scp::/usr/bin/scp -C %u %o')

# Other common tools:
# /usr/bin/snarf
# /usr/bin/lftpget -c
# /usr/bin/wget

#########################################################################
# ARCHITECTURE, COMPILE FLAGS
#########################################################################
#
CARCH="x86_64"
CHOST="x86_64-unknown-linux-gnu"

#-- Compiler and Linker Flags
# -march (or -mcpu) builds exclusively for an architecture
# -mtune optimizes for an architecture, but builds for whole processor family
CFLAGS="-march=native -mtune=native -O3 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
CXXFLAGS="-march=native -mtune=native -O3 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu"
#,-fuse-ld=lld" 
#-- Make Flags: change this for DistCC/SMP systems
#MAKEFLAGS="-j2"

#########################################################################
# BUILD ENVIRONMENT
#########################################################################
#
# Defaults: BUILDENV=(fakeroot !distcc color !ccache check !sign)
#  A negated environment option will do the opposite of the comments below.
#
#-- fakeroot: Allow building packages as a non-root user
#-- distcc:   Use the Distributed C/C++/ObjC compiler
#-- color:    Colorize output messages
#-- ccache:   Use ccache to cache compilation
#-- check:    Run the check() function if present in the PKGBUILD
#-- sign:     Generate PGP signature file
#
BUILDENV=(!distcc color !ccache check !sign)
#
#-- If using DistCC, your MAKEFLAGS will also need modification. In addition,
#-- specify a space-delimited list of hosts running in the DistCC cluster.
#DISTCC_HOSTS=""
#
#-- Specify a directory for package building.
BUILDDIR=/tmp/makepkg

#########################################################################
# GLOBAL PACKAGE OPTIONS
#   These are default values for the options=() settings
#########################################################################
#
# Default: OPTIONS=(strip docs libtool emptydirs zipman purge !upx)
#  A negated option will do the opposite of the comments below.
#
#-- strip:     Strip symbols from binaries/libraries
#-- docs:      Save doc directories specified by DOC_DIRS
#-- libtool:   Leave libtool (.la) files in packages
#-- emptydirs: Leave empty directories in packages
#-- zipman:    Compress manual (man and info) pages in MAN_DIRS with gzip
#-- purge:     Remove files specified by PURGE_TARGETS
#-- upx:       Compress binary executable files using UPX
#
OPTIONS=(strip docs libtool emptydirs zipman purge)

#-- File integrity checks to use. Valid: md5, sha1, sha256, sha384, sha512
INTEGRITY_CHECK=(md5)
#-- Options to be used when stripping binaries. See `man strip' for details.
STRIP_BINARIES="--strip-all"
#-- Options to be used when stripping shared libraries. See `man strip' for details.
STRIP_SHARED="--strip-unneeded"
#-- Options to be used when stripping static libraries. See `man strip' for details.
STRIP_STATIC="--strip-debug"
#-- Manual (man and info) directories to compress (if zipman is specified)
MAN_DIRS=({usr{,/local}{,/share},opt/*}/{man,info})
#-- Doc directories to remove (if !docs is specified)
DOC_DIRS=(usr/{,local/}{,share/}{doc,gtk-doc} opt/*/{doc,gtk-doc})
#-- Files to be removed from all packages (if purge is specified)
PURGE_TARGETS=(usr/{,share}/info/dir .packlist *.pod)

#########################################################################
# PACKAGE OUTPUT
#########################################################################
#
# Default: put built package and cached source in build directory
#
#-- Destination: specify a fixed directory where all packages will be placed
#PKGDEST=/home/packages
#-- Source cache: specify a fixed directory where source files will be cached
#SRCDEST=/home/sources
#-- Source packages: specify a fixed directory where all src packages will be placed
#SRCPKGDEST=/home/srcpackages
#-- Packager: name/email of the person or organization building packages
#PACKAGER="John Doe <john@doe.com>"
#-- Specify a key to use for package signing
#GPGKEY=""

#########################################################################
# EXTENSION DEFAULTS
#########################################################################
#
# WARNING: Do NOT modify these variables unless you know what you are
#          doing.
#
PKGEXT='.pkg.tar.xz'
SRCEXT='.src.tar.gz'

# vim: set ft=sh ts=2 sw=2 et:

#Set default compiler for makepkg
export CC=clang
export CXX=clang++

not working for me. I just copy your “.makepkg.conf” in my /home/abc and invoked kernel manager with default settings. I just changed in menu-interface to be “CPU native”. but I have error:

scripts/sign-file.c:25:10: fatal error: 'openssl/opensslv.h' file not found
25 | #include <openssl/opensslv.h>
| ^~~~~~~~~~~~~~~~~~~~
1 error generated.
make[2]: *** [scripts/Makefile.host:114: scripts/sign-file] Error 1
make[1]: *** [/tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/Makefile:1384: scripts] Error 2
make: *** [Makefile:248: __sub-make] Error 2
==> ERROR: A failure occurred in prepare().
Aborting...
Press enter to exit

or should I edit /change (as admin / root) the /etc/makepgk.conf ? hm, this will change every future build pkg ?

FYI: I re-installed fresh “openssl” – which has my missing file/header. , I clean-up the /tmp/make*, but now I have other error:

/tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/tools/objtool/include/objtool/elf.h:10:10: fatal error:
'gelf.h' file not found
10 | #include <gelf.h>
| ^~~~~~~~
1 error generated.
make[5]: *** [/tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/tools/build/Makefile.build:96: /tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/tools/objtool/arch/x86/decode.o] Error 1
make[4]: *** [/tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/tools/build/Makefile.build:158: arch/x86] Error 2
make[3]: *** [Makefile:123: /tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/tools/objtool/objtool-in.o] Error 2
make[2]: *** [Makefile:74: objtool] Error 2
make[1]: *** [/tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/Makefile:1583: tools/objtool] Error 2
make: *** [Makefile:248: __sub-make] Error 2
==> ERROR: A failure occurred in prepare().
Aborting...
Press enter to exit

F**K! I reinstalled package"libelf" which has my missing file/header (gelf.h), but now another error. Come on! I am not a programmer, neither hunting for re-instaling a lot of packages ALREADY INSTALLED…

GEN /tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/tools/bpf/resolve_btfids/libbpf/bpf_helper_defs.h
CC /tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf.o
libbpf.c:48:10: fatal error: 'zlib.h' file not found
48 | #include <zlib.h>
| ^~~~~~~~
1 error generated.
make[5]: *** [/tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/tools/build/Makefile.build:96: /tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf.o] Error 1
make[4]: *** [Makefile:152: /tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/tools/bpf/resolve_btfids/libbpf/staticobjs/libbpf-in.o] Error 2
make[3]: *** [Makefile:62: /tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/tools/bpf/resolve_btfids//libbpf/libbpf.a] Error 2
make[2]: *** [Makefile:77: bpf/resolve_btfids] Error 2
make[1]: *** [/tmp/makepkg/linux-cachyos-custom/src/cachyos-7.1.3-1/Makefile:1583: tools/bpf/resolve_btfids] Error 2
make: *** [Makefile:248: __sub-make] Error 2
==> ERROR: A failure occurred in prepare().
Aborting...
Press enter to exit

I solved, finally. I re-installed fresh another package “zlib-ng” which has the missing file/header. So in summary, I just need to re-install few packaged again (even if they were already installed) : openssl + libelf + zlib-ng. And the kernel compilation is (still after 10 minutes) running without interruption .

FYI: it compiles 1000+ modules, when I just need few specific to my laptop. So, kernel manager is good/OK, but maybe is better to lean to do it myself in old style make menuconfig + use CachyOS kernel patches.YMMV.

Umm, the makepkg.conf I posted is what my build was failing with, I posted it because I wanted to see if anyone could look at it and see what would be causing the failure.

To build a smaller kernel, aka tweak it using “modpobed-db” option,

1. via nconfig, I need to re-install package “ncurses”.

2-. or via x-config (misleading, because,is QT6), I need to re-install package “qt6-base”.

FYI: I do not think is necessary to change makepkg.conf.

But, same like you, it stooped at generated last object:

COPY vmlinux.a
GEN .tmp_initcalls.lds
LD vmlinux.o