Unable to build dkms package for nvidia driver
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nvidia-graphics-drivers-460-server (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
There seems to be a mismatch between the compiler I have installed and the compiler that the build script is expecting; my build log is full of:
make[2]: *** [scripts/
make[2]: *** [scripts/
make[2]: *** [scripts/
make[2]: *** [scripts/
error: unknown warning option '-Wno-unused-
error: unknown warning option '-Wno-unused-
error: unknown warning option '-Wno-unused-
make[2]: *** [scripts/
make[2]: *** [scripts/
error: unknown warning option '-Wno-unused-
make[2]: *** [scripts/
make[2]: *** [scripts/
error: unknown warning option '-Wno-unused-
error: unknown warning option '-Wno-unused-
make[2]: *** [scripts/
make[2]: *** [scripts/
It looks like the problem may be that I have both clang and gcc installed:
jshagam@feldspar:~$ gcc --version
gcc (Ubuntu 9.3.0-17ubuntu1
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
jshagam@feldspar:~$ cc --version
clang version 10.0.0-4ubuntu1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
The nvidia-dkms Makefile should probably be fixed to use gcc instead of cc, since these appear to be gcc-specific compiler flags.
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: nvidia-
ProcVersionSign
Uname: Linux 5.8.0-50-generic x86_64
ApportVersion: 2.20.11-
Architecture: amd64
CasperMD5CheckR
Date: Tue Jun 1 10:40:04 2021
InstallationDate: Installed on 2021-03-25 (67 days ago)
InstallationMedia: Kubuntu 20.04.2.0 LTS "Focal Fossa" - Release amd64 (20210209.1)
ProcEnviron:
TERM=xterm-
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: nvidia-
UpgradeStatus: No upgrade log present (probably fresh install)
As a workaround, I was able to use update-alternatives to redirect cc to gcc, and then redirect it back to clang after I was done.