Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp52751pxh; Thu, 7 Apr 2022 13:43:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx22qH9uRPeWqCWZC32sPyCVIrn2fFxOo+cp+lVAbUDNObIa7Mgd2v8hBSliRUuo+LkHOnP X-Received: by 2002:a17:90b:4ac9:b0:1c9:a345:6b9a with SMTP id mh9-20020a17090b4ac900b001c9a3456b9amr17690505pjb.118.1649364233755; Thu, 07 Apr 2022 13:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649364233; cv=none; d=google.com; s=arc-20160816; b=AnuLy53mV/XONLHi0ksXNuyiDakhR1VBnwnZIur+O06AWn/qAnKIdO9jiMMoY+++8H IDINSGF3I+Bte/ljgejMLkiXC3xmCcFS7jYze2iuVpHpeRgZA07vUXB1J8ShNQRVnPyO c2u/bp95VbtVbUd7gWugwvHYsUlqZFsoeEKPof+SnMMeyUnmz5JYClyLoTweDcJDHNQO U4AOytuFT2Y8zlkW9YaG/Q+QGCacNDh33IWvrG/B/5swV1EcvTSsDTUZ5fxRP75pESVu d58QlPQrj6NUqgcT2WU7sy52oys1CLOLzMCk0CZL9tVVcWPHPh76AKRalvElwIfIyez/ gtSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:reply-to :in-reply-to:references:mime-version:dkim-signature; bh=v3QsCIzdisYUuLiLnQmDzSoYwLmc15gSRevZBaOPZZs=; b=YdUSUDp9rTIdUGhJNSjPVrR3KrGUl020aA80Ln4Sl30YU5i/rnnXScN3z74KQA7z95 k4/uRmMU+PEW97dFCWvA6bTpq9Cy1AC+YqlkKdrOZ4VisOD8KVocGy6j/a1EvbkIdCc9 1JeK3QcGz9U+jKqZQSKViLNVYuM9PjBD8umlle/bUyhEgu7cxNFw5ACkbrKBdC/malFU yzKgA/tjCuUrSMOX7mlUyDvIc/DQK2u8Hm1PwEFzTj3VbRgI0c0JWE05Sf2jDpppjqNQ JbwQrh2sUSpj8BIcewDqzfyn3sFwsmi8HFBKU+nhdhhBc1mIPOaCIFM+XxndXWmqEp5t thZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="CXYJO/5m"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k17-20020a170902f29100b00156647ce264si555965plc.315.2022.04.07.13.43.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:43:53 -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=@gmail.com header.s=20210112 header.b="CXYJO/5m"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 797A23C8D73; Thu, 7 Apr 2022 12:52:42 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241099AbiDGQ2O (ORCPT + 99 others); Thu, 7 Apr 2022 12:28:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230077AbiDGQ2M (ORCPT ); Thu, 7 Apr 2022 12:28:12 -0400 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0608CD83 for ; Thu, 7 Apr 2022 09:26:12 -0700 (PDT) Received: by mail-io1-xd36.google.com with SMTP id e22so7372008ioe.11 for ; Thu, 07 Apr 2022 09:26:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:reply-to:from:date:message-id :subject:to:cc; bh=v3QsCIzdisYUuLiLnQmDzSoYwLmc15gSRevZBaOPZZs=; b=CXYJO/5mj7iipjwJ/N7st49ebCvCj+NbvMTUFpbolabKTZ+BG4gMngfN/VdrxrGE+S A/dFI5lB8cza04pEgNFVmVZTnkKoi4POAmbaGpjCsXlwbzYKr8ZwvaB5SgMCoT6zkIeF FhITGYUYGgOvQFi/8upbolv8SgJHATOV5pzm6T2Vh3Yk3Drc33dRuCFOjVOg5Q+lDcpg G9sSt+jWhiX59K3KIXBqa7QgmWqjCaYAGaGqWrUYzB7iKS+0bcovdKWY09mnHponESOV bDI136WAZrty3agvghO8cAEOY4+Z2rUQx2nDQcMDe9DtSUK8HeSV2MfDnETqWe+nNT7M PLNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:reply-to :from:date:message-id:subject:to:cc; bh=v3QsCIzdisYUuLiLnQmDzSoYwLmc15gSRevZBaOPZZs=; b=wf8/u2zyNAlLI0pur8S9A+ERJosiNZ0q5MwVxd4NJg5V+UgjC+v3YQcH43FfWJkE8Z ZuFYPYQykZKmmX0C52bY7bwfd2dW3VRKThpFPfRTx5VwdrPsvzBhau1nry09ZXjhiXHy cnQf5SZDFP6RJ9xs+GjuU9/Y7q/u/dQvlNjIzqdaiM6jBEYXB6L57j+6ePyeZPGtA6fM ZGZLQrKBR4o55dXR/X20GKfprOhrQshA4ygcPfOj8Aec6IrYswqoMc1FhC0ymIk4qaZc ol5tTAFr8mIY5Ik9PqRgqd60cCzCCAglT/3Q6WzK0IkTjj8LOk/X3CTDWHHmEcLWMzlr Hl0Q== X-Gm-Message-State: AOAM5310XAe7NuuetlkGL+CDOE/9WVZOgcsjshR/F30wBjciQioKQm2v 7Kk8MwZmg90ksyzzoVpJAwzzDOOdf5RtYZw3f4w= X-Received: by 2002:a6b:8f15:0:b0:645:dfdb:7a35 with SMTP id r21-20020a6b8f15000000b00645dfdb7a35mr6224956iod.36.1649348765897; Thu, 07 Apr 2022 09:26:05 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Reply-To: sedat.dilek@gmail.com From: Sedat Dilek Date: Thu, 7 Apr 2022 18:25:29 +0200 Message-ID: Subject: Re: Build perf with clang, failure with libperf To: Nathan Chancellor 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 Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no 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 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? Do you see the issue and need -Wno-compound-token-split-by-macro? - Sedat -