Re: dkms: Build with an alternative like compiler rather than gcc

2018-07-09 Thread Sedat Dilek
On Mon, Jul 9, 2018 at 4:43 PM,   wrote:
>> -Original Message-
>> From: Sedat Dilek [mailto:sedat.di...@gmail.com]
>> Sent: Monday, July 9, 2018 9:41 AM
>> To: Limonciello, Mario
>> Cc: p...@hungry.com; da...@debian.org; a...@debian.org;
>> iucul...@debian.org; pkg-dkms-ma...@lists.alioth.debian.org; debian-
>> ker...@lists.debian.org
>> Subject: Re: dkms: Build with an alternative like compiler rather than gcc
>>
>> On Mon, Jul 9, 2018 at 4:37 PM,   wrote:
>> >> -Original Message-
>> >> From: Petter Reinholdtsen [mailto:p...@hungry.com]
>> >> Sent: Monday, July 9, 2018 9:32 AM
>> >> To: sedat.di...@gmail.com; David Paleino; Aron Xu; Limonciello, Mario;
>> Giuseppe
>> >> Iuculano
>> >> Cc: Dynamic Kernel Modules Support Team; debian-kernel@lists.debian.org
>> >> Subject: Re: dkms: Build with an alternative like compiler rather than gcc
>> >>
>> >>
>> >> [Sedat Dilek]
>> >> > 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?
>> >>
>> >> Perhaps you should use dpkg-divert to ensure your replaced gcc is not
>> >> lost in a future package upgrade?
>> >>
>> >> The DKMS team in Debian need active members.  I'm not one of them. :(
>> >>
>> >> --
>> >
>> > I think this is an upstream problem not at all specific to Debian's 
>> > implementation.
>> > I would recommend to bring this discussion upstream to get it fixed there.
>> >
>> > I believe DKMS unsets CC before starting build, but maybe that's wrong to 
>> > do
>> > in this instance.
>> >
>>
>> Personally, I do not think it is an upstream problem.
>> Unsetting CC before DKMS starts the build would explain the 
>> behaviour/handling.
>>
>

