Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3453628pxk; Mon, 5 Oct 2020 10:01:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynF5AeDHFnssE+OaMVHC30zsxKjlR7eNf651GSOD+t292Cm2d5ocRyR43XbLYmaThgJKKP X-Received: by 2002:a17:906:170e:: with SMTP id c14mr648317eje.275.1601917305396; Mon, 05 Oct 2020 10:01:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601917305; cv=none; d=google.com; s=arc-20160816; b=cSA/Dvj68mDiLppoHnPLSfjCC4+7CcgYCjUiDTX3K+bWTLWArBjSzf6yglAAnKKZNi b4R7Pn9cgscIiVs2CMUY3JopQPK8gJ6+Wh+C7W2j275qke30BP2ZcJ/Wf76QPv2D359o r4/4mYTr7n8H0pxhDmHDmcJ/k8Xbqf1REVvxHG4K30x9cISIhTGwmWRfYrGkc+x8tauF zuFAtK7wAiGbfW+jT7+SzTv3EEvg7dSY/ZwU7Uls/rLUau1j/Ke3FLLlA+A5dXUulvVE YwRhAbzjTKtLLEudMCAMvgDFS10dOZUTtsiAsCo4l0/rl5NQJJWjSxHirQX1DrKfjd0T WJ4g== 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=GfxFwLg0Ssg9lP6e/wJ4Z7cmWSufHa/RbkGYhekKtgo=; b=efN6wCCR5GdPzHayDgFGtptAHdglxKuB2BNqjQXrAMg3Jy5wwo/k8Hmtvi3wj/3LAM FV0+m8pvn+UYdZYAI4Tv8M3+AEO6zn2IDswuabLugVsNG9H+/W7DkrC3bju1TKeB7BiZ p5k6DW7KhRtatk2OMjg6zHkIYS6Y2Sxzt8qk8U1QhDqfUrBdfdAx4Hg2xA3mpLLVjisx joIsIxTrZOPL+YBycWv86ZIWCWIXsZ4Z9tISjqgo+YnpGzqavzr2ZLZ5i1p9AHqC74tW zYSa0an6plAwleqRryBUIhWKvAJKFtJfuvdF0uN42uqmFEfwxm+O/QNl5PV/kHQZWCzl r7pA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=tZWc4BXx; 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 c27si138402ejd.125.2020.10.05.10.01.22; Mon, 05 Oct 2020 10:01:45 -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=tZWc4BXx; 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 S1728675AbgJEPvD (ORCPT + 99 others); Mon, 5 Oct 2020 11:51:03 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:50268 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728598AbgJEPvB (ORCPT ); Mon, 5 Oct 2020 11:51:01 -0400 Received: from pps.filterd (m0098394.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 095FWRVu034149; Mon, 5 Oct 2020 11:50:36 -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=GfxFwLg0Ssg9lP6e/wJ4Z7cmWSufHa/RbkGYhekKtgo=; b=tZWc4BXxK/yenIjoVbrWYNFjBBzES4GvUO51FBcW62GGfgX9E6AuCl4gFON86tTvwpUh itaOtTg75a3GKb9bfrUrvm8b1oqB5NcDZGH1FH65j0EgHISlJ7BoIRN8DScBRbT3YfW1 eumnlYO3swdkQb/o7BVNUzLru/d4ipxGplVvOuRJqHl62FwE6SHhJiP2TRBgEYGqNcBk GFElhjuMDBnOZAVCIWz2DS7ZJWmQHbOrkp0Fe3sTiiCN02xWqcJQHtCxVOKvPdQuutni XaHPM1nS0GFfmMzm2kUmQatHtmq8Zue1BuQgZUojnXi9nWGYMWRwmdw8jZ6kdMxGKbOl Zg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3406788mj0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Oct 2020 11:50:36 -0400 Received: from m0098394.ppops.net (m0098394.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 095FWcIv035265; Mon, 5 Oct 2020 11:50:35 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 3406788mgt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Oct 2020 11:50:35 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 095FlCbJ028085; Mon, 5 Oct 2020 15:50:33 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma04ams.nl.ibm.com with ESMTP id 33xgx82b1y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Oct 2020 15:50:32 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 095FoUxv28574014 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 5 Oct 2020 15:50:30 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8D2E711C054; Mon, 5 Oct 2020 15:50:30 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CDBDB11C04A; Mon, 5 Oct 2020 15:50:29 +0000 (GMT) Received: from localhost (unknown [9.145.67.211]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Mon, 5 Oct 2020 15:50:29 +0000 (GMT) Date: Mon, 5 Oct 2020 17:50:28 +0200 From: Vasily Gorbik To: Josh Poimboeuf , Peter Zijlstra , Thomas Gleixner Cc: Masami Hiramatsu , David Laight , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Miroslav Benes , Alexandre Chartre , Julien Thierry , linux-kernel@vger.kernel.org Subject: [RFC PATCH RESEND v4 1/4] objtool: allow nested externs to enable BUILD_BUG() Message-ID: References: <20201005140328.hpbpkfpx3hmpuapt@treble> 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-05_10:2020-10-05,2020-10-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 mlxlogscore=925 malwarescore=0 bulkscore=0 priorityscore=1501 suspectscore=1 adultscore=0 spamscore=0 mlxscore=0 impostorscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010050115 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. Build objtool with -Wno-nested-externs to enable BUILD_BUG() usage. Signed-off-by: Vasily Gorbik --- tools/objtool/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile index 33d1e3ca8efd..4ea9a833dde7 100644 --- a/tools/objtool/Makefile +++ b/tools/objtool/Makefile @@ -37,7 +37,7 @@ INCLUDES := -I$(srctree)/tools/include \ -I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \ -I$(srctree)/tools/arch/$(SRCARCH)/include \ -I$(srctree)/tools/objtool/arch/$(SRCARCH)/include -WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed +WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed -Wno-nested-externs CFLAGS := -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBELF_FLAGS) LDFLAGS += $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS) -- ⣿⣿⣿⣿⢋⡀⣀⠹⣿⣿⣿⣿ ⣿⣿⣿⣿⠠⣶⡦⠀⣿⣿⣿⣿ ⣿⣿⣿⠏⣴⣮⣴⣧⠈⢿⣿⣿ ⣿⣿⡏⢰⣿⠖⣠⣿⡆⠈⣿⣿ ⣿⢛⣵⣄⠙⣶⣶⡟⣅⣠⠹⣿ ⣿⣜⣛⠻⢎⣉⣉⣀⠿⣫⣵⣿