Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2440144ybl; Mon, 19 Aug 2019 02:01:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPhO+LiJ6tzS7OJAYR9Ux6jjFtEFFDsWfujM7UuAgDfZTEMn4fBbPaPe7Lm6Wmyd+8KWCx X-Received: by 2002:a63:ee04:: with SMTP id e4mr18965278pgi.53.1566205295319; Mon, 19 Aug 2019 02:01:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1566205295; cv=none; d=google.com; s=arc-20160816; b=cgkoDA+5BLV3IgHERWUJbw3mciZeO2BTB4UhauyCUTTpPPG9AQcLyuASeZZMjv9YsV w88A4i5xPBuTuBc+WGdEeLGAlYNBTkPOhBt+Yh31t0RjWwl1BdEHUinogHYy6QlPw5o2 R6lRt+uNjNzW7XSEXvCilYa0RxGZ1tmguYtNciw1RA6R21t6B1LXI76bWThjxEXGEFEx cGsPXBdyiZ9k+TcrujXNB3BsuB+KOvWkbBN/MbCgNaoKBjAR/ki7Gnpf4JyqbveE3Xq2 h5gj/3UXLTf/T8Mxq/I5urHp2s9omAo+K8Tv0sLAsXUKQgcZYAQo8QvJvOXLkt5Dv7Ki u27Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=BK4+KA9hkQRX71ZtGsOvnvCQcvimAXHBuU8rnK3+StM=; b=EThzlCJrNAqcrxSQj+u2Sts0o1EoU9q/xuXI3FipjcM8aURbWtzq2O8jFQptG3KZ0c u/MmYxnI9cIKB9wyhgn6HQVxK5tlomvKieIjRGju3sSOnhgX2aAIymHYaLh9sBry/8iT SLpVmoLInIBnpoZPH8wux1PHuzpJofQi2d+G2dI4Gbfe0RLXkn8fzW3B0WwzfaHcnxce WBgxq0IeW7sdfx5Pf6aysfkm5hNef3m1WEPa7PIYxZP+T77IbyArDn0Lhh/CITfgu84t NtSYfiGTUUItjZkoFw44z1zKBnuOZJ4olTLvIzf5zvKOlhuEPXIzSFnX7zQiikISqdHU sWVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=PleXQs0O; 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 n187si8224492pga.165.2019.08.19.02.01.20; Mon, 19 Aug 2019 02:01:35 -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=PleXQs0O; 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 S1727307AbfHSI7N (ORCPT + 99 others); Mon, 19 Aug 2019 04:59:13 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:32643 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725536AbfHSI7N (ORCPT ); Mon, 19 Aug 2019 04:59:13 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-09.nifty.com with ESMTP id x7J8wjPq004802; Mon, 19 Aug 2019 17:58:45 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x7J8wjPq004802 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1566205126; bh=BK4+KA9hkQRX71ZtGsOvnvCQcvimAXHBuU8rnK3+StM=; h=From:To:Cc:Subject:Date:From; b=PleXQs0O1Mt9Xdzlh7kiBiycGUzQ8AEvOPuxGYR0wbBNkUI5VNjyc7dYcERAw0nf3 aMgkjbPFbN01NxuJ2HZSzu3CXRMv5VYK00zncP8mWw8ePoVlq2kPgz63qJyFnbMEzy /gNhlFB6HrT2Um2Jg8E3t5wj87aRZ863EMEbGn+UR1ybFcCySesZU70yyMvhjjDDiw m/YQrikyGo2bkUsIZXnb2+6+1c3Oq61731sh6usN5QB1M274ebWnN8TdW9gFGFogj+ qJmog4SIoXRROOVmci/gBxhfrD7s4P3liW+xaVGEYE0jReXrWkBGRFJwZF1dEo8zpJ R5ND+o89KqcFQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH] kbuild: move modkern_{c,a}flags to Makefile.lib from Makefile.build Date: Mon, 19 Aug 2019 17:58:43 +0900 Message-Id: <20190819085843.3554-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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