Building the GPIB kernel module fails with the the latest Liunx kernel. Reproducible: Always Steps to Reproduce: 1. `eselect kernel set linux-6.4.2-gentoo` 2. build kernel (e.g. via genkernel) 3. `emerge -1 linux-gpib-modules` (or `emerge @module-rebuild` if already installed) Actual Results: Module compile fails with: /var/tmp/portage/sci-libs/linux-gpib-modules-4.3.5-r2/work/linux-gpib-kernel-4.3.5/drivers/gpib/sys/osinit.c: In function ‘gpib_common_init_module’: ./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/sci-libs/linux-gpib-modules-4.3.5-r2/work/linux-gpib-kernel-4.3.5/drivers/gpib/sys/osinit.c:210:35: note: in expansion of macro ‘THIS_MODULE’ 210 | gpib_class = class_create(THIS_MODULE, "gpib_common"); | ^~~~~~~~~~~ In file included from ./include/linux/device.h:31: ./include/linux/device/class.h:230:54: note: expected ‘const char *’ but argument is of type ‘struct module *’ 230 | struct class * __must_check class_create(const char *name); | ~~~~~~~~~~~~^~~~ /var/tmp/portage/sci-libs/linux-gpib-modules-4.3.5-r2/work/linux-gpib-kernel-4.3.5/drivers/gpib/sys/osinit.c:210:22: error: too many arguments to function ‘class_create’ 210 | gpib_class = class_create(THIS_MODULE, "gpib_common"); | ^~~~~~~~~~~~ ./include/linux/device/class.h:230:29: note: declared here 230 | struct class * __must_check class_create(const char *name); | ^~~~~~~~~~~~ cc1: some warnings being treated as errors Expected Results: Module builds and installs. $ emerge --info linux-gpib-modules Portage 3.0.49 (python 3.10.12-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-12, glibc-2.37-r3, 6.3.4-gentoo-r1 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-6.3.4-gentoo-r1-x86_64-Intel-R-_Core-TM-_i7-8550U_CPU_@_1.80GHz-with-glibc2.37 KiB Mem: 32774640 total, 10343984 free KiB Swap: 2097128 total, 2003176 free Timestamp of repository gentoo: Tue, 11 Jul 2023 06:15:01 +0000 Head commit of repository gentoo: 1ba0f79ca4b26d8c989030a53a00134cd0ece793 Timestamp of repository science: Sun, 09 Jul 2023 19:16:40 +0000 Head commit of repository science: 9c1d9d19047a916820357a291e9296fea6c9005a Head commit of repository sinustrom: c80f6c4d017938e9a923e9c4eb9ea5ab8dc4dfa6 sh bash 5.2_p15-r6 ld GNU ld (Gentoo 2.40 p5) 2.40.0 distcc 3.4 x86_64-pc-linux-gnu [enabled] app-misc/pax-utils: 1.3.7::gentoo app-shells/bash: 5.2_p15-r6::gentoo dev-java/java-config: 2.3.1-r1::gentoo dev-lang/perl: 5.38.0::gentoo dev-lang/python: 3.10.12::gentoo, 3.11.4::gentoo, 3.12.0_beta3::gentoo dev-lang/rust: 1.69.0-r1::gentoo dev-util/cmake: 3.26.4-r1::gentoo dev-util/meson: 1.1.1::gentoo sys-apps/baselayout: 2.14::gentoo sys-apps/sandbox: 2.35::gentoo sys-apps/systemd: 253.5-r1::gentoo sys-devel/autoconf: 2.13-r8::gentoo, 2.71-r6::gentoo sys-devel/automake: 1.16.5-r1::gentoo sys-devel/binutils: 2.40-r5::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/clang: 15.0.7-r3::gentoo, 16.0.6::gentoo sys-devel/gcc: 12.3.1_p20230623::gentoo sys-devel/gcc-config: 2.11::gentoo sys-devel/libtool: 2.4.7-r1::gentoo sys-devel/lld: 15.0.7::gentoo sys-devel/llvm: 15.0.7-r3::gentoo, 16.0.6::gentoo sys-devel/make: 4.4.1-r1::gentoo sys-kernel/linux-headers: 6.4::gentoo (virtual/os-headers) sys-libs/glibc: 2.37-r3::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://barbican.sinustrom.net/gentoo-portage priority: -1000 volatile: False sync-rsync-extra-opts: sync-rsync-verify-jobs: 1 sync-rsync-verify-max-age: 24 sync-rsync-verify-metamanifest: yes science location: /var/db/repos/science sync-type: git sync-uri: https://github.com/gentoo-mirror/science.git masters: gentoo volatile: False sinustrom location: /var/db/repos/sinustrom sync-type: git sync-uri: https://github.com/zpuskas/sinustrom-gentoo-overlay.git masters: gentoo volatile: False sinustrom-test location: /var/db/repos/sinustrom-test masters: gentoo volatile: False Installed sets: @openwrt-prerequisites ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="@FREE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=skylake -mabm -madx -maes -mavx -mavx2 -mbmi -mbmi2 -mclflushopt -mcx16 -mf16c -mfma -mfsgsbase -mfxsr -mlzcnt -mmmx -mmovbe -mpclmul -mpopcnt -mprfchw -mrdrnd -mrdseed -msahf -msgx -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsavec -mxsaveopt -mxsaves --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=8192 -O3 -pipe -frecord-gcc-switches" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /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="-march=skylake -mabm -madx -maes -mavx -mavx2 -mbmi -mbmi2 -mclflushopt -mcx16 -mf16c -mfma -mfsgsbase -mfxsr -mlzcnt -mmmx -mmovbe -mpclmul -mpopcnt -mprfchw -mrdrnd -mrdseed -msahf -msgx -msse -msse2 -msse3 -msse4.1 -msse4.2 -mssse3 -mxsave -mxsavec -mxsaveopt -mxsaves --param=l1-cache-line-size=64 --param=l1-cache-size=32 --param=l2-cache-size=8192 -O3 -pipe -frecord-gcc-switches" 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="-O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live cgroup config-protect-if-modified distcc 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 strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync warn-on-large-env xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="rsync://barbican.sinustrom.net/gentoo-distfiles http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0" LEX="flex" MAKEOPTS="-j80 -l8" 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/zsh" USE="X a52 aac acl acpi activities alsa amd64 avif bash-completion bluetooth branding bzip2 cairo cdda cdr cli crypt cups dbus declarative dri dts dvd dvdr encode exif flac fortran gdbm gif gphoto2 gpm gtk gui hardened heif iconv icu ipv6 jpeg jpeg2k jpegxl kde kwallet lcms libnotify libtirpc lm_sensors lto lzma mad mng mp3 mp4 mpeg multilib ncurses networkmanager nls nptl ogg opencl opengl openmp opus pam pango pcre pdf pipewire plasma png policykit posix ppds pulseaudio qml qt5 readline screencast sdl seccomp smp sound spell split-usr ssl startup-notification svg systemd test-rust threads tiff truetype udev udisks unicode upower usb uxa vaapi vdpau vim-syntax vorbis vulkan wayland webp widgets wifi wxwidgets x264 xattr xcb xft xml xpm xv xvid zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2021" ALSA_CARDS="hda-intel usb-audio" 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="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 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 wacom synaptics joystick" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="x86 BPF" LUA_SINGLE_TARGET="lua5-4" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" QEMU_SOFTMMU_TARGETS="x86_64 arm aarch64" QEMU_USER_TARGETS="x86_64 arm aarch64" RUBY_TARGETS="ruby30 ruby31" SANE_BACKENDS="plustek genesys pixma" VIDEO_CARDS="intel i965" 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 ================================================================= Package Settings ================================================================= sci-libs/linux-gpib-modules-4.3.5-r2::gentoo was built with the following: USE="strip -debug -dist-kernel -modules-sign" ABI_X86="(64)" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live cgroup config-protect-if-modified distcc distlocks ebuild-locks fail-clean 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 strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync warn-on-large-env xattr"
Created attachment 865381 [details] build log
FWIW, our recommendation remains that if using out-of-tree modules, LTS is best.
(In reply to Sam James from comment #2) > FWIW, our recommendation remains that if using out-of-tree modules, LTS is > best. Someone has to test these things too ;) Anyhow, I found the change that breaks the module: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dcfbb67e48a2becfce7990386e985b9c45098ee5 This change rolled out first in the 6.4 kernel version.
Fair enough! I just wanted to say in case you're suffering. Being brave is fine and welcome :)
There's an upstream patch that may fix your problem: https://sourceforge.net/p/linux-gpib/code/commit_browser I somehow can't seem to make a link to the specific commit, but its the latest one r2053.
Created attachment 865387 [details, diff] Quick and dirty patch for 6.4.X kernel series This is a quick and dirty patch to verify that the module builds and works. I've also tested it's functionality using a GPIB connected instrument using Sigrok. Naturally the code should be updated to be conditional on the kernel version before committing it to the portage tree.
Ah yes, the upstream commit mentioned by Andrew also contains the aforementioned kernel version check! Next time I'll look at upstream commits first before bisecting the Linux kernel and coming up with a solution myself. :P
Created attachment 865389 [details, diff] Upstream's 6.4 kernel patch I'v got upstream's https://sourceforge.net/p/linux-gpib/code/2053/ commit as a patch and I've tested it with a against 6.4.2 kernel. It works as expected.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cf2e4eb2cad25a7b4647faebe6509c1033b49ba8 commit cf2e4eb2cad25a7b4647faebe6509c1033b49ba8 Author: Andrew Ammerlaan <andrewammerlaan@gentoo.org> AuthorDate: 2023-07-12 12:02:13 +0000 Commit: Andrew Ammerlaan <andrewammerlaan@gentoo.org> CommitDate: 2023-07-12 12:04:06 +0000 sci-libs/linux-gpib-modules: add small patch for kernel 6.4 Closes: https://bugs.gentoo.org/910230 Signed-off-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org> .../linux-gpib-modules-4.3.4-kernel-6.4.patch | 27 ++++++++++++++++++++++ ...2.ebuild => linux-gpib-modules-4.3.5-r3.ebuild} | 2 ++ 2 files changed, 29 insertions(+)