Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp13550pxk; Wed, 30 Sep 2020 16:18:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIDNj3HrPYWaSmoDx9S+3iaIABOncibb0OsiQeu3DxOOOnewxmxKNajQ6NoO1tRXzUAvsC X-Received: by 2002:a50:8fa3:: with SMTP id y32mr5468794edy.78.1601507911068; Wed, 30 Sep 2020 16:18:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601507911; cv=none; d=google.com; s=arc-20160816; b=Hk9/VNoxGmUSDcq1WwedX+PU27V3mQTgCZnyuW0E8dTqXb0aLGsYAPuo9UnqrqWX5T NAPI74wpZ2uPc7SfUUt7cjxjf7VrZbor454TV+Or5Lik9lnLgpYJSwDbf4kOx72hI2G9 pj9Rxb12HjH7TWsOgd2lo6lrzSXK/kjEYXSkPs2gKSXsk0f9QemJjYzALlBi2947F4VT zMTfmViBUhaOemvy3DtqsrzASxg9Q9qem6Rv77wSjcDIIa0v4npm2n0EyHv7xqiEL5Ql uB1jCM0kxi8zlMjbm6JQ6uwvPSE2ZzKnHR/RHKwYcPQMVuc386B8SSKJ8vJ7AVwLeMWm mccg== 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=UtIdlvk/oWuNT3BWQ+TTxneE5BL7XWvr01IauRMfEvFO37l0ypDtCIxqs1YY4NFqK9 onHr6Ihlw978FZYd8GIAMHuEujQzFyGbQNT0aDYNA6XiG+BKDDTMNsdF8HqS38hHG8Xp A4nn+1v4KRR3ABOS4GQga4owha6pLoNCYjX1vkeHTtRA6+ODCsYG4U8IxXquzMXetR9F tj8mZE1kIrygMr8IawzqxTtf9AMvYphtxGVQLV0tUxdXZa6NXHrq7+KhwKVe7rt5pIIc d6v11ZhUQyBHRF4NgtjKGR4WUpePpmuEjnFPoVzEEJsjPNNbABqFUoM35LAVQK7Hxbhk kMaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=ptA1ccm4; 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 e6si2258964ejc.703.2020.09.30.16.18.08; Wed, 30 Sep 2020 16:18:31 -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=ptA1ccm4; 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 S1731401AbgI3WSC (ORCPT + 99 others); Wed, 30 Sep 2020 18:18:02 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:12248 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731285AbgI3WR4 (ORCPT ); Wed, 30 Sep 2020 18:17:56 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 08UM0pe3139160; Wed, 30 Sep 2020 18:17:29 -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=ptA1ccm4GM8iikqKtMJ95sexJaqHBYFdxtrkQRj2BBT0NOeQVsgeguzXJP7UJ5qDM9nP x+/6IiVas8H+4hvemCmK1HUuczErwDTzIWGNC3RHjqXkK8g2OBaf30u3RYgBr4YP9Es6 tAntbtTX9DZuxvswwLeisrWtkpjd14wwwKSpryUWP+4VUg//TAS92bJ+BeTQ9OdOyUpX J4/Yzk1g/GEf9GHOakVDjIr20uNzF0i53TE35w2lh1HrX4SBsyrHHOHSs1605TreZdRY PZzsVqLubt7e6a/jJOzau3bMXt/vNYs6Gyi4UUUiSIzr310gLycyfFe1nr1dmpz6pOvX tQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 33w0u5ttsw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 18:17:29 -0400 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 08UMBrZb179162; Wed, 30 Sep 2020 18:17:29 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 33w0u5ttsh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 18:17:28 -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 08UMH3NA008279; Wed, 30 Sep 2020 22:17:27 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04ams.nl.ibm.com with ESMTP id 33sw97vv9d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 30 Sep 2020 22:17:27 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 08UMHOFO22348232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Sep 2020 22:17:24 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C36F611C050; Wed, 30 Sep 2020 22:17:24 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 199A611C04A; Wed, 30 Sep 2020 22:17:24 +0000 (GMT) Received: from localhost (unknown [9.145.18.215]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTPS; Wed, 30 Sep 2020 22:17:24 +0000 (GMT) Date: Thu, 1 Oct 2020 00:17:22 +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 v3 1/4] objtool: allow nested externs to enable BUILD_BUG() Message-ID: References: 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-09-30_13:2020-09-30,2020-09-30 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxlogscore=924 mlxscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 malwarescore=0 phishscore=0 impostorscore=0 suspectscore=1 adultscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009300174 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) -- ⣿⣿⣿⣿⢋⡀⣀⠹⣿⣿⣿⣿ ⣿⣿⣿⣿⠠⣶⡦⠀⣿⣿⣿⣿ ⣿⣿⣿⠏⣴⣮⣴⣧⠈⢿⣿⣿ ⣿⣿⡏⢰⣿⠖⣠⣿⡆⠈⣿⣿ ⣿⢛⣵⣄⠙⣶⣶⡟⣅⣠⠹⣿ ⣿⣜⣛⠻⢎⣉⣉⣀⠿⣫⣵⣿