Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp59626pxh; Thu, 7 Apr 2022 13:57:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvTkDGjhj3PtrWLfSyJQ9lV+vWve/u+vU/QflnR0v3nuyvssK9Npbg7U0QTY814+CNrrac X-Received: by 2002:a17:90b:16ca:b0:1ca:b25d:cc67 with SMTP id iy10-20020a17090b16ca00b001cab25dcc67mr17984916pjb.183.1649365077581; Thu, 07 Apr 2022 13:57:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649365077; cv=none; d=google.com; s=arc-20160816; b=Q2brrxorqca6pMM2IkNo/EW5akrgv6vB1EEA4Z/vWPmPBuRQqKBFG39VfbOtamnYb5 62/PYMdrlpGCaeNWQPZO1nXGE94YR7Nq2KKHAKywTzN0jR8FpRJz7vCdT8I2Z2bUQgxM IwbMVF/pO5sl3YqcxkFjHxb5yBbP+edmgu6615IL8m/voPcyu3flL15Jf/I/P6kBKWaa JmIv0mdh+tCvh40Z96rHtsYgOGr+yLF6HEblqpdWewxTbNvkx3waaAr7GYnWwkKQj1rt X0lV1Uj5YWvAJ7Nw/orw2Dz8jn8qtxJ8sBLjozyvBTlficJh98ZY4IHw0CkTaTndJT5Q yQhQ== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=67XBiQ4b5r7/eKNYuq37tq0WAK0LsGiFSwZirYwoTqA=; b=aFWztmHIBcSf98+kGJCuRAYU03l+Vtg6PuRKeNFiOfWd6GZOc65mzIoaWxl6BkiHvS dMJloqbbIRFl+e2D8p+4QCrZ+n6SHZs/M66t8Q9NpSKr6ekf47EWEhp38UIC/DN4ARh4 UYB3BV9s7vY7FaJuKW5b9rd0J22Bctvf5h70jPkQfW1W31xc+PcfQCHesJOzAUJpG+EI WiqiRYRBeFx6SUgMrczKaet00NePv7N7OTzcBgr8bnjShyeNSkLkdaxGZ+7xyXbPoUz5 /SUEJ6FuawMeGhj9+nfcjVoAd3v5SQMYu1qTcDOobPKJwFsw8MTFcM0G6EfY64V1CeQ0 hevQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ilcES6Mx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q18-20020a63f952000000b003816043f12esi20418784pgk.803.2022.04.07.13.57.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:57:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ilcES6Mx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E095B413A96; Thu, 7 Apr 2022 13:00:45 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241947AbiDGRQk (ORCPT + 99 others); Thu, 7 Apr 2022 13:16:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56306 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230329AbiDGRQi (ORCPT ); Thu, 7 Apr 2022 13:16:38 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EAD8131961 for ; Thu, 7 Apr 2022 10:14:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E8FA4B8254E for ; Thu, 7 Apr 2022 17:14:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2F31C385A4; Thu, 7 Apr 2022 17:14:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649351673; bh=VtyFx1mE/jimFv03f6Qz18sNrWKaGRHtMcWgdHvNHrU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ilcES6Mxll3vhWBEQtYAqnQ7CFAGgtXF8Nj1+KT+hKWXB77102gFcxaJ0pYZuxg6H 9XjwNNxT97n12yN+bybdlbZJMlXbqxnWk2d0jrMaEY/OoLd7cR0yaebdx8zNywPlzp i3qHkM3+bdmMGFMtOPWmpceBambyZsrqdA+D7FNYWb+MxupbNUJjZejIZj+wEES7FC yxQPVofhcyBb1+C4oOksJrSYrmO5kFZvnDt5mresNurC+y+GSz69/e4AnV4vJ5/EOd uzpCuW/u4zW/kiDwJkaO8m2pXzM8YKL3nBshACr5cdHojMN7hQpy4cbQ80DZomKCB0 mCcPMbV0CQTyA== Date: Thu, 7 Apr 2022 10:14:31 -0700 From: Nathan Chancellor To: Sedat Dilek Cc: Arnaldo Carvalho de Melo , Adrian Hunter , Fangrui Song , Florian Fainelli , Ian Rogers , Jiri Olsa , John Keeping , Leo Yan , Michael Petlan , Namhyung Kim , Nick Desaulniers , Linux Kernel Mailing List Subject: Re: Build perf with clang, failure with libperf Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 07, 2022 at 06:25:29PM +0200, Sedat Dilek wrote: > On Thu, Apr 7, 2022 at 5:03 PM Nathan Chancellor wrote: > > > > On Thu, Apr 07, 2022 at 12:27:14PM +0200, Sedat Dilek wrote: > > > On Mon, Apr 4, 2022 at 11:53 PM Nathan Chancellor wrote: > > > > > > > > Hi Arnaldo, > > > > > > > > On Mon, Apr 04, 2022 at 05:43:11PM -0300, Arnaldo Carvalho de Melo wrote: > > > > > Hi, > > > > > > > > > > Trying to apply Sedat's patch something changed in my system, > > > > > and that patch wasn't enough, so I had to first apply this one: > > > > > > > > > > commit 173b552663419f40bcd3cf9df4f68285cac72727 > > > > > Author: Arnaldo Carvalho de Melo > > > > > Date: Mon Apr 4 17:28:48 2022 -0300 > > > > > > > > > > tools build: Use $(shell ) instead of `` to get embedded libperl's ccopts > > > > > > > > > > Just like its done for ldopts and for both in tools/perf/Makefile.config. > > > > > > > > > > Using `` to initialize PERL_EMBED_CCOPTS somehow precludes using: > > > > > > > > > > $(filter-out SOMETHING_TO_FILTER,$(PERL_EMBED_CCOPTS)) > > > > > > > > > > And we need to do it to allow for building with versions of clang where > > > > > some gcc options selected by distros are not available. > > > > > > > > > > Cc: Adrian Hunter > > > > > Cc: Fangrui Song > > > > > Cc: Florian Fainelli > > > > > Cc: Ian Rogers > > > > > Cc: Jiri Olsa > > > > > Cc: John Keeping > > > > > Cc: Leo Yan > > > > > Cc: Michael Petlan > > > > > Cc: Namhyung Kim > > > > > Cc: Nathan Chancellor > > > > > Cc: Nick Desaulniers > > > > > Cc: Sedat Dilek > > > > > Signed-off-by: Arnaldo Carvalho de Melo > > > > > > > > > > diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile > > > > > index 1480910c792e2cb3..90774b60d31b2b8e 100644 > > > > > --- a/tools/build/feature/Makefile > > > > > +++ b/tools/build/feature/Makefile > > > > > @@ -217,7 +217,7 @@ strip-libs = $(filter-out -l%,$(1)) > > > > > PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null) > > > > > PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS)) > > > > > PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS)) > > > > > -PERL_EMBED_CCOPTS = `perl -MExtUtils::Embed -e ccopts 2>/dev/null` > > > > > +PERL_EMBED_CCOPTS = $(shell perl -MExtUtils::Embed -e ccopts 2>/dev/null) > > > > > FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) > > > > > > > > > > $(OUTPUT)test-libperl.bin: > > > > > > > > > > ----------------------------------------------------- 8< ------------------- > > > > > > > > > > After this I go on filtering out some of the gcc options that clang > > > > > doesn't grok: > > > > > > > > > > diff --git a/tools/build/feature/Makefile b/tools/build/feature/Makefile > > > > > index 90774b60d31b2b8e..bbc5e263e02385ed 100644 > > > > > --- a/tools/build/feature/Makefile > > > > > +++ b/tools/build/feature/Makefile > > > > > @@ -215,9 +215,12 @@ grep-libs = $(filter -l%,$(1)) > > > > > strip-libs = $(filter-out -l%,$(1)) > > > > > > > > > > PERL_EMBED_LDOPTS = $(shell perl -MExtUtils::Embed -e ldopts 2>/dev/null) > > > > > +PERL_EMBED_LDOPTS := $(filter-out -specs=%,$(PERL_EMBED_LDOPTS)) > > > > > PERL_EMBED_LDFLAGS = $(call strip-libs,$(PERL_EMBED_LDOPTS)) > > > > > PERL_EMBED_LIBADD = $(call grep-libs,$(PERL_EMBED_LDOPTS)) > > > > > PERL_EMBED_CCOPTS = $(shell perl -MExtUtils::Embed -e ccopts 2>/dev/null) > > > > > +PERL_EMBED_CCOPTS := $(filter-out -ffat-lto-objects, $(PERL_EMBED_CCOPTS)) > > > > > +PERL_EMBED_CCOPTS := $(filter-out -specs=%,$(PERL_EMBED_CCOPTS)) > > > > > FLAGS_PERL_EMBED=$(PERL_EMBED_CCOPTS) $(PERL_EMBED_LDOPTS) > > > > > > > > > > $(OUTPUT)test-libperl.bin: > > > > > > > > > > ----------------------------------------------------- 8< ------------------- > > > > > > > > > > And then get to the problems at the end of this message, which seem > > > > > similar to the problem described here: > > > > > > > > > > From Nathan Chancellor <> > > > > > Subject [PATCH] mwifiex: Remove unnecessary braces from HostCmd_SET_SEQ_NO_BSS_INFO > > > > > > > > > > https://lkml.org/lkml/2020/9/1/135 > > > > > > > > > > So perhaps in this case its better to disable that > > > > > -Werror,-Wcompound-token-split-by-macro when building with clang? > > > > > > > > Yes, I think that is probably the best solution. As far as I can tell, > > > > at least in this file and context, the warning appears harmless, as the > > > > "create a GNU C statement expression from two different macros" is very > > > > much intentional, based on the presence of PERL_USE_GCC_BRACE_GROUPS. > > > > The warning is fixed in upstream Perl by just avoiding creating GNU C > > > > statement expressions using STMT_START and STMT_END: > > > > > > > > https://github.com/Perl/perl5/issues/18780 > > > > https://github.com/Perl/perl5/pull/18984 > > > > > > > > If I am reading the source code correctly, an alternative to disabling > > > > the warning would be specifying -DPERL_GCC_BRACE_GROUPS_FORBIDDEN but it > > > > seems like that might end up impacting more than just this site, > > > > according to the issue discussion above. > > > > > > > > > > Thanks for the pointer Nathan. > > > > > > As said I hit the problem with Debian's perl v5.34. > > > > > > Checking perl5 Git reveals: > > > > > > "skip using gcc brace groups for STMT_START/END" > > > https://github.com/Perl/perl5/commit/7169efc77525df70484a824bff4ceebd1fafc760 > > > > GitHub says this is in 5.35.2, so it would make sense that 5.34 still > > shows the issue. > > > > > "Partially Revert "skip using gcc brace groups for STMT_START/END"" > > > https://github.com/Perl/perl5/commit/e08ee3cb66f362c4901846a46014cfdfcd60326c > > > > > > Perl v5.34.x seems not to have these changes: > > > https://github.com/Perl/perl5/compare/v5.34.0...v5.34.1 > > > > > > Unsure if there exists a real fix for perl5. > > > > Perhaps those two changes could be cherry-picked into Debian's 5.34. I > > have no idea if that is possible though. > > > > What perl5 version has Arch Linux? $ pacman -Q perl perl 5.34.1-1 It appears that 5.35 is the development version, which I suppose means we won't see this fix widely available for some time: https://www.nntp.perl.org/group/perl.perl5.porters/2022/03/msg263388.html > Do you see the issue and need -Wno-compound-token-split-by-macro? I don't build perf but given the above information, I suspect I would need that flag as well. Cheers, Nathan