Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 906709

Summary: dev-util/scap-driver-0.29.3-r2: build failure with kernel-6.4
Product: Gentoo Linux Reporter: Jeff Cliff <jeffrey.cliff>
Component: Current packagesAssignee: Holger Hoffstätte <holger>
Status: RESOLVED FIXED    
Severity: normal CC: proxy-maint
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://github.com/falcosecurity/libs/issues/1109
See Also: https://github.com/falcosecurity/libs/pull/1110
https://github.com/gentoo/gentoo/pull/31096
Whiteboard:
Package list:
Runtime testing required: ---

Description Jeff Cliff 2023-05-19 00:12:28 UTC
error when compiling scap-driver-0.29.3-r2 (tried with both amd64 and ~amd64 versions, same result):

fails to compile:

make -C /usr/src/linux M=/var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src modules
  CC [M]  /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/main.o
  CC [M]  /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/dynamic_params_table.o
  CC [M]  /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/fillers_table.o
  CC [M]  /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/flags_table.o
  CC [M]  /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/ppm_fillers.o
  CC [M]  /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/ppm_events.o
  CC [M]  /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/event_table.o
  CC [M]  /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/syscall_table.o
  CC [M]  /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/ppm_cputime.o
In file included from ./include/linux/linkage.h:7,
                 from ./arch/x86/include/asm/cache.h:5,
                 from ./include/linux/cache.h:6,
                 from ./arch/x86/include/asm/current.h:9,
                 from ./include/linux/sched.h:12,
                 from ./arch/x86/include/asm/syscall.h:14,
                 from /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/main.c:19:
/var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/main.c: In function 'scap_init':
./include/linux/export.h:27:22: error: passing argument 1 of 'class_create' from incompatible pointer type [-Werror=incompatible-pointer-types]
   27 | #define THIS_MODULE (&__this_module)
      |                     ~^~~~~~~~~~~~~~~
      |                      |
      |                      struct module *
/var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/main.c:2497:36: note: in expansion of macro 'THIS_MODULE'
 2497 |         g_ppm_class = class_create(THIS_MODULE, DRIVER_DEVICE_NAME);
      |                                    ^~~~~~~~~~~
In file included from ./include/linux/device.h:31,
                 from ./include/linux/cdev.h:8,
                 from /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/main.c:26:
./include/linux/device/class.h:229:54: note: expected 'const char *' but argument is of type 'struct module *'
  229 | struct class * __must_check class_create(const char *name);
      |                                          ~~~~~~~~~~~~^~~~
/var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/main.c:2497:23: error: too many arguments to function 'class_create'
 2497 |         g_ppm_class = class_create(THIS_MODULE, DRIVER_DEVICE_NAME);
      |                       ^~~~~~~~~~~~
./include/linux/device/class.h:229:29: note: declared here
  229 | struct class * __must_check class_create(const char *name);
      |                             ^~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:252: /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src/main.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:2026: /var/tmp/portage/dev-util/scap-driver-0.29.3-r2/work/libs-e5c53d648f3c4694385bbe488e7d47eaa36c229a_build/driver/src] Error 2
make: *** [Makefile:16: all] Error 2


Portage 3.0.44 (python 3.11.3-final-0, default/linux/amd64/17.1/desktop, gcc-12, glibc-2.36-r8, 6.4.0-rc1-next-20230511libre-dirty x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.4.0-rc1-next-20230511libre-dirty-x86_64-Intel-R-_Core-TM-_i7-3520M_CPU_@_2.90GHz-with-glibc2.36
KiB Mem:     3900912 total,    114960 free
KiB Swap:   31250428 total,  31249132 free
Timestamp of repository gentoo: Thu, 18 May 2023 21:00:01 +0000
Head commit of repository gentoo: db0eec2429137d8fbe0785515340b52f3ecd5b72
sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.40 p5) 2.40.0
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0-r2::gentoo
dev-lang/python:           3.11.3::gentoo
dev-lang/rust-bin:         1.66.1-r1::gentoo
dev-util/cmake:            3.26.3::gentoo
dev-util/meson:            1.0.1::gentoo
sys-apps/baselayout:       2.13-r1::gentoo
sys-apps/openrc:           0.46::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.40-r5::gentoo
sys-devel/binutils-config: 5.5::gentoo
sys-devel/gcc:             12.2.1_p20230428-r1::gentoo
sys-devel/gcc-config:      2.10::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/llvm:            15.0.7::gentoo
sys-devel/make:            4.4.1::gentoo
sys-kernel/linux-headers:  6.1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0
    volatile: True

defaultlayman
    location: /var/lib/layman
    masters: gentoo
    priority: 1
    volatile: True

bronze
    location: /var/lib/bronze-overlay
    masters: gentoo
    priority: 2
    volatile: True

Case_Of
    location: /var/lib/layman/Case_Of
    masters: gentoo
    priority: 50
    volatile: True

amano-kenji
    location: /var/lib/layman/amano-kenji
    masters: gentoo
    priority: 50
    volatile: True

