Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp624176rdb; Thu, 19 Oct 2023 14:17:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHhVBkV2lauxWgZB7yF1S8rMPL8cQmKmeEMFXJb/1ek+XEXf3NfA1mbz0hFic3EYMdwb4nX X-Received: by 2002:a05:6a20:160d:b0:15e:e0fd:98e7 with SMTP id l13-20020a056a20160d00b0015ee0fd98e7mr4250864pzj.20.1697750274436; Thu, 19 Oct 2023 14:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697750274; cv=none; d=google.com; s=arc-20160816; b=tbiqwwmiYlVrTVDIbMweAojPXxx/VZmRdeE/gGV9d7JpyBzxFO6ijnoW/L3jYK2nuF CZEoU+FyvStlEJRqra0naxw6iJwdnC3OSX9pT3ucYjIMemZoaY/6yjrpZ6wi6hD5ZrP2 woCW2PzeXHyvq+C7CvtC+h23edSjt8eVDhqyUhMESNWJZBUqL5d6c9zrvE/2xiB3/5ZA n83uAnB8JZueGQbFmAVFxucPwG8Pztj5f9fdfQ6t60q7O0afjfHcXIi1n9BnCw3ss1S6 /7qk/6KjmT4DHHNAqfiBfDfMXXtiVAI0slANn2EIW/IvL4yckgv+9bfmf1e0mkfq/vb4 K/Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=b6+mZ4fXrq1qe29exux2uJ/KdE8wmjFm0MoWQyI3vIk=; fh=SIz8bHRgaaDOKi3At/rVWxDn4ucF7JwVBko7KARUnWo=; b=YXsGWTUxGXvl0/oqUuI7zr5ZVzBi1abDeRFMli8oH2o+7jmlsu0rNlz3OA8gS7A5z1 suxrNj9SDROfG26fHFfXPB69nklng2kLRYqYCDKRn1WPgefQnb3GqvaKuhG8yy/75jSf YI8uogNCpJHo+3Zslcc9rZ/EGBKVWyehh+4GkmEAk5qU4E2aza6p1uEc7Clm2afUG0G6 CYQHhilcz4vBbXbno/2OOAoUwuKqYGQkZ5HaCBGl5Vgi5hyzgX7AxFTfyxb9XVZjqsCI IVZee+cY7yCMZ7udBhVcWgZXVulqMJ3jqvhjBinRYj01LQ6tKbM1E9I8qy7vd7xdjXgv nSjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="DQy4c/qS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id r198-20020a632bcf000000b005acd2009192si480884pgr.13.2023.10.19.14.17.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 14:17:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="DQy4c/qS"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 697DB82F2C6B; Thu, 19 Oct 2023 14:17:51 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233303AbjJSVRo (ORCPT + 99 others); Thu, 19 Oct 2023 17:17:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231495AbjJSVRn (ORCPT ); Thu, 19 Oct 2023 17:17:43 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6DB1114 for ; Thu, 19 Oct 2023 14:17:41 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1613BC433C8; Thu, 19 Oct 2023 21:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697750261; bh=UbRSZc6crtgCeY0MRdsWT/KJ2XCs7EiHnMiSLAyYy50=; h=Date:From:To:Cc:Subject:From; b=DQy4c/qS73NJUZKGInjpVlY45mpKWBWu/lp8LDxM6/JBOKM4vAt/1U6wu2d7ez6Z/ +9Bwgeju4qEt/0xwW4HpV2yAvEBSkzRXDB/88sj3lI+f3gF/KMq1qwI0rwzrA8oxBp Aic3meb9N7VfTpGj4Fe3mMgttZLbbziRTBBDz/2VgWjadletAP0KNkgtk/sq3MIQub k+IfR4NOoUAUvOdbZVfPYp2DxEDUpZ3j5WBOzwpPTdmz09UXQjtae2AQaRKvxSkKyQ T6pilfQW4bPVhntuHZV1Kta/jSMEnoWNjOY0cb5QKFTF2TMTaW/rxu7epJXMbb3yEh i5IgmlP5tz0Aw== Received: by quaco.ghostprotocols.net (Postfix, from userid 1000) id 976C140016; Thu, 19 Oct 2023 18:17:37 -0300 (-03) Date: Thu, 19 Oct 2023 18:17:37 -0300 From: Arnaldo Carvalho de Melo To: linux-kernel@vger.kernel.org, Manu Bretelle Cc: Adrian Hunter , Alexander Shishkin , Andi Kleen , Andrii Nakryiko , Anshuman Khandual , Carsten Haitzler , Eduard Zingerman , Fangrui Song , He Kuang , Ian Rogers , Ingo Molnar , James Clark , Jiri Olsa , Kan Liang , Leo Yan , llvm@lists.linux.dev, Madhavan Srinivasan , Mark Rutland , Namhyung Kim , Nathan Chancellor , "Naveen N. Rao" , Nick Desaulniers , Peter Zijlstra , Quentin Monnet , Ravi Bangoria , Rob Herring , Tiezhu Yang , Tom Rix , Wang Nan , Wang ShaoBo , Yang Jihong , Yonghong Song , YueHaibing , linux-perf-users@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH 1/1] tools build: Fix llvm feature detection, still used by bpftool Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Thu, 19 Oct 2023 14:17:52 -0700 (PDT) When removing the BPF event for perf a feature test that checks if the llvm devel files are availabe was removed but that is also used by bpftool. bpftool uses it to decide what kind of disassembly it will use: llvm or binutils based. Removing the tools/build/feature/test-llvm.cpp file made bpftool to always fallback to binutils disassembly, even with the llvm devel files installed, fix it by restoring just that small test-llvm.cpp test file. Fixes: 56b11a2126bf2f42 ("perf bpf: Remove support for embedding clang for compiling BPF events (-e foo.c)") Reported-by: Manu Bretelle Cc: Adrian Hunter Cc: Alexander Shishkin Cc: Andi Kleen Cc: Andrii Nakryiko Cc: Anshuman Khandual Cc: Carsten Haitzler Cc: Eduard Zingerman Cc: Fangrui Song Cc: He Kuang Cc: Ian Rogers Cc: Ingo Molnar Cc: James Clark Cc: Jiri Olsa Cc: Kan Liang Cc: Leo Yan Cc: llvm@lists.linux.dev Cc: Madhavan Srinivasan Cc: Mark Rutland Cc: Namhyung Kim Cc: Nathan Chancellor Cc: Naveen N. Rao Cc: Nick Desaulniers Cc: Peter Zijlstra Cc: Quentin Monnet Cc: Ravi Bangoria Cc: Rob Herring Cc: Tiezhu Yang Cc: Tom Rix Cc: Wang Nan Cc: Wang ShaoBo Cc: Yang Jihong Cc: Yonghong Song Cc: YueHaibing Link: https://lore.kernel.org/lkml/ZTGa0Ukt7QyxWcVy@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/build/feature/test-llvm.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tools/build/feature/test-llvm.cpp diff --git a/tools/build/feature/test-llvm.cpp b/tools/build/feature/test-llvm.cpp new file mode 100644 index 0000000000000000..88a3d1bdd9f6978e --- /dev/null +++ b/tools/build/feature/test-llvm.cpp @@ -0,0 +1,14 @@ +// SPDX-License-Identifier: GPL-2.0 +#include "llvm/Support/ManagedStatic.h" +#include "llvm/Support/raw_ostream.h" +#define NUM_VERSION (((LLVM_VERSION_MAJOR) << 16) + (LLVM_VERSION_MINOR << 8) + LLVM_VERSION_PATCH) + +#if NUM_VERSION < 0x030900 +# error "LLVM version too low" +#endif +int main() +{ + llvm::errs() << "Hello World!\n"; + llvm::llvm_shutdown(); + return 0; +} -- 2.41.0