Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1816870pxu; Thu, 8 Oct 2020 23:50:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzR8gZlsuh9boCfaIK+KfK/dIeuaN3iveXSqR9pnflfgEOTPD/Y0HoTk6MF4sPB0L+RLXJy X-Received: by 2002:a17:907:104f:: with SMTP id oy15mr13045425ejb.261.1602226249304; Thu, 08 Oct 2020 23:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602226249; cv=none; d=google.com; s=arc-20160816; b=eOjjEPZVwH0CPsA1Mu72fNAfIFJo1x4I7/2Gbe0bnaYx4Eu6j7fFtnHrWA6+7rviHT WbXEc6VF6cbKsAcrW9uyz39uXD1Lkb4YPnJV1uFOrGv/cR8fCntoU622LHqrQZC9szII hEeEBvaHyLlahWUqdMk05/vaO7QaFA3zT2/XteKKC5vOvW1B+CFinLGkySzkYz8a/ruH vYsTYRnDZk8siW3DQDJWrCsLZA8WEPNe4uWR8/WqhZZJEuN8ehYCHuOjRXFhfXe974d7 960tfzIeywQ9ZjgnqWZkJgkx6tHewIu5RyXQRcAWXc02tOW4gJRm2c4hKOaPfej4V1Eg GW1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=7npiYY1G2FfggAYyTzA/cJHByVtE439s2uXTBc239oE=; b=y5TXNMaCTKOTtt1wc6alXI7caf+vjBC54g2i8PZfgW04OTuYldEpcTCNLj2MGCaXXx v3yc/5pG/YgvSwM55a254S7yzLFwebvWhJF7jfZ0HSR58Di16QXdk0iVq9nAvPJyZfzP HB2BdCHta1L4vg5tIFedCv0e2392lj6wrDI8L7ag2/S3AME1cyv80e5fash6axZGcil+ V/tb4EK9cTvn+KJ1mjk9v3skFIYDmMmx4f7sEsmNZh1cfieQg3dlxonOXTRWaDQdG+y+ S8xy++x8CmhhS6o5Wjd/piUNqvJ1vEzUbuorgqe4o9PwJiJHnuDN880nlgMxwjBWz/aa P0KA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="qjM8f/ze"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id fx12si5592925ejb.350.2020.10.08.23.50.25; Thu, 08 Oct 2020 23:50:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="qjM8f/ze"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731620AbgJIGsO (ORCPT + 99 others); Fri, 9 Oct 2020 02:48:14 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:9010 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731076AbgJIGsN (ORCPT ); Fri, 9 Oct 2020 02:48:13 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0996XFNH116259; Fri, 9 Oct 2020 02:47:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to; s=pp1; bh=7npiYY1G2FfggAYyTzA/cJHByVtE439s2uXTBc239oE=; b=qjM8f/zejSo3hgzFFDr/S09kFTEkbfIf6HMg6sbWAmn81tQDPgfg4IJME1T4/nWAzBLS wktlHR3CXTIp1CbbzlUmdGQNGH7MSceiueIyq6e2vhHgDXeB99K8MNJv6l1dCkj4v3bW dCyQupq8Sfq7I1QrHnWN+WXNyfqlRXlmOym3YoZh6cggmN9a8whyc/LdobjpOROi69xG 4D4HQ0iot+/GcccrX+kCfOC18VdFXWWNm7xj3y1Mbn3BzYm1ycMCRpQ4yJtVq/GThCq3 1SeJgOleKg2byl8FHF4J3Aw8toI3GBFqR1f/UjgoVEdA2Vl/Lw8/RFuIC+6nGCznE5RO pg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 342hk1swse-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Oct 2020 02:47:54 -0400 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0996XoYj118041; Fri, 9 Oct 2020 02:47:53 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 342hk1swr2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Oct 2020 02:47:53 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 0996S2Rr031925; Fri, 9 Oct 2020 06:47:49 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03ams.nl.ibm.com with ESMTP id 3429hugccw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 09 Oct 2020 06:47:49 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0996llI328442938 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 9 Oct 2020 06:47:47 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B9DE11C054; Fri, 9 Oct 2020 06:47:47 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DA2BD11C050; Fri, 9 Oct 2020 06:47:46 +0000 (GMT) Received: from localhost (unknown [9.145.0.122]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Fri, 9 Oct 2020 06:47:46 +0000 (GMT) Date: Fri, 9 Oct 2020 08:47:45 +0200 From: Vasily Gorbik To: Arnaldo Carvalho de Melo , Josh Poimboeuf , Peter Zijlstra , Stephen Rothwell Cc: Ingo Molnar , Thomas Gleixner , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , "H. Peter Anvin" , Masami Hiramatsu , Linux Kernel Mailing List , Linux Next Mailing List Subject: [PATCH 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage Message-ID: References: <20201009152846.072e6bbf@canb.auug.org.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Patchwork-Bot: notify X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-10-09_02:2020-10-09,2020-10-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 adultscore=0 suspectscore=1 phishscore=0 impostorscore=0 mlxscore=0 bulkscore=0 clxscore=1015 spamscore=0 mlxlogscore=999 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010090046 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently BUILD_BUG() macro is expanded to smth like the following: do { extern void __compiletime_assert_0(void) __attribute__((error("BUILD_BUG failed"))); if (!(!(1))) __compiletime_assert_0(); } while (0); If used in a function body this obviously would produce build errors with -Wnested-externs and -Werror. To enable BUILD_BUG() usage in tools/arch/x86/lib/insn.c which perf includes in intel-pt-decoder, build perf without -Wnested-externs. Reported-by: Stephen Rothwell Signed-off-by: Vasily Gorbik --- tools/perf/Makefile.config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config index 190be4fa5c21..8137a6046a47 100644 --- a/tools/perf/Makefile.config +++ b/tools/perf/Makefile.config @@ -16,7 +16,7 @@ $(shell printf "" > $(OUTPUT).config-detected) detected = $(shell echo "$(1)=y" >> $(OUTPUT).config-detected) detected_var = $(shell echo "$(1)=$($(1))" >> $(OUTPUT).config-detected) -CFLAGS := $(EXTRA_CFLAGS) $(EXTRA_WARNINGS) +CFLAGS := $(EXTRA_CFLAGS) $(filter-out -Wnested-externs,$(EXTRA_WARNINGS)) include $(srctree)/tools/scripts/Makefile.arch -- ⣿⣿⣿⣿⢋⡀⣀⠹⣿⣿⣿⣿ ⣿⣿⣿⣿⠠⣶⡦⠀⣿⣿⣿⣿ ⣿⣿⣿⠏⣴⣮⣴⣧⠈⢿⣿⣿ ⣿⣿⡏⢰⣿⠖⣠⣿⡆⠈⣿⣿ ⣿⢛⣵⣄⠙⣶⣶⡟⣅⣠⠹⣿ ⣿⣜⣛⠻⢎⣉⣉⣀⠿⣫⣵⣿