Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4225967ybl; Mon, 27 Jan 2020 19:38:02 -0800 (PST) X-Google-Smtp-Source: APXvYqy8dsmZMUymGzwCUPR/TIpMzJm13/n77yyoP9oaW4vuMMuMheKZV/+Dx16zvA1ZgubTasGa X-Received: by 2002:a9d:65cb:: with SMTP id z11mr14183006oth.348.1580182682207; Mon, 27 Jan 2020 19:38:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580182682; cv=none; d=google.com; s=arc-20160816; b=Ple90f42PUaG0hxObhlzpqSZYpiOJy18IRoq8ofslW+rkOHXPr7Nj6D6wzjhYj8A9N 6BdHYe5UyRKbhA7c6jnjc9GOqO/QMreSyEwpGK3xWNMRVCYsDt0Ke5lcCGp+08aeoliQ y8bQ2NcqjQw2ZyaqRyMrvPgiqt4uUGc6jPpRiPhxL32gKpS9lhOUWvGMBjTVM8Q3++2f XV0nVqJVZYJRqg3iGoYqkZPhq8UNsFQHwZGAXzrdSHwWka1gqYl9q2A34tAqgcInDHrG NIsYnZAQFitzH5OhBFtRxJzWiYacu31BwlLtX+a5MtG80Wg+EL9FvwE/q7y5T5xUHqA+ JO+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature:dkim-filter; bh=eC+RalRcYJOsb2glSpPrfoEwl78XbNMsbjScipj7Ivs=; b=glYWgOaWwMUHs384sSUzNQCC9k7bw79CRGzeE6EOmCweJqNQKeue5YI9CEgCIVu9IT +0CV6hI5d4ncgJIyujXWXfZean1ME7weU9Mmwhf7BbJkTnF60nyjFBrZMot9I8v3eFKm KChP74sDiLKgxGUkU3CP2d7byq/9ZS8brx+btVcfGjlV3bARQym1VqnfzcpCB3kEkSu0 EUkoVCFph1jH3QWsrLRKbYkFL4OzXB7YuGfUQmO1y3qAPzWhIMn5aS91t/7nNTRnnVCk k+1qyoxhT4b/MHxWYQBQqweJLqPQ95pnjUlRfG3J4GO17maMTk9PLkLRbunZL40Sbw2L CxbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=0LolEl4W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f22si8367642otp.145.2020.01.27.19.37.42; Mon, 27 Jan 2020 19:38:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=0LolEl4W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726293AbgA1DgX (ORCPT + 99 others); Mon, 27 Jan 2020 22:36:23 -0500 Received: from conssluserg-05.nifty.com ([210.131.2.90]:58105 "EHLO conssluserg-05.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726080AbgA1DgX (ORCPT ); Mon, 27 Jan 2020 22:36:23 -0500 Received: from mail-vs1-f49.google.com (mail-vs1-f49.google.com [209.85.217.49]) (authenticated) by conssluserg-05.nifty.com with ESMTP id 00S3a8iG024614 for ; Tue, 28 Jan 2020 12:36:09 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-05.nifty.com 00S3a8iG024614 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1580182569; bh=eC+RalRcYJOsb2glSpPrfoEwl78XbNMsbjScipj7Ivs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=0LolEl4WWFYBzSGOLD27bxv78O4VaTwyzi4qqtQnyGmXKjjjzrTJ6+k1ZHO9CbH0Q dshQf3cw99U8eM0ZxNg1rQbTMSHHFgngER3YtMekPV1yj12dcNh1g3JY9n5F5As3Pg IOWhv8qhsw5gwvo2jFQ9y2ddY97NF01QTKfj9kao58zMsXc41FqxvROAFgl5FLLEqS 4K06rni3rb7eANDFw7MSPEex34KRtW1gyaEsErDyhGbjjO7KXnOdUjU2lyuAWYKJl2 SpnW78dkNPv66fzgx2Y0/jVxW7jOft2q8C8u2N4zjUBv1cLFMBtnct3UajpLUHBTg0 86Txb9RXJdv4Q== X-Nifty-SrcIP: [209.85.217.49] Received: by mail-vs1-f49.google.com with SMTP id g23so7197165vsr.7 for ; Mon, 27 Jan 2020 19:36:09 -0800 (PST) X-Gm-Message-State: APjAAAVnTAzUgLLkyDoZdXVabV8ZveHr23V+w7uALqMfxwoTjrhHLWe8 WXeOpcqq9R+PnHOmHa3iV9oGy3oL1gjEZWYuBKk= X-Received: by 2002:a67:6485:: with SMTP id y127mr6276228vsb.54.1580182568057; Mon, 27 Jan 2020 19:36:08 -0800 (PST) MIME-Version: 1.0 References: <1580161806-8037-1-git-send-email-gvrose8192@gmail.com> In-Reply-To: <1580161806-8037-1-git-send-email-gvrose8192@gmail.com> From: Masahiro Yamada Date: Tue, 28 Jan 2020 12:35:32 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: Include external modules compile flags To: Greg Rose Cc: Linux Kernel Mailing List , dev@openvswitch.org, dsahern@gmail.com Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 28, 2020 at 6:50 AM Greg Rose 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 > 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 > CC: Masahiro Yamada > Signed-off-by: Greg Rose > --- > 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 > -- Best Regards Masahiro Yamada