Re: [PATCH v2 2/5] tools include: add dis-asm-compat.h to handle version differences

From: Quentin Monnet
Date: Mon Jul 18 2022 - 04:58:58 EST


On 15/07/2022 20:39, Andres Freund wrote:
> Hi,
>
> On 2022-07-05 14:44:07 +0100, Quentin Monnet wrote:
>>> diff --git a/tools/include/tools/dis-asm-compat.h b/tools/include/tools/dis-asm-compat.h
>>> new file mode 100644
>>> index 000000000000..d1d003ee3e2f
>>> --- /dev/null
>>> +++ b/tools/include/tools/dis-asm-compat.h
>>> @@ -0,0 +1,53 @@
>>> +/* SPDX-License-Identifier: GPL-2.0 */
>>
>> Any chance you could contribute this wrapper as dual-licenced
>> (GPL-2.0-only OR BSD-2-Clause), for better compatibility with the rest
>> of bpftool's code?
>
> Happy to do that from my end - however, right now it includes
> linux/compiler.h, which is GPL-2.0. I don't know what the policy around that
> is - is it just a statement about the licence of the header itself, or does it
> effectively include its dependencies?

My understanding is that programs using a GPL header need to be released
as GPL, but I don't believe they have to be only GPL, the dual-license
should cover the requirements. If someone wanted to redistribute the
code from the new header dis-asm-compat.h as BSD only, they would
probably have to get rid of the GPL-only dependencies though. But again,
this is only my understanding, and “I am not a lawyer”.

>
> FWIW, linux/compiler.h is also included from bpftool.
>
> If preferrable, I can replace the linux/compiler.h include by just using
> __attribute__((__unused__)) directly or by using a (void) cast to avoid the
> unused-parameter pedantry.

If compiler.h is just needed for the “unused” attribute, I wouldn't mind
doing that.

Thanks,
Quentin