mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gregory Rose <gvrose8192@gmail.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dev@openvswitch.org, dsahern@gmail.com
Subject: Re: [PATCH] kbuild: Include external modules compile flags
Date: Tue, 28 Jan 2020 07:37:58 -0800	[thread overview]
Message-ID: <f6ffa0d0-8214-8fc0-4fe9-4b70a1581d3e@gmail.com> (raw)
In-Reply-To: <CAK7LNAQyh9CFgKd1DtAPFW8DuHNp1gn8YABuP8-LsF=hHK2DFw@mail.gmail.com>

On 1/27/2020 7:35 PM, Masahiro Yamada wrote:
> On Tue, Jan 28, 2020 at 6:50 AM Greg Rose <gvrose8192@gmail.com> wrote:
>> Since this commit:
>> 'commit 9b9a3f20cbe0 ("kbuild: split final module linking out into Makefile.modfinal")'
>> at least one out-of-tree external kernel module build fails
>> during the modfinal make phase because Makefile.modfinal does
>> not include the ccflags-y variable from the exernal module's Kbuild.
> ccflags-y is passed only for compiling C files in that directory.
>
> It is not used for compiling *.mod.c
> This is true for both in-kernel and external modules.
>
> So, ccflags-y is not a good choice
> for passing such flags that should be globally effective.
>
>
> Maybe, KCFLAGS should work.
>
>
> module:
>         $(MAKE) KCFLAGS=...  M=$(PWD) -C /lib/modules/$(uname -r)/build modules
>

Thanks,

I'll see if I can get that to work.

- Greg


>
>> Make sure to include the external kernel module's Kbuild so that the
>> necessary command line flags from the external module are set.
>>
>> Reported-by: David Ahern <dsahern@gmail.com>
>> CC: Masahiro Yamada <yamada.masahiro@socionext.com>
>> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
>> ---
>>   scripts/Makefile.modfinal | 4 ++++
>>   1 file changed, 4 insertions(+)
>>
>> diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal
>> index 411c1e60..a645ba6 100644
>> --- a/scripts/Makefile.modfinal
>> +++ b/scripts/Makefile.modfinal
>> @@ -21,6 +21,10 @@ __modfinal: $(modules)
>>   modname = $(notdir $(@:.mod.o=))
>>   part-of-module = y
>>
>> +# Include the module's Makefile to find KBUILD_EXTRA_SYMBOLS
>> +include $(if $(wildcard $(KBUILD_EXTMOD)/Kbuild), \
>> +             $(KBUILD_EXTMOD)/Kbuild)
>> +
>>   quiet_cmd_cc_o_c = CC [M]  $@
>>         cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $<
>>
>> --
>> 1.8.3.1
>>
>


  reply	other threads:[~2020-01-28 15:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27 21:50 Greg Rose
2020-01-28  3:35 ` Masahiro Yamada
2020-01-28 15:37   ` Gregory Rose [this message]
2020-01-29 18:09     ` Gregory Rose
2020-02-02  6:07       ` Masahiro Yamada
2020-02-04 22:02         ` Gregory Rose
2020-02-05 22:48         ` Gregory Rose

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f6ffa0d0-8214-8fc0-4fe9-4b70a1581d3e@gmail.com \
    --to=gvrose8192@gmail.com \
    --cc=dev@openvswitch.org \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®