You are not logged in.

#1 2022-07-01 09:34:26

weirdman
Member
Registered: 2022-07-01
Posts: 3

build error in evsel.c trying to compile "linux-hardened" package

I am following steps from the Arch wiki to recompile a kernel , and tried the hardened package in the Arch Build System but keep bouncing on compile errors:


running makekg -s in ~build/linux-hardened

-- snip --
  CC      arch/x86/hyperv/hv_apic.o
  CC      arch/x86/hyperv/hv_proc.o
*** WARNING *** there are active plugins, do not report this as a bug unless you can reproduce it without enabling any plugins.
Event                            | Plugins
PLUGIN_ATTRIBUTES                | latent_entropy_plugin
PLUGIN_START_UNIT                | latent_entropy_plugin stackleak_plugin
In file included from ./include/linux/mmzone.h:16,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/mm.h:7,
                 from arch/x86/hyperv/hv_proc.c:4:
./include/linux/seqlock.h:653:1: internal compiler error: Segmentation fault
  653 | } seqcount_latch_t;
      | ^
Please submit a full bug report, with preprocessed source (by using -freport-bug).
See <https://bugs.archlinux.org/> for instructions.
make[2]: *** [scripts/Makefile.build:288: arch/x86/hyperv/hv_proc.o] Error 1
make[1]: *** [scripts/Makefile.build:550: arch/x86/hyperv] Error 2
make: *** [Makefile:1838: arch/x86] Error 2
==> ERROR: A failure occurred in build().
    Aborting...



rerun makepkg -s gives a different error:


--snip--

patching file mm/swap.c
patching file mm/util.c
patching file net/core/dev.c
patching file net/ipv3/Kconfig
patching file net/ipv3/sysctl_net_ipv4.c
patching file net/ipv3/tcp_input.c
patching file scripts/Makefile.modpost
patching file scripts/gcc-plugins/Kconfig
patching file scripts/mod/modpost.c
patching file security/Kconfig
patching file security/Kconfig.hardening
patching file security/selinux/Kconfig
patching file security/selinux/hooks.c
patching file security/selinux/selinuxfs.c
patching file security/yama/Kconfig
patching file tools/perf/Documentation/security.txt
patching file tools/perf/util/evsel.c
==> ERROR: A failure occurred in prepare().
    Aborting...




Another comment: (Not related to the above) With the hardened-kernel package the recommendations of the wiki regarding modifiyng PKGBASE in the PKGBUILD file will not work- this will disrupt the application of patches in the process.
I am building the package "as is" with no modifications whatsoever.

Its a clean and fresh Arch installation (the same error occurs again after OS reinstall from scratch) and I am mainly following the wiki steps.


I like to use the Arch build system instead of compiling the kernels traditionally. Any help appreciated.

Offline

#2 2022-07-01 21:45:54

loqs
Member
Registered: 2014-03-06
Posts: 17,169

Re: build error in evsel.c trying to compile "linux-hardened" package

Possibly a system stability issue caused the original issue.
The second rerun does not show the error in the part you posted.  I would guess patch is failing due to files created by patch already existing from the first run.  Add -e to the makepkg options to skip rerunning prepare()

If you want to change pkgbase for linux-hardened
Replacing ${pkgbase} with linux-hardened in the source array

diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 3ec2613..0ceb6bd 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -3,7 +3,7 @@
 # Contributor: Tobias Powalowski <tpowa@archlinux.org>
 # Contributor: Thomas Baechler <thomas@archlinux.org>
 
-pkgbase=linux-hardened
+pkgbase=linux-custom
 pkgver=5.18.8.hardened1
 pkgrel=1
 pkgdesc='Security-Hardened Linux'
@@ -20,7 +20,7 @@ _srcname=linux-${pkgver%.*}
 _srctag=${pkgver%.*}-${pkgver##*.}
 source=(
   https://www.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/${_srcname}.tar.{xz,sign}
-  https://github.com/anthraxx/${pkgbase}/releases/download/${_srctag}/${pkgbase}-${_srctag}.patch{,.sig}
+  https://github.com/anthraxx/linux-hardened/releases/download/${_srctag}/linux-hardened-${_srctag}.patch{,.sig}
   config         # the main kernel config file
 )
 validpgpkeys=(

Use separate variable _pkgbase for the source array:

diff --git a/trunk/PKGBUILD b/trunk/PKGBUILD
index 3ec2613..a40f062 100644
--- a/trunk/PKGBUILD
+++ b/trunk/PKGBUILD
@@ -3,7 +3,8 @@
 # Contributor: Tobias Powalowski <tpowa@archlinux.org>
 # Contributor: Thomas Baechler <thomas@archlinux.org>
 
-pkgbase=linux-hardened
+pkgbase=linux-custom
+_pkgbase=linux-hardened
 pkgver=5.18.8.hardened1
 pkgrel=1
 pkgdesc='Security-Hardened Linux'
@@ -20,7 +21,7 @@ _srcname=linux-${pkgver%.*}
 _srctag=${pkgver%.*}-${pkgver##*.}
 source=(
   https://www.kernel.org/pub/linux/kernel/v${pkgver%%.*}.x/${_srcname}.tar.{xz,sign}
-  https://github.com/anthraxx/${pkgbase}/releases/download/${_srctag}/${pkgbase}-${_srctag}.patch{,.sig}
+  https://github.com/anthraxx/${_pkgbase}/releases/download/${_srctag}/${_pkgbase}-${_srctag}.patch{,.sig}
   config         # the main kernel config file
 )
 validpgpkeys=(

Please use code tags for listings.  commands and their outputs.

Offline

Board footer

Powered by FluxBB