Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3525826imm; Mon, 6 Aug 2018 06:23:35 -0700 (PDT) X-Google-Smtp-Source: AAOMgpc2YoWBimU87tpHZw6eLQJqxPKh84USwAW1DbOEx6qaEXogkjPIu0wmEphQ3nJo3sEFASF3 X-Received: by 2002:a63:1d3:: with SMTP id 202-v6mr14368115pgb.136.1533561815072; Mon, 06 Aug 2018 06:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533561815; cv=none; d=google.com; s=arc-20160816; b=nRDpZtEUEIFBv8HDsVAc56lmJ0mvZXTSjWw1BozUvRnQwZ1iL+MntQzVLFCy66y0HS EWlbsEkWJb2jsrJtYON9URv0uAmMo0HSrycjO71tUqdZbHgjsOAbK5VWE+fr8rf2zC1B 1tNegp/D+WHhGqF25AkD/oK87uMSYGYc4N6edF6ymF6XvkztdtQIseeJcZL+1EKd8t23 ZbIGaDGqq/B5tFF8xjFZg3x2zicqtZE694ZPUO0ZmBlkDxiQAZ560btEkMha8A1pgtc1 QLCm4XX31CTIJQvi500PpLy1/uQqSMHA+4dUwmExmW0gaGPEu3/6cuwq3Wn3fWmL+HaY ea9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:in-reply-to :content-disposition:mime-version:references:subject:cc:to:from:date :arc-authentication-results; bh=Y9ddiAJJlxv6DLRyCuxIl18wTtQXOfK7VYFKjOUdTks=; b=xuCa08eP6IqD9rJgMv42xFqIbZa7UDWz6VsUtmzxOQRo0P6Yp4XRXMzSJV+h4Qrsi7 r+RZvU8rG/gOuraHJx/4dTH1tOw1ZoVtl8BVNVudpDCmuwrBa8vF6zQkhVXyqPg98TtI ME1qcn3Sbq6YwVP7YRyyFloUq4TRJy6F6wgC0Ww8sYiNf0qX+qkaaD1ThsQvc1pNHg2x 8YremYKhN6+QSyPOK4qvvykBwFeH0ddqz5etatSFOY5TmXcXw0V85mCaN5ccuh9AKlrP dgZB/Ltu/hUbamJVCm5IsxTN3P9EWJHg66CjJLP2jIgVPnsVX+4KcrScumyvntHTHcTY KLtg== ARC-Authentication-Results: i=1; mx.google.com; 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 80-v6si13120762pgf.604.2018.08.06.06.23.20; Mon, 06 Aug 2018 06:23: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; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732653AbeHFP04 (ORCPT + 99 others); Mon, 6 Aug 2018 11:26:56 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46068 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732634AbeHFP0z (ORCPT ); Mon, 6 Aug 2018 11:26:55 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w76DE9nf016580 for ; Mon, 6 Aug 2018 09:17:51 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0b-001b2d01.pphosted.com with ESMTP id 2kpnqckpqr-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 06 Aug 2018 09:17:50 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 Aug 2018 14:17:49 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Mon, 6 Aug 2018 14:17:45 +0100 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w76DHiJA35651706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 6 Aug 2018 13:17:44 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 08C8F4C046; Mon, 6 Aug 2018 16:17:54 +0100 (BST) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A3CB34C040; Mon, 6 Aug 2018 16:17:53 +0100 (BST) Received: from localhost (unknown [9.152.212.144]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 6 Aug 2018 16:17:53 +0100 (BST) Date: Mon, 6 Aug 2018 15:17:42 +0200 From: Vasily Gorbik To: Masahiro Yamada , Michal Marek , Martin Schwidefsky , Heiko Carstens , Steven Rostedt , Ingo Molnar Cc: linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Andi Kleen Subject: [PATCH 1/4] trace: handle CC_FLAGS_FTRACE more accurately References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 x-cbid: 18080613-0016-0000-0000-000001F1F530 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18080613-0017-0000-0000-00003247353F Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-06_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=526 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808060141 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Vasily Gorbik --- Makefile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7a3c4548162b..503f533277c7 100644 --- a/Makefile +++ b/Makefile @@ -743,12 +743,15 @@ ifdef CONFIG_FUNCTION_TRACER ifndef CC_FLAGS_FTRACE CC_FLAGS_FTRACE := -pg endif -export CC_FLAGS_FTRACE ifdef CONFIG_HAVE_FENTRY -CC_USING_FENTRY := $(call cc-option, -mfentry -DCC_USING_FENTRY) + ifeq ($(call cc-option-yn, -mfentry),y) + CC_FLAGS_FTRACE += -mfentry + CC_FLAGS_USING += -DCC_USING_FENTRY + endif endif -KBUILD_CFLAGS += $(CC_FLAGS_FTRACE) $(CC_USING_FENTRY) -KBUILD_AFLAGS += $(CC_USING_FENTRY) +export CC_FLAGS_FTRACE +KBUILD_CFLAGS += $(CC_FLAGS_FTRACE) $(CC_FLAGS_USING) +KBUILD_AFLAGS += $(CC_FLAGS_USING) ifdef CONFIG_DYNAMIC_FTRACE ifdef CONFIG_HAVE_C_RECORDMCOUNT BUILD_C_RECORDMCOUNT := y -- 2.18.0.13.gd42ae10