Compiling a kernel module on Leap 15.4
I successfully run OpenVPN 2.6.1 with DCO kernel module on Tumbleweed. Now I wanted to compile the DCO kernel module for the current Kernel:stable:Backport kernel on Leap 15.4. Unfortunately this fails. In a Fedora forum they said, that the C compiler for the module must match the C compiler for the kernel. The warning says the same. This is probably not the case for Leap 15.3 GCC (7.5.0) and the Kernel:stable:Backport GCC. How I can solve this? I already installed gcc11, but export CC=/usr/bin/gcc-11 does not change anything. myuser@mybox:/var/soft/ovpn-dco> uname -r 6.2.2-lp154.4.g4752516-default myuser@mybox:/var/soft/ovpn-dco> git remote -v origin https://github.com/OpenVPN/ovpn-dco.git (fetch) origin https://github.com/OpenVPN/ovpn-dco.git (push) myuser@mybox:/var/soft/ovpn-dco> export CC=/usr/bin/gcc-11 myuser@mybox:/var/soft/ovpn-dco> make /var/soft/ovpn-dco/gen-compat-autoconf.sh /var/soft/ovpn-dco/compat-autoconf.h make -C /lib/modules/6.2.2-lp154.4.g4752516-default/build M=/var/soft/ovpn-dco PWD=/var/soft/ovpn-dco REVISION=0.1.20230206 CONFIG_OVPN_DCO=m INSTALL_MOD_DIR=updates/ modules make[1]: Entering directory '/usr/src/linux-6.2.2-lp154.4.g4752516-obj/x86_64/default' warning: the compiler differs from the one used to build the kernel The kernel was built by: gcc (SUSE Linux) 11.3.0 You are using: gcc (SUSE Linux) 7.5.0 CC [M] /var/soft/ovpn-dco/drivers/net/ovpn-dco/main.o gcc: error: unrecognized command line option ‘-mharden-sls=all’; did you mean ‘-mhard-float’? make[3]: *** [/usr/src/linux-6.2.2-lp154.4.g4752516/scripts/Makefile.build:253: /var/soft/ovpn-dco/drivers/net/ovpn-dco/main.o] Error 1 make[2]: *** [/usr/src/linux-6.2.2-lp154.4.g4752516/scripts/Makefile.build:505: /var/soft/ovpn-dco/drivers/net/ovpn-dco] Error 2 make[1]: *** [../../../linux-6.2.2-lp154.4.g4752516/Makefile:2036: /var/soft/ovpn-dco] Error 2 make[1]: Leaving directory '/usr/src/linux-6.2.2-lp154.4.g4752516-obj/x86_64/default' make: *** [Makefile:52: all] Error 2 Björn
On Wed, 15 Mar 2023, 23:30:10 +0100, Bjoern Voigt wrote:
I successfully run OpenVPN 2.6.1 with DCO kernel module on Tumbleweed.
Now I wanted to compile the DCO kernel module for the current Kernel:stable:Backport kernel on Leap 15.4.
Unfortunately this fails. In a Fedora forum they said, that the C compiler for the module must match the C compiler for the kernel. The warning says the same.
This is probably not the case for Leap 15.3 GCC (7.5.0) and the Kernel:stable:Backport GCC. How I can solve this?
I already installed gcc11, but export CC=/usr/bin/gcc-11 does not change anything.
From "man make": -e, --environment-overrides Give variables taken from the environment precedence over variables from make- files. Either you run "make -e" or pass the definition as an additional argument as in "make CC=/usr/bin/gcc-11" HTH, cheers. l8er manfred
myuser@mybox:/var/soft/ovpn-dco> uname -r 6.2.2-lp154.4.g4752516-default myuser@mybox:/var/soft/ovpn-dco> git remote -v origin https://github.com/OpenVPN/ovpn-dco.git (fetch) origin https://github.com/OpenVPN/ovpn-dco.git (push) myuser@mybox:/var/soft/ovpn-dco> export CC=/usr/bin/gcc-11 myuser@mybox:/var/soft/ovpn-dco> make /var/soft/ovpn-dco/gen-compat-autoconf.sh /var/soft/ovpn-dco/compat-autoconf.h make -C /lib/modules/6.2.2-lp154.4.g4752516-default/build M=/var/soft/ovpn-dco PWD=/var/soft/ovpn-dco REVISION=0.1.20230206 CONFIG_OVPN_DCO=m INSTALL_MOD_DIR=updates/ modules make[1]: Entering directory '/usr/src/linux-6.2.2-lp154.4.g4752516-obj/x86_64/default' warning: the compiler differs from the one used to build the kernel The kernel was built by: gcc (SUSE Linux) 11.3.0 You are using: gcc (SUSE Linux) 7.5.0 CC [M] /var/soft/ovpn-dco/drivers/net/ovpn-dco/main.o gcc: error: unrecognized command line option ‘-mharden-sls=all’; did you mean ‘-mhard-float’? make[3]: *** [/usr/src/linux-6.2.2-lp154.4.g4752516/scripts/Makefile.build:253: /var/soft/ovpn-dco/drivers/net/ovpn-dco/main.o] Error 1 make[2]: *** [/usr/src/linux-6.2.2-lp154.4.g4752516/scripts/Makefile.build:505: /var/soft/ovpn-dco/drivers/net/ovpn-dco] Error 2 make[1]: *** [../../../linux-6.2.2-lp154.4.g4752516/Makefile:2036: /var/soft/ovpn-dco] Error 2 make[1]: Leaving directory '/usr/src/linux-6.2.2-lp154.4.g4752516-obj/x86_64/default' make: *** [Makefile:52: all] Error 2
Björn
participants (2)
-
Bjoern Voigt
-
Manfred Hollstein