From patchwork Tue Mar 26 06:11:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 161161 Delivered-To: patch@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp4825276jan; Mon, 25 Mar 2019 23:11:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhGfwsK8rTSoh9ozpqhibMRQXMfl0OcMNZkHthJ2oE6opP4vu4yeNt8MxexVzxI4E0pHYD X-Received: by 2002:aa7:83cb:: with SMTP id j11mr27890260pfn.117.1553580685281; Mon, 25 Mar 2019 23:11:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553580685; cv=none; d=google.com; s=arc-20160816; b=zUpyonzASfVZ9OyRQ+JRahdJGB/sw9As75YAdRuREQn9jG6Db+vBpPkLvOD3E8/Wtx SbnCOPD/tzWI01h84gmbnVyJWN8phWf8AJvv7cE/zA9h04iihKaAJWWqqWsYlQ+bEi+M epgIZSEtKikXcCNv+SdE6TMLVTwFenzLStjpzoC/asAY7H8HCkuipuHJzZgPUTCPxS9b /6OzNDjKNLEKCQBmY65tarCAnTAFV63euS2VuQBFDrIyPEByuaQNRA23ffowymw/Zvz6 C8FdCIHjuDM9Qql4oFh+HF43qzTGAu4SJ/lMY2OebqoJ42jVXoS7OiRguAZQn0jt95JM 7dvg== 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=Zw7uwaX5YIAaXoE1R4izq01ZBngP76ndRTfwlXDflu0=; b=jgscTkDzqtIa3+1wje8Cmi9NBahDTsU6g+E0+M0tDLDu1ivqQvbeITyyajr/cDmj9E 1352J0sSHgU1Y8nF/1glV0OvUJvN+sKuyt3PS+n0DVKFRVrv7Jjbv3senTaV5x9d2GDQ gtbn/RS9Z+7+ndbJnqkbVFxMj4QJ7+jTwP5tFW7dNbhfvhEdoi4xuscWYumNi0sVDqWM qUVTNEHU2TcEuVviD1NvxRHUs1Jyu5dHJoisjeqXUKBMy0ERGvyYP86G0IPJg1SB5tNN 0u70soywy7MTfZTvenS94EAXEoq7G3njYJjcGw5lVa7TpEsa3y1+8XecwyMJIF3jLDwU BRrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=aCXgLcWS; 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 d130si15144532pgc.197.2019.03.25.23.11.24; Mon, 25 Mar 2019 23:11:25 -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=aCXgLcWS; 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 S1726302AbfCZGLX (ORCPT + 31 others); Tue, 26 Mar 2019 02:11:23 -0400 Received: from conuserg-07.nifty.com ([210.131.2.74]:59704 "EHLO conuserg-07.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726111AbfCZGLW (ORCPT ); Tue, 26 Mar 2019 02:11:22 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-07.nifty.com with ESMTP id x2Q6BFkG012588; Tue, 26 Mar 2019 15:11:15 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-07.nifty.com x2Q6BFkG012588 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1553580676; bh=Zw7uwaX5YIAaXoE1R4izq01ZBngP76ndRTfwlXDflu0=; h=From:To:Cc:Subject:Date:From; b=aCXgLcWS0eaQoRN9GuPWnpgPacWdryoda1pZ4ON6o5aF95wDqLtG7bfH9HVgyDz1f Xzz5r9efNaSstgOb8PF615eMpEL/eObD/WU/Su31cJgPt52AOOxwq5Ht+0DEJcZYf+ yxyQyabLPmUnUUslP9w+Y1hcYvachW/ypFYRd+Ba0oxeWa1GQkI8m5/I1/PuNtP1G1 9676BURA0CHhMSVKBN9PWiqQVrjggb/fjEud8SPhbLAGylFamyDb5xa/Qqw2Z5cq6Q 4l592NDNNOlyb7DnCqT0ZztIqBh439znu+sb0pfqlfiQxMpKWQl0pfkhGlRMjH0QD1 69UYvLmQzoaPA== 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 RETPOLINE flags below config-targets Date: Tue, 26 Mar 2019 15:11:12 +0900 Message-Id: <1553580672-29551-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When you run a "make *config" target, the retpoline compiler flags are evaluated for nothing because the code is located above the 'ifeq ($(config-targets),1)'. Move it a bit below to avoid unneeded computation in the Kconfig stage. Signed-off-by: Masahiro Yamada --- Makefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 1b361bd..66a8e04 100644 --- a/Makefile +++ b/Makefile @@ -519,15 +519,6 @@ KBUILD_AFLAGS += $(CLANG_FLAGS) export CLANG_FLAGS endif -RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register -RETPOLINE_VDSO_CFLAGS_GCC := -mindirect-branch=thunk-inline -mindirect-branch-register -RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk -RETPOLINE_VDSO_CFLAGS_CLANG := -mretpoline -RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG))) -RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_VDSO_CFLAGS_CLANG))) -export RETPOLINE_CFLAGS -export RETPOLINE_VDSO_CFLAGS - # The expansion should be delayed until arch/$(SRCARCH)/Makefile is included. # Some architectures define CROSS_COMPILE in arch/$(SRCARCH)/Makefile. # CC_VERSION_TEXT is referenced from Kconfig (so it needs export), @@ -624,6 +615,15 @@ ifdef CONFIG_FUNCTION_TRACER CC_FLAGS_FTRACE := -pg endif +RETPOLINE_CFLAGS_GCC := -mindirect-branch=thunk-extern -mindirect-branch-register +RETPOLINE_VDSO_CFLAGS_GCC := -mindirect-branch=thunk-inline -mindirect-branch-register +RETPOLINE_CFLAGS_CLANG := -mretpoline-external-thunk +RETPOLINE_VDSO_CFLAGS_CLANG := -mretpoline +RETPOLINE_CFLAGS := $(call cc-option,$(RETPOLINE_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_CFLAGS_CLANG))) +RETPOLINE_VDSO_CFLAGS := $(call cc-option,$(RETPOLINE_VDSO_CFLAGS_GCC),$(call cc-option,$(RETPOLINE_VDSO_CFLAGS_CLANG))) +export RETPOLINE_CFLAGS +export RETPOLINE_VDSO_CFLAGS + # The arch Makefile can set ARCH_{CPP,A,C}FLAGS to override the default # values of the respective KBUILD_* variables ARCH_CPPFLAGS :=