From patchwork Thu Oct 19 21:17:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaldo Carvalho de Melo X-Patchwork-Id: 13429816 X-Patchwork-Delegate: bpf@iogearbox.net Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFCC73550A; Thu, 19 Oct 2023 21:17:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DQy4c/qS" 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: Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline 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 Reviewed-by: Ian Rogers Acked-by: Quentin Monnet --- 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; +}