Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1220777rdh; Fri, 27 Oct 2023 08:00:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFV9lEeIj6U3/4xxvUJQfQ3dpI/59mxCyJEMr9lGgSV9wSj0tVRt8lqW6ozQgGQwptv2C+v X-Received: by 2002:a25:d190:0:b0:d9b:96e4:4a7d with SMTP id i138-20020a25d190000000b00d9b96e44a7dmr2974660ybg.47.1698418851535; Fri, 27 Oct 2023 08:00:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698418851; cv=none; d=google.com; s=arc-20160816; b=g23Q4JZrOKPjnJm/AouVJnFIs6i4nZnhzUVqogs4zO0IZfq0JyAt6BqlSZ4wkKj2+S kEJdzqTnH45WkYPpEBMcBeaO14BcO10tqrTTcgpAVFl8R3HSfoPdTb7ceHbF93OcVhOl QfRuemqxlm+vf9mY9ofxq8Z8wyEwVoVYCOtDKTaJygfzvYnn2BeARhf392Iv2fn9Kzlh gD99DhnPOm2+/x72t2KoKm0+wPaGR5SxfwpCz7//vi2jvu5W+MG9/XenPE4O71wO+2gR 64eujEHqx8esMa1Yqr54LLzEBoEuQup8jMV9SMhbnavm3ocB4Z9Do2hqh2jD5HMMClLa qOBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=In2w2XAnYFFzI3oDxSHEa9Ny2CIQ+xaG4Im4ZzOyKqU=; fh=sFCUbrW348x/QcW3jFfRR3EmcTqV25lTgrk0hb8cw+o=; b=Mkm6iu7z2HUajJZnI2k5cfVuyPTe89Su/lc/nTr7qSRAceRQGt0GXjz/ZRdGN82rID ZP27GjGpCFamVrGZujlG16p0nlyKuyob/d8i0E8Ftge7EXBCpP8YIWrPB323UzD0X6BJ d4/Uw80sKslUZHIWJJrDcG4/mI/NI6cs9aUUkWogIypYXYeJlee2GJU87WZ4ESj8biMt xqAy57vEhqKCBaIq4tstJbiOlULvGJn/lXJa1oePIQDUguVpxDULMwpjck1iFwEuNa1W HCmcE9mshO8RIE86p6UKikw3XvSw2YfeN0KOLD+mAWJOg74+tfKBam7YiohXLxX/MdD7 q6XQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=FlEijclt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id f2-20020a5b0d42000000b00d9a681e563esi2569961ybr.244.2023.10.27.08.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 08:00:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=FlEijclt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 820CD80CF506; Fri, 27 Oct 2023 08:00:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346167AbjJ0PAX (ORCPT + 99 others); Fri, 27 Oct 2023 11:00:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345833AbjJ0PAV (ORCPT ); Fri, 27 Oct 2023 11:00:21 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7510D128 for ; Fri, 27 Oct 2023 08:00:18 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-408c6ec1fd1so66455e9.1 for ; Fri, 27 Oct 2023 08:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1698418817; x=1699023617; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=In2w2XAnYFFzI3oDxSHEa9Ny2CIQ+xaG4Im4ZzOyKqU=; b=FlEijcltFgz485hcnEWkN3Cg8cNf4sMAczZuzLyot9khuMVyNelf7XeAnvNGBQCrhu dbx4xpuXp84OlLwhlmtGbUo1p6qE6tReBVUAC7U0InY9AdqaLEH7BkQ3UAWgYmplZwzQ PTVj4jsv7vhqfSc2/lNF3111VaVkzjuJOdmSeX/c9ybCfV1XEKDD53lVRh7Lm9FadfuL 7qjRFoMsCYIUOgfG+z1Pe1hR5rIgk2kGyFZ4jA1sZlQjjYp/XHv4MMTMB3G8ogXqcnRe UCHITDOq0QwNpz5iEyzmQZTGtEKMuma5+bdqL1OSEhZ3JeEtdYd1jMJIKofT0nWXCQMC tjtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698418817; x=1699023617; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=In2w2XAnYFFzI3oDxSHEa9Ny2CIQ+xaG4Im4ZzOyKqU=; b=rnRpGYooSRuqlA0FgL7kkHX9m7SIp7TqtsZiWFAlms6ut+eND+d0E8yshLUcYG/3fu ScTbVUirZRFtyHvFjcS6cgzUYD4jmO/HIcdmvsZ5QHseD3Dt7EyeF2OBJkGCNZpMvetB /VzLBzqU1+HWRGIP2iVZvyFiJl1G4i2AbI4YXOVCgNvaDsYJZKUWOT6CvTubphUljtq5 ZI69NzbuVpowi4nw/BFS6yhalyMMI5nU6pW+zjoQLuGPehdRs2PclDjdZFZi1MSBhc4D dojAYqaTGuL+z9k2AB4byc2eiOoNyYlREcWHwMV6i9b/qLpOoKVZ//P9zaJTME1wJFTQ L+vg== X-Gm-Message-State: AOJu0Yy1ySkj+fITExNw15RvW3SOwcK2p6lYHc+puhcgEOE5Q8NqWGGt jAn+MCO/OzPH92eLVS5497CBwrke4rnqGAktvNzuLw== X-Received: by 2002:a05:600c:1d95:b0:3fe:e9ea:9653 with SMTP id p21-20020a05600c1d9500b003fee9ea9653mr114964wms.4.1698418816657; Fri, 27 Oct 2023 08:00:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ian Rogers Date: Fri, 27 Oct 2023 08:00:05 -0700 Message-ID: Subject: Re: [PATCH 1/1] perf build: Disable BPF skeletons if clang version is < 12.0.1 To: Arnaldo Carvalho de Melo Cc: Namhyung Kim , Adrian Hunter , Jiri Olsa , Linux Kernel Mailing List , linux-perf-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 27 Oct 2023 08:00:39 -0700 (PDT) On Fri, Oct 27, 2023 at 7:18=E2=80=AFAM Arnaldo Carvalho de Melo wrote: > > While building on a wide range of distros and clang versions it was > noticed that at least version 12.0.1 (noticed on Alpine 3.15 with > "Alpine clang version 12.0.1") is needed to not fail with BTF generation > errors such as: > > Debian:10 > > Debian clang version 11.0.1-2~deb10u1: > > CLANG /tmp/build/perf/util/bpf_skel/.tmp/sample_filter.bpf.o > > GENSKEL /tmp/build/perf/util/bpf_skel/sample_filter.skel.h > libbpf: failed to find BTF for extern 'bpf_cast_to_kern_ctx' [21] secti= on: -2 > Error: failed to open BPF object file: No such file or directory > make[2]: *** [Makefile.perf:1121: /tmp/build/perf/util/bpf_skel/sample_= filter.skel.h] Error 254 > make[2]: *** Deleting file '/tmp/build/perf/util/bpf_skel/sample_filter= .skel.h' > > Amazon Linux 2: > > clang version 11.1.0 (Amazon Linux 2 11.1.0-1.amzn2.0.2) > > GENSKEL /tmp/build/perf/util/bpf_skel/sample_filter.skel.h > libbpf: elf: skipping unrecognized data section(18) .eh_frame > libbpf: elf: skipping relo section(19) .rel.eh_frame for section(18) .e= h_frame > libbpf: failed to find BTF for extern 'bpf_cast_to_kern_ctx' [21] secti= on: -2 > Error: failed to open BPF object file: No such file or directory > make[2]: *** [/tmp/build/perf/util/bpf_skel/sample_filter.skel.h] Error= 254 > make[2]: *** Deleting file `/tmp/build/perf/util/bpf_skel/sample_filter= .skel.h' > > Ubuntu 20.04: > > clang version 10.0.0-4ubuntu1 > > CLANG /tmp/build/perf/util/bpf_skel/.tmp/augmented_raw_syscalls.bpf= .o > GENSKEL /tmp/build/perf/util/bpf_skel/bench_uprobe.skel.h > GENSKEL /tmp/build/perf/util/bpf_skel/bperf_leader.skel.h > libbpf: sec '.reluprobe': corrupted symbol #27 pointing to invalid sect= ion #65522 for relo #0 > GENSKEL /tmp/build/perf/util/bpf_skel/bperf_follower.skel.h > Error: failed to open BPF object file: BPF object format invalid > make[2]: *** [Makefile.perf:1121: /tmp/build/perf/util/bpf_skel/bench_u= probe.skel.h] Error 95 > make[2]: *** Deleting file '/tmp/build/perf/util/bpf_skel/bench_uprobe.= skel.h' > > So check if the version is at least 12.0.1 otherwise disable building > BPF skels and provide a message about it, continuing the build. > > The message, when running on amazonlinux:2: > > Makefile.config:698: Warning: Disabled BPF skeletons as reliable BTF ge= neration needs at least clang version 12.0.1 > > Cc: Adrian Hunter > Cc: Ian Rogers > Cc: Jiri Olsa > Cc: Namhyung Kim > Signed-off-by: Arnaldo Carvalho de Melo Reviewed-by: Ian Rogers Thanks, Ian > --- > tools/perf/Makefile.config | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config > index 4300a9e4253a0c87..8b6cffbc485834c8 100644 > --- a/tools/perf/Makefile.config > +++ b/tools/perf/Makefile.config > @@ -693,6 +693,13 @@ ifeq ($(BUILD_BPF_SKEL),1) > dummy :=3D $(warning Warning: Disabled BPF skeletons as clang ($(CLA= NG)) is missing) > BUILD_BPF_SKEL :=3D 0 > else > + CLANG_VERSION :=3D $(shell $(CLANG) --version | head -1 | sed 's/.*c= lang version \([[:digit:]]\+.[[:digit:]]\+.[[:digit:]]\+\).*/\1/g') > + ifeq ($(call version-lt3,$(CLANG_VERSION),12.0.1),1) > + dummy :=3D $(warning Warning: Disabled BPF skeletons as reliable B= TF generation needs at least $(CLANG) version 12.0.1) > + BUILD_BPF_SKEL :=3D 0 > + endif > + endif > + ifeq ($(BUILD_BPF_SKEL),1) > $(call feature_check,clang-bpf-co-re) > ifeq ($(feature-clang-bpf-co-re), 0) > dummy :=3D $(warning Warning: Disabled BPF skeletons as clang is t= oo old) > -- > 2.41.0 >