[ Removing wrong debian's dkms maintainer list ]

> How exactly does clang get used by kernel build?  It's by setting CC variable 
> right?
> You can try to remove this line to see if it fixes the problem (it should).
> https://github.com/dell/dkms/blob/master/dkms#L3515
>

I have an own script which uses bindeb-pkg make-target from Linus tree.

OK, that line looks like the culprit.

Anyway, I need a flexible handling when using different compilers - for me.

> The question would be where that variable should be ignored and where it 
> shouldn't.
> Which I believe is an upstream discussion not a Debian discussion.

I agree.

- sed@ -



RE: dkms: Build with an alternative like compiler rather than gcc

2018-07-09 Thread Mario.Limonciello
> -Original Message-
> From: Petter Reinholdtsen [mailto:p...@hungry.com]
> Sent: Monday, July 9, 2018 9:32 AM
> To: sedat.di...@gmail.com; David Paleino; Aron Xu; Limonciello, Mario; 
> Giuseppe
> Iuculano
> Cc: Dynamic Kernel Modules Support Team; debian-kernel@lists.debian.org
> Subject: Re: dkms: Build with an alternative like compiler rather than gcc
> 
> 
> [Sedat Dilek]
> > 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?
> 
> Perhaps you should use dpkg-divert to ensure your replaced gcc is not
> lost in a future package upgrade?
> 
> The DKMS team in Debian need active members.  I'm not one of them. :(
> 
> --

I think this is an upstream problem not at all specific to Debian's 
implementation.
I would recommend to bring this discussion upstream to get it fixed there.

I believe DKMS unsets CC before starting build, but maybe that's wrong to do
in this instance.

Thanks,



RE: dkms: Build with an alternative like compiler rather than gcc

2018-07-09 Thread Mario.Limonciello
> -Original Message-
> From: Sedat Dilek [mailto:sedat.di...@gmail.com]
> Sent: Monday, July 9, 2018 9:41 AM
> To: Limonciello, Mario
> Cc: p...@hungry.com; da...@debian.org; a...@debian.org;
> iucul...@debian.org; pkg-dkms-ma...@lists.alioth.debian.org; debian-
> ker...@lists.debian.org
> Subject: Re: dkms: Build with an alternative like compiler rather than gcc
> 
> On Mon, Jul 9, 2018 at 4:37 PM,   wrote:
> >> -Original Message-
> >> From: Petter Reinholdtsen [mailto:p...@hungry.com]
> >> Sent: Monday, July 9, 2018 9:32 AM
> >> To: sedat.di...@gmail.com; David Paleino; Aron Xu; Limonciello, Mario;
> Giuseppe
> >> Iuculano
> >> Cc: Dynamic Kernel Modules Support Team; debian-kernel@lists.debian.org
> >> Subject: Re: dkms: Build with an alternative like compiler rather than gcc
> >>
> >>
> >> [Sedat Dilek]
> >> > 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?
> >>
> >> Perhaps you should use dpkg-divert to ensure your replaced gcc is not
> >> lost in a future package upgrade?
> >>
> >> The DKMS team in Debian need active members.  I'm not one of them. :(
> >>
> >> --
> >
> > I think this is an upstream problem not at all specific to Debian's 
> > implementation.
> > I would recommend to bring this discussion upstream to get it fixed there.
> >
> > I believe DKMS unsets CC before starting build, but maybe that's wrong to do
> > in this instance.
> >
> 
> Personally, I do not think it is an upstream problem.
> Unsetting CC before DKMS starts the build would explain the 
> behaviour/handling.
> 

How exactly does clang get used by kernel build?  It's by setting CC variable 
right?
You can try to remove this line to see if it fixes the problem (it should).
https://github.com/dell/dkms/blob/master/dkms#L3515

The question would be where that variable should be ignored and where it 
shouldn't.
Which I believe is an upstream discussion not a Debian discussion.


Re: dkms: Build with an alternative like compiler rather than gcc

2018-07-09 Thread Sedat Dilek
On Mon, Jul 9, 2018 at 4:37 PM,   wrote:
>> -Original Message-
>> From: Petter Reinholdtsen [mailto:p...@hungry.com]
>> Sent: Monday, July 9, 2018 9:32 AM
>> To: sedat.di...@gmail.com; David Paleino; Aron Xu; Limonciello, Mario; 
>> Giuseppe
>> Iuculano
>> Cc: Dynamic Kernel Modules Support Team; debian-kernel@lists.debian.org
>> Subject: Re: dkms: Build with an alternative like compiler rather than gcc
>>
>>
>> [Sedat Dilek]
>> > 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?
>>
>> Perhaps you should use dpkg-divert to ensure your replaced gcc is not
>> lost in a future package upgrade?
>>
>> The DKMS team in Debian need active members.  I'm not one of them. :(
>>
>> --
>
> I think this is an upstream problem not at all specific to Debian's 
> implementation.
> I would recommend to bring this discussion upstream to get it fixed there.
>
> I believe DKMS unsets CC before starting build, but maybe that's wrong to do
> in this instance.
>

Personally, I do not think it is an upstream problem.
Unsetting CC before DKMS starts the build would explain the behaviour/handling.

- sed@ -



Re: dkms: Build with an alternative like compiler rather than gcc

2018-07-09 Thread Sedat Dilek
On Mon, Jul 9, 2018 at 4:31 PM, Petter Reinholdtsen  wrote:
>
> [Sedat Dilek]
>> 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?
>
> Perhaps you should use dpkg-divert to ensure your replaced gcc is not
> lost in a future package upgrade?
>
> The DKMS team in Debian need active members.  I'm not one of them. :(
>

I am thinking of using mycompiler as an cc alternative, the same with
c++ and cpp.
The wrapper-script(s) let me pass compiler-options, too.
So this is very flexible.

Active members... the alioth email-adress in the dsc-file seems no longer valid.

Thanks for the response.

- sed@ -



Re: dkms: Build with an alternative like compiler rather than gcc

2018-07-09 Thread Petter Reinholdtsen


[Sedat Dilek]
> 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?

Perhaps you should use dpkg-divert to ensure your replaced gcc is not
lost in a future package upgrade?

The DKMS team in Debian need active members.  I'm not one of them. :(

-- 
Happy hacking
Petter Reinholdtsen



dkms: Build with an alternative like compiler rather than gcc

2018-07-09 Thread Sedat Dilek
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