Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1110724ybl; Wed, 28 Aug 2019 09:46:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqyoiAG4xs26435CJHC3RSssfOvbP2C+qiwDKjXpJKhYQWdKoEwjgdG9Wj6q5D22ZLoMIHhJ X-Received: by 2002:a63:f118:: with SMTP id f24mr4392247pgi.322.1567010800366; Wed, 28 Aug 2019 09:46:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567010800; cv=none; d=google.com; s=arc-20160816; b=PLsv6vhrGmHDOWVVTJFgVSruXfHZ7UcnMQ1vjOhq1Q8wMNzpCUws5/0L64la26BanM 8n2835kzDsgc0R6KjXig3Paa7FlrFgUbSYiI1M3cvNFS7gc/eR/XEfkL3J3H0goxN4K8 BVwhFAOQkAx/Ti+ykinaYPRenoMk7bez6Ecqe317bUbPkbzkJ8rPOtNjWpvi9SZ729hN IzEi/Poej8RfBDxWS3h/NgHmGq7v2a4ntPFy6qTasn0iYfgOjx7BVnA0QNv31oINwksH R7tMlfKVbEWN6duEgr5fMRKk2A3mXTjeinbGcX1aY8qXosElMFIejhSJELuE8+2JKxpH hsng== 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=BNuxKHSLybVA12f+ywCNukk32ucTqOKdIKBZ/5+ichk=; b=L37vdRPyXEYC0+zSXRtuTrUSk04nWn5S0yFqDVsnousm3qlmVGUPqmHFc547xeyQM/ sYFdkkSvSjd3J85VpxV//738TRb2PWi+0t1J6BelqOvda1da9ZL7dA7aqhXKv1T1ESHW DvodUi89CM7O/uYwzzw8EafXHPzH+/cCzycxt7mGtPv4hGTvsN+izSpCH0nQ9IRmpU93 6+L6imy3oHi5IgWlzP37bc9B+w+q1JyAM/XKDzcXUbtT5cFP1vzpSE9fwfnA4odRghZr +2GhwSdADaEVHFcPvvR+nY4nbiS9WZqZsw2aUSkUp/0AH6hlaRGbSV+4vPBOB+snbgdm aPkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=QPb03lPd; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h15si2265422plr.87.2019.08.28.09.46.23; Wed, 28 Aug 2019 09:46:40 -0700 (PDT) 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=QPb03lPd; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727005AbfH1QpR (ORCPT + 99 others); Wed, 28 Aug 2019 12:45:17 -0400 Received: from conssluserg-01.nifty.com ([210.131.2.80]:30370 "EHLO conssluserg-01.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726515AbfH1QpQ (ORCPT ); Wed, 28 Aug 2019 12:45:16 -0400 Received: from mail-vs1-f46.google.com (mail-vs1-f46.google.com [209.85.217.46]) (authenticated) by conssluserg-01.nifty.com with ESMTP id x7SGjBde015936; Thu, 29 Aug 2019 01:45:11 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conssluserg-01.nifty.com x7SGjBde015936 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1567010712; bh=BNuxKHSLybVA12f+ywCNukk32ucTqOKdIKBZ/5+ichk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=QPb03lPdO0QCthf2wUwmX6jYBnrxx4FJhio6VjpnItRPD4U2b+pWb9+DVWhFuIY0o 65LUSFJArDYHuvLvGlz5QQKDwIJyjVqFD807T1j6uIrPpthMRqoBV9S0JcBin/X2mS sclonJv730gXQdZ+tWtEs0RgH0m88TkT6SX46AgaeyAHXKmIVwUOlnLQupvjxc6qtr cOsnI5+lHy618NzDoghuHEohLpTNNi9NuxO2+WzoxFsytiG6zQDAHxoLobrFqvrrB5 brU4NdoTdz8k2FF5K+ZhzSI6NcOPlwOueS3Ax9JpJbTG0JbE/2EfsJ+ARxYcY0qEur sQJSPA+wt9DDQ== X-Nifty-SrcIP: [209.85.217.46] Received: by mail-vs1-f46.google.com with SMTP id q16so437083vsm.2; Wed, 28 Aug 2019 09:45:11 -0700 (PDT) X-Gm-Message-State: APjAAAXBxeqYLuXrIYy+7Y2uhuCFkodu2SmS/vubuBarK5mpdqYZgtfc 3fdIPuqBdNAMDDBJg1XfzTs8rDAf7fFe5QGNw88= X-Received: by 2002:a67:fd97:: with SMTP id k23mr2902393vsq.179.1567010710588; Wed, 28 Aug 2019 09:45:10 -0700 (PDT) MIME-Version: 1.0 References: <20190819085843.3554-1-yamada.masahiro@socionext.com> In-Reply-To: <20190819085843.3554-1-yamada.masahiro@socionext.com> From: Masahiro Yamada Date: Thu, 29 Aug 2019 01:44:34 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] kbuild: move modkern_{c,a}flags to Makefile.lib from Makefile.build To: Linux Kbuild mailing list Cc: Michal Marek , Linux Kernel Mailing List 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 Mon, Aug 19, 2019 at 5:59 PM Masahiro Yamada wrote: > > Makefile.lib is included by Makefile.modfinal as well as Makefile.build. > > Move modkern_cflags to Makefile.lib in order to simplify cmd_cc_o_c > in Makefile.modfinal. Move modkern_cflags as well for consistency. > > Signed-off-by: Masahiro Yamada > --- Applied to linux-kbuild. > > scripts/Makefile.build | 13 ------------- > scripts/Makefile.lib | 12 ++++++++++++ > scripts/Makefile.modfinal | 6 +++--- > 3 files changed, 15 insertions(+), 16 deletions(-) > > diff --git a/scripts/Makefile.build b/scripts/Makefile.build > index 10adf3b558de..b46e608f9931 100644 > --- a/scripts/Makefile.build > +++ b/scripts/Makefile.build > @@ -92,15 +92,6 @@ endif > # Compile C sources (.c) > # --------------------------------------------------------------------------- > > -# Default is built-in, unless we know otherwise > -part-of-module = $(if $(filter $(basename $@).o, $(real-obj-m)),y) > - > -modkern_cflags = \ > - $(if $(part-of-module), \ > - $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \ > - $(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL)) > -quiet_modtag = $(if $(part-of-module),[M], ) > - > quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ > cmd_cc_s_c = $(CC) $(filter-out $(DEBUG_CFLAGS), $(c_flags)) $(DISABLE_LTO) -fverbose-asm -S -o $@ $< > > @@ -304,10 +295,6 @@ $(obj)/%.h.s: $(src)/%.h FORCE > # Compile assembler sources (.S) > # --------------------------------------------------------------------------- > > -modkern_aflags = $(if $(part-of-module), \ > - $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE), \ > - $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL)) > - > # .S file exports must have their C prototypes defined in asm/asm-prototypes.h > # or a file that it includes, in order to get versioned symbols. We build a > # dummy C file that includes asm-prototypes and the EXPORT_SYMBOL lines from > diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib > index 264611972c4a..888e5c830646 100644 > --- a/scripts/Makefile.lib > +++ b/scripts/Makefile.lib > @@ -159,6 +159,18 @@ _cpp_flags += -I $(srctree)/$(src) -I $(objtree)/$(obj) > endif > endif > > +part-of-module = $(if $(filter $(basename $@).o, $(real-obj-m)),y) > +quiet_modtag = $(if $(part-of-module),[M], ) > + > +modkern_cflags = \ > + $(if $(part-of-module), \ > + $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE), \ > + $(KBUILD_CFLAGS_KERNEL) $(CFLAGS_KERNEL)) > + > +modkern_aflags = $(if $(part-of-module), \ > + $(KBUILD_AFLAGS_MODULE) $(AFLAGS_MODULE), \ > + $(KBUILD_AFLAGS_KERNEL) $(AFLAGS_KERNEL)) > + > c_flags = -Wp,-MD,$(depfile) $(NOSTDINC_FLAGS) $(LINUXINCLUDE) \ > -include $(srctree)/include/linux/compiler_types.h \ > $(_c_flags) $(modkern_cflags) \ > diff --git a/scripts/Makefile.modfinal b/scripts/Makefile.modfinal > index 2e49d536a9b3..059dbcf5ae77 100644 > --- a/scripts/Makefile.modfinal > +++ b/scripts/Makefile.modfinal > @@ -17,12 +17,12 @@ modules := $(sort $(shell cat $(MODORDER))) > __modfinal: $(modules) > @: > > -# modname is set to make c_flags define KBUILD_MODNAME > +# modname and part-of-module are set to make c_flags define proper module flags > modname = $(notdir $(@:.mod.o=)) > +part-of-module = y > > quiet_cmd_cc_o_c = CC [M] $@ > - cmd_cc_o_c = $(CC) $(c_flags) $(KBUILD_CFLAGS_MODULE) $(CFLAGS_MODULE) \ > - -c -o $@ $< > + cmd_cc_o_c = $(CC) $(c_flags) -c -o $@ $< > > %.mod.o: %.mod.c FORCE > $(call if_changed_dep,cc_o_c) > -- > 2.17.1 > -- Best Regards Masahiro Yamada