audio-overlay
    location: /var/lib/layman/audio-overlay
    masters: gentoo
    priority: 50
    volatile: True

bronze-overlay
    location: /var/lib/layman/bronze-overlay
    masters: gentoo
    priority: 50
    volatile: True

dev1990-overlay
    location: /var/lib/layman/dev1990-overlay
    masters: gentoo
    priority: 50
    volatile: True

flavour
    location: /var/lib/layman/flavour
    masters: gentoo
    priority: 50
    volatile: True

guru
    location: /var/lib/layman/guru
    masters: gentoo
    priority: 50
    volatile: True

zugaina
    location: /var/lib/layman/zugaina
    masters: gentoo
    priority: 50
    volatile: True

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS=" -Os -Oz -march=ivybridge -maes -mavx -mcx16 -mf16c -mfsgsbase -mfxsr -mmmx -mpclmul -mpopcnt -mrdrnd -msahf -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsaveopt --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=4096 -mtune=ivybridge "
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS=" -Os -Oz -march=ivybridge -maes -mavx -mcx16 -mf16c -mfsgsbase -mfxsr -mmmx -mpclmul -mpopcnt -mrdrnd -msahf -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsaveopt --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=4096 -mtune=ivybridge "
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS=" -Os -Oz -march=ivybridge -maes -mavx -mcx16 -mf16c -mfsgsbase -mfxsr -mmmx -mpclmul -mpopcnt -mrdrnd -msahf -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsaveopt --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=4096 -mtune=ivybridge "
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS=" -Os -Oz -march=ivybridge -maes -mavx -mcx16 -mf16c -mfsgsbase -mfxsr -mmmx -mpclmul -mpopcnt -mrdrnd -msahf -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsaveopt --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=4096 -mtune=ivybridge "
GENTOO_MIRRORS="https://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"
LANG="en_US"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
MAKEOPTS="-j8"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/bash"
USE="X a52 aac acl acpi alsa amd64 branding bzip2 cairo cdda cdr cli crypt dbus deblob dri dts dvd dvdr elogind emacs encode exif flac fortran gdbm gentoo gif git gpm gtk gui iconv icu ipv6 jpeg lcms libnotify libtirpc mad minizip mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf png policykit ppds qt5 readline sdl seccomp sound spell split-usr sse sse2 ssl startup-notification svg test-rust threads tiff truetype tty-helpers udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xft xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx f16c pclmul popcnt rdrand sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby30" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS




Reproducible: Always

Steps to Reproduce:
1. emerge --ask  dev-util/scap-driver 
2. it fails




actually the same situation as 
https://bugs.gentoo.org/905328 only i got past CONFIG_TRACEPOINTS and r2 patch should get closer to compiling, but it isn't actually compiling
Comment 1 Holger Hoffstätte 2023-05-19 00:49:15 UTC
Jeff, can you please file this upstream in falcosecurity/libs like I did for 6.2 and 6.3? It's unlikely to get fixed upstream until 6.4 is out (they use the arch kernels in their CI), but if you can cook up a patch - probably just an ifdef and #define - we can of course always add it before that.
Comment 2 Holger Hoffstätte 2023-05-19 01:05:27 UTC
The commit that borked this is https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1aaba11da9aa7d7d6b52a74d45b31cac118295a1
so the fix is probably to ifdef https://github.com/falcosecurity/libs/blob/master/driver/main.c#L2915 for kernels >= 6.4 with only one argument.
Comment 3 Holger Hoffstätte 2023-05-19 02:17:24 UTC
I made a fix and submitted it to upstream, as usual. Jeff, can you please test if the version at

https://github.com/hhoffstaette/gentoo/commit/699c738c48a023f68853122e37624e30e7db15ec

works for you? (it should).
It builds with both 6.3.3 and 6.4-rc2 but I cannot really runtime-test with 6.4 at the moment. Once we have confirmed that it works I can create a PR for the gentoo repo.
Comment 4 Holger Hoffstätte 2023-05-19 10:22:21 UTC
The PR has been approved upstream, so I'll create one for Gentoo as well.
Comment 5 Jeff Cliff 2023-05-19 20:54:49 UTC
seems to compile now at least in ~amd64 (?)
Comment 6 Larry the Git Cow gentoo-dev 2023-05-23 03:42:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=06fe6b722da5da5cae5993654f07e65f2cdbe04c

commit 06fe6b722da5da5cae5993654f07e65f2cdbe04c
Author:     Holger Hoffstätte <holger@applied-asynchrony.com>
AuthorDate: 2023-05-19 02:11:52 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-05-23 03:41:50 +0000

    dev-util/scap-driver: fix build on kernel 6.4
    
    Closes: https://bugs.gentoo.org/906709
    Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
    Closes: https://github.com/gentoo/gentoo/pull/31096
    Signed-off-by: Sam James <sam@gentoo.org>

 .../files/0.29.3-fix-kmod-build-on-6.4+.patch      | 33 ++++++++++++
 dev-util/scap-driver/scap-driver-0.29.3-r3.ebuild  | 61 ++++++++++++++++++++++
 2 files changed, 94 insertions(+)