Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp2229851pxu; Fri, 9 Oct 2020 11:04:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh/vL6aj/C7PMdgYwcCFG9hOdcIyp40LwKWK3oMnfoEdYxmc1M1UXR/ck0gTQ6t0sMwsXh X-Received: by 2002:a17:906:7254:: with SMTP id n20mr14807553ejk.382.1602266657562; Fri, 09 Oct 2020 11:04:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602266657; cv=none; d=google.com; s=arc-20160816; b=sDXvQhdLliD3gKYk2yhvHo9sQVMKXAtz3f3MIngarkdZboJAdnFImwihcxe5Jp0H5t 9twEQ0KJxQCCqz0Dv9s85eqVgh3SAOnBoMK6sY/HJZD9UqJs6kzdASEfzCHwB7JoDP1T n9OCOQBHXp7I3fLpUj7qfIejq042zRSjeuULRGfOdBeOh/TKa5g57RuBecIjdyjCvJJg 2A81hs0GeDHrUS+zi9+veN4uvVinBFVG0Q/R9LPDeQHv2yb42qs36we4xRaqvXogPWld yXNDS/CvyErI2iJMwMuLsWpTyz5hlqGL0+VZn4IKlAKYvMDZRfyl3Ivlz2hR1h124a8R UgWw== 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=WJdri2oZoNVHxIAcqLLd1XqQYsP87sfa6ccUO/06Bx8=; b=yTohd08Q5pWrzpzaMu4q42Esq3L1fNOtKEGMMWvMrRKA7WAVMwv797HI7V8RQKoK4n 6d5imVgne5VhFR54Ffg9zZO2bihmZmqS2dLzTtkOCwMRhX146n283K4O1tk5BaleicRW NXm3dHMtAys5lkMrl3nVkf07OyOv2WX3EBCgiExA9+nUkSXisV/K8nYEbusoinhnxpG6 ZHbi8Z3EI9Kg2+9y4dQ6mbuiwGFwN3G+8Vj58t5vweIoJAbfwowRkmwEEzuFdlvihMaP aeSVH8/7jCnCMXRSS7OyQXcAaPjASyP5ugeO7kvGI5d1Z7kd++XYwjWm2VWwiYBCod/t yNxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=I7GpRWv4; 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si6199652eds.558.2020.10.09.11.03.54; Fri, 09 Oct 2020 11:04:17 -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=@redhat.com header.s=mimecast20190719 header.b=I7GpRWv4; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388058AbgJILXj (ORCPT + 99 others); Fri, 9 Oct 2020 07:23:39 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:23972 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732637AbgJILXj (ORCPT ); Fri, 9 Oct 2020 07:23:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1602242617; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WJdri2oZoNVHxIAcqLLd1XqQYsP87sfa6ccUO/06Bx8=; b=I7GpRWv4Zzfgdkzg++YdC4AHjWxrUMLWCX+WmqBcZ6cEaCLXiYNFAQHSAMCdox2WFdABut V3TsAts78n+kSYSUOUqAAHsNk+Sf4dp5iT8hjcDjFZTp54fdY3NlXxMgnjSxHk6rkVxW1A OvKMX+7rlXEEG/biTpPYgVL+32ufskM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-405-UloWVlHdOoWuW2NlJ9hzUw-1; Fri, 09 Oct 2020 07:23:33 -0400 X-MC-Unique: UloWVlHdOoWuW2NlJ9hzUw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B079D80401F; Fri, 9 Oct 2020 11:23:31 +0000 (UTC) Received: from krava (unknown [10.40.195.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 19B2F75124; Fri, 9 Oct 2020 11:23:27 +0000 (UTC) Date: Fri, 9 Oct 2020 13:23:27 +0200 From: Jiri Olsa To: Vasily Gorbik Cc: Arnaldo Carvalho de Melo , Josh Poimboeuf , Peter Zijlstra , Stephen Rothwell , Ingo Molnar , Thomas Gleixner , Mark Rutland , Alexander Shishkin , Namhyung Kim , "H. Peter Anvin" , Masami Hiramatsu , Linux Kernel Mailing List , Linux Next Mailing List Subject: Re: [PATCH 1/1] perf build: Allow nested externs to enable BUILD_BUG() usage Message-ID: <20201009112327.GC656950@krava> 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-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 09, 2020 at 08:47:45AM +0200, Vasily Gorbik wrote: > 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)) looks good, but I can't apply the patch with 'git am' Applying: perf build: Allow nested externs to enable BUILD_BUG() usage error: patch failed: tools/perf/Makefile.config:16 error: tools/perf/Makefile.config: patch does not apply Patch failed at 0001 perf build: Allow nested externs to enable BUILD_BUG() usage hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort". I wonder it's that picture at the bottom ;-) jirka > > include $(srctree)/tools/scripts/Makefile.arch > > -- > ⣿⣿⣿⣿⢋⡀⣀⠹⣿⣿⣿⣿ > ⣿⣿⣿⣿⠠⣶⡦⠀⣿⣿⣿⣿ > ⣿⣿⣿⠏⣴⣮⣴⣧⠈⢿⣿⣿ > ⣿⣿⡏⢰⣿⠖⣠⣿⡆⠈⣿⣿ > ⣿⢛⣵⣄⠙⣶⣶⡟⣅⣠⠹⣿ > ⣿⣜⣛⠻⢎⣉⣉⣀⠿⣫⣵⣿