Public bug reported:

This package just landed on 22.04 (and I think also on 24.04):
ii  dkms           1:3.2.1-1    all          Dynamic Kernel Module System (DKMS)

On a 22.04 machine, Nvidia kernel modules fail to build with this version, even
though the same module against the same kernel version did build with the 
previous dkms.  Downgrading to dkms=2.8.7-2ubuntu2.2 allows the module to build 
again.

This is because:
 1. The new version of dkms fails to parse the compiler version out of kernel 
config
 2. Current kernels for jammy are compiled with gcc-12
 3. The default compiler on jammy is gcc-11
 4. The kernel compiler flags include -ftrivial-auto-var-init=zero which is not 
supported in gcc-11.

This is difficult to work around, because setting CC has no effect (the
dkms script deliberately unsets it), and update-alternatives does not
admit /usr/bin/gcc-12 as a valid alternative for 'cc'.

This bug doesn't currently affect noble only because the default
compiler is the same one that was used to compile the kernel.

Why dkms fails to extract the compiler version - it's down to this sed
expression:

cc=$(sed -n 's|^CONFIG_CC_VERSION_TEXT="\([^ ]*\) .*"|\1|p'
"${kernel_config}")

Version 2.8.7 applies this to '.config' in the kernel build dir, while
version 3.2.1 applies it to 'include/config/auto.conf'.  But we will see
that the quotes that that expression expects are not present in the
latter config file.

$ grep CONFIG_CC_VERSION_TEXT= /lib/modules/6.8.0-59-generic/build/.config
CONFIG_CC_VERSION_TEXT="x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 
12.3.0"

$ grep CONFIG_CC_VERSION_TEXT= 
/lib/modules/6.8.0-59-generic/build/include/config/auto.conf
CONFIG_CC_VERSION_TEXT=x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 
12.3.0

** Affects: dkms (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2112114

Title:
  dkms 3.2.1 does not correctly set kernel CC version

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/dkms/+bug/2112114/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to