Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #61368

dkms: Build with an alternative like compiler rather than gcc

From Sedat Dilek <sedat.dilek@gmail.com>
Newsgroups linux.debian.kernel
Subject dkms: Build with an alternative like compiler rather than gcc
Date 2018-07-09 16:10 +0200
Message-ID <w9F1w-2WQ-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


Hi,

I am experimenting with clang to compile an upstream Linux kernel
v4.14.y (here: y=54).
For this I use bindeb-pkg make-target from Linus upstream.

After installing the generated linux-headers and linux-image amd64
packages, the dkms kernel-modules were built with gcc-7 which defaults
to gcc.
As a result acpi-call and virtualbox dkms modules do not load (see [1]).

As a workaround I have symlinked my mycompiler wrapper-script to /usr/bin/gcc.
That works.

What is the recommended way to do this correctly?
Is there an CC option for dkms.conf?
Use the update-alternatives system for configuring/installing clang as
an cc-alternative?

Thanks.

Regards,
- Sedat -

[1] https://lkml.org/lkml/2018/6/1/724
[2] https://stackoverflow.com/questions/7832892/how-to-change-the-default-gcc-compiler-in-ubuntu

P.S.: Some instructions and informations which might be helpful

root@iniza# LANG=C update-alternatives --display cc
cc - auto mode
  link best version is /usr/bin/gcc
  link currently points to /usr/bin/gcc
  link cc is /usr/bin/cc
/usr/bin/gcc - priority 20

root# dpkg --purge tp-smapi-dkms <--- XXX: Does not work with Lenovo
ThinkPad T470

root# dkms status -k 4.14.54-1-iniza-llvmlinux
acpi-call, 1.1.0, 4.14.54-1-iniza-llvmlinux, x86_64: installed
virtualbox, 5.2.10, 4.14.54-1-iniza-llvmlinux, x86_64: installed

root# dkms remove acpi-call -v 1.1.0 -k 4.14.54-1-iniza-llvmlinux
root# dkms remove virtualbox -v 5.2.10 -k 4.14.54-1-iniza-llvmlinux

root# cat /usr/bin/mycompiler
#!/bin/bash

ccache clang-7 "$@"

root# cd /usr/bin ; ln -sf mycompiler gcc <--- XXX: Workaround

root# LANG=C dkms install acpi-call -v 1.1.0 -k 4.14.54-1-iniza-llvmlinux
root# LANG=C dkms install virtualbox -v 5.2.10 -k 4.14.54-1-iniza-llvmlinux

root# cd /usr/bin ; ln -sf gcc-7 gcc <--- XXX: System default

Back to linux.debian.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

dkms: Build with an alternative like compiler rather than gcc Sedat Dilek <sedat.dilek@gmail.com> - 2018-07-09 16:10 +0200
  Re: dkms: Build with an alternative like compiler rather than gcc Petter Reinholdtsen <pere@hungry.com> - 2018-07-09 16:40 +0200
    Re: dkms: Build with an alternative like compiler rather than gcc Sedat Dilek <sedat.dilek@gmail.com> - 2018-07-09 17:00 +0200
    Re: dkms: Build with an alternative like compiler rather than gcc Sedat Dilek <sedat.dilek@gmail.com> - 2018-07-09 17:00 +0200
      RE: dkms: Build with an alternative like compiler rather than gcc <Mario.Limonciello@dell.com> - 2018-07-09 17:10 +0200
        Re: dkms: Build with an alternative like compiler rather than gcc Sedat Dilek <sedat.dilek@gmail.com> - 2018-07-09 17:10 +0200
    RE: dkms: Build with an alternative like compiler rather than gcc <Mario.Limonciello@dell.com> - 2018-07-09 17:10 +0200

csiph-web