Return-Path: Received: from mail-eopbgr720119.outbound.protection.outlook.com ([40.107.72.119]:61842 "EHLO NAM05-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727875AbeH3WNp (ORCPT ); Thu, 30 Aug 2018 18:13:45 -0400 From: Sasha Levin To: "stable@vger.kernel.org" CC: Vasily Gorbik , Steven Rostedt , Sasha Levin Subject: [PATCH AUTOSEL 4.14 24/67] tracing: Handle CC_FLAGS_FTRACE more accurately Date: Thu, 30 Aug 2018 18:10:21 +0000 Message-ID: <20180830180918.36327-24-alexander.levin@microsoft.com> References: <20180830180918.36327-1-alexander.levin@microsoft.com> In-Reply-To: <20180830180918.36327-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Vasily Gorbik [ Upstream commit f28bc3c32c059ab4d13f52155fabd3e20f477f65 ] CC_FLAGS_FTRACE is exported and later used to remove ftrace relevant build flags from files which should be built without ftrace support. For that reason add -mfentry to CC_FLAGS_FTRACE as well. That fixes a problem with vdso32 build on s390, where -mfentry could not be used together with -m31 flag. At the same time flags like -pg and -mfentry are not relevant for asm files, so avoid adding them to KBUILD_AFLAGS. Introduce CC_FLAGS_USING instead of CC_USING_FENTRY to collect -DCC_USING_FENTRY (and future alike) which are relevant for both KBUILD_CFLAGS and KBUILD_AFLAGS. Link: http://lkml.kernel.org/r/patch-1.thread-aa7b8d.git-42971afe87de.your-= ad-here.call-01533557518-ext-9465@work.hours Signed-off-by: Vasily Gorbik Signed-off-by: Steven Rostedt (VMware) Signed-off-by: Sasha Levin --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4dad2d1c24ba..51f4be1a8b7b 100644 --- a/Makefile +++ b/Makefile @@ -763,12 +763,15 @@ ifdef CONFIG_FUNCTION_TRACER ifndef CC_FLAGS_FTRACE CC_FLAGS_FTRACE :=3D -pg endif -export CC_FLAGS_FTRACE ifdef CONFIG_HAVE_FENTRY -CC_USING_FENTRY :=3D $(call cc-option, -mfentry -DCC_USING_FENTRY) + ifeq ($(call cc-option-yn, -mfentry),y) + CC_FLAGS_FTRACE +=3D -mfentry + CC_FLAGS_USING +=3D -DCC_USING_FENTRY + endif endif -KBUILD_CFLAGS +=3D $(CC_FLAGS_FTRACE) $(CC_USING_FENTRY) -KBUILD_AFLAGS +=3D $(CC_USING_FENTRY) +export CC_FLAGS_FTRACE +KBUILD_CFLAGS +=3D $(CC_FLAGS_FTRACE) $(CC_FLAGS_USING) +KBUILD_AFLAGS +=3D $(CC_FLAGS_USING) ifdef CONFIG_DYNAMIC_FTRACE ifdef CONFIG_HAVE_C_RECORDMCOUNT BUILD_C_RECORDMCOUNT :=3D y --=20 2.17.1