Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2661962pxk; Sun, 4 Oct 2020 07:33:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjULJLbHJsHm4K1LZsQt/uFY/6RWxd8aGmQV02IVCORcFiZTF3FH9XOcIKVMWlAfvIHnGf X-Received: by 2002:a50:ed02:: with SMTP id j2mr13063786eds.137.1601822028874; Sun, 04 Oct 2020 07:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601822028; cv=none; d=google.com; s=arc-20160816; b=J9+iO48jmxwhGXy/6ZjW+oIw5gP5Zorc7mcV/4IQaXs0sUB2N7u4LJjPf2rs4Mhe8Y 0BNjuIj/OHemH+4NwOUSNqkkudWN4Lt6hP9plrKlEfHJe0/ME8/AMm6+1UPdOr0UZgAx fNczo1yp4diVPhjIp4xvY7OX50QjhxJ/q4LdzZMzlmJTMgwhDg4xrKHQwO4JtXh8JjK/ gT6KweCKshzCnOgjL8iNvkLpA5pRIg2ndBtnW3XNrxDtdfSg26Ao71GisQzIdykY7qqG f0j+r2HGkmPQq9epARNmyl+DRCQuv8Ituz3j8dOc1wBBWj1gAP053bdHg8wUjqym+QBY 8Nbw== 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=V1H5uEXmhgWo4hvZHNzMmwptBPMPNRr5pzYygw32Oif+jAJeYxP/FK4mFTfWL/UEo0 BZBeruAJuCQrPNGrBfjgnGLHq0j4InogsjNYkiFFLiV08fxXtYw/ntC/PzklDVFlh8du Zo/6NNZGUohWVj7LzTFQQDWWVRlk3US6O/HtmhPlbvE/EIRGfcw7C2N6Lt7sqiJHZKZB Z+s8YsOfV4lFGw3LLimbrDDH7bt+r4OsX2xdHj8Q3ATwIoGQLH5BlOhKKtWIPp6zt4yQ z66PwCzKQHZPul+eu1h2NfzXblD7g0+0TueKvMjB73YUTw7pIuAp0+MLmoisBOb8qTdU JA4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=fzAnurW+; 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 l12si2055207edi.370.2020.10.04.07.33.26; Sun, 04 Oct 2020 07:33:48 -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=fzAnurW+; 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 S1725950AbgJDObS (ORCPT + 99 others); Sun, 4 Oct 2020 10:31:18 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:6138 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725825AbgJDObP (ORCPT ); Sun, 4 Oct 2020 10:31:15 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 094E3tl4185989; Sun, 4 Oct 2020 10:30:51 -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=fzAnurW+2juWmgyktBkT76YFowOZolJRLxnHtaINx/c4dbPIFq1eRq1mRLJMCBtYYNvb bURar5fJr1TWe9Sw3uoiSYqYl567HXH1aQZMTEy5XqfuXKRRCXIp3Bg26KRjIzdoyGuB Vak8hfBq5HyW4tPd4jdveAzPRxeL8cE/dTt4x42P2D+gAyutehrAkbDcKB3AG1pQWHhe 4v3nzBCplfsZGxmPa/DGXUvYA5IAn+92/y5YMAQQ2/fIbgDxkUsvv21wmoODCIUHY6+O 3VOmqGEsRaAR7Z4nhLTCQPpOhi+4wJpexVTRu0gE4BuPPNhwV9AeVPalsJSeEGhZjjWc Mg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 33yfbqrsrf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 04 Oct 2020 10:30:51 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 094EP7Tv063202; Sun, 4 Oct 2020 10:30:50 -0400 Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 33yfbqrsr2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 04 Oct 2020 10:30:50 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 094ECYtT026077; Sun, 4 Oct 2020 14:30:48 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06ams.nl.ibm.com with ESMTP id 33xgjh183w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 04 Oct 2020 14:30:47 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 094EUj9432965076 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 4 Oct 2020 14:30:45 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4E1111C04A; Sun, 4 Oct 2020 14:30:45 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BB39011C04C; Sun, 4 Oct 2020 14:30:44 +0000 (GMT) Received: from localhost (unknown [9.145.42.132]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Sun, 4 Oct 2020 14:30:44 +0000 (GMT) Date: Sun, 4 Oct 2020 16:30:43 +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 v4 1/4] objtool: allow nested externs to enable BUILD_BUG() Message-ID: References: <20201002160114.7yb7z7aeijhchpwl@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-04_13:2020-10-02,2020-10-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=924 adultscore=0 phishscore=0 spamscore=0 mlxscore=0 malwarescore=0 impostorscore=0 priorityscore=1501 bulkscore=0 lowpriorityscore=0 clxscore=1015 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2010040099 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) -- ⣿⣿⣿⣿⢋⡀⣀⠹⣿⣿⣿⣿ ⣿⣿⣿⣿⠠⣶⡦⠀⣿⣿⣿⣿ ⣿⣿⣿⠏⣴⣮⣴⣧⠈⢿⣿⣿ ⣿⣿⡏⢰⣿⠖⣠⣿⡆⠈⣿⣿ ⣿⢛⣵⣄⠙⣶⣶⡟⣅⣠⠹⣿ ⣿⣜⣛⠻⢎⣉⣉⣀⠿⣫⣵⣿