From 7ff235b00fa5eb68de2731f6ac749d4cc7c681a9 Mon Sep 17 00:00:00 2001 From: Jerome Marchand Date: Tue, 14 Jan 2025 11:25:07 +0100 Subject: [PATCH] Rebase bcc to version 0.32.0 Rebase bcc to the latest version and at the same time rebuild with LLVM 19. Resolves: RHEL-63883 Resolves: RHEL-66060 Resolves: RHEL-8663 Resolves: RHEL-30896 Signed-off-by: Jerome Marchand --- .gitignore | 1 + ...the-kheaders-ownership-is-wrong-4928.patch | 76 ------------------- ...s-fix-alignment-in-tp_args-for-bio-t.patch | 0 bcc.spec | 10 ++- sources | 2 +- 5 files changed, 8 insertions(+), 81 deletions(-) delete mode 100644 bcc-0.30.0-clang-fail-when-the-kheaders-ownership-is-wrong-4928.patch rename bcc-0.30.0-RHEL-Centos-tools-fix-alignment-in-tp_args-for-bio-t.patch => bcc-0.32.0-RHEL-Centos-tools-fix-alignment-in-tp_args-for-bio-t.patch (100%) diff --git a/.gitignore b/.gitignore index d39428c..2a985c8 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ /bcc-0.26.0.tar.gz /bcc-0.28.0.tar.gz /bcc-0.30.0.tar.gz +/bcc-0.32.0.tar.gz diff --git a/bcc-0.30.0-clang-fail-when-the-kheaders-ownership-is-wrong-4928.patch b/bcc-0.30.0-clang-fail-when-the-kheaders-ownership-is-wrong-4928.patch deleted file mode 100644 index 4d4f864..0000000 --- a/bcc-0.30.0-clang-fail-when-the-kheaders-ownership-is-wrong-4928.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 5bc97bbc50b1ccf0c63f320ee73a2c0abe84b596 Mon Sep 17 00:00:00 2001 -From: Jerome Marchand -Date: Fri, 17 May 2024 15:36:07 +0200 -Subject: [PATCH] clang: fail when the kheaders ownership is wrong (#4928) - (#4985) - -file_exists_and_ownedby() returns -1 when the file exists but its -ownership is unexpected, which is very misleading since anything non -zero is interpreted as true and a function with such a name is -expected to return a boolean. So currently all this does, is write a -warning message, and continues as if nothing is wrong. - -Make file_exists_and_ownedby() returns false when the ownership is -wrong and have get_proc_kheaders() fails when this happen. Also have -all the *exists* functions return bool to avoid such issues in the -future. - -Signed-off-by: Jerome Marchand ---- - src/cc/frontends/clang/kbuild_helper.cc | 22 +++++++++++++++++----- - 1 file changed, 17 insertions(+), 5 deletions(-) - -diff --git a/src/cc/frontends/clang/kbuild_helper.cc b/src/cc/frontends/clang/kbuild_helper.cc -index 9409e4cc..5d3ad9c2 100644 ---- a/src/cc/frontends/clang/kbuild_helper.cc -+++ b/src/cc/frontends/clang/kbuild_helper.cc -@@ -140,20 +140,26 @@ int KBuildHelper::get_flags(const char *uname_machine, vector *cflags) { - return 0; - } - --static inline int file_exists_and_ownedby(const char *f, uid_t uid) -+static inline bool file_exists(const char *f) -+{ -+ struct stat buffer; -+ return (stat(f, &buffer) == 0); -+} -+ -+static inline bool file_exists_and_ownedby(const char *f, uid_t uid) - { - struct stat buffer; - int ret = stat(f, &buffer) == 0; - if (ret) { - if (buffer.st_uid != uid) { - std::cout << "ERROR: header file ownership unexpected: " << std::string(f) << "\n"; -- return -1; -+ return false; - } - } - return ret; - } - --static inline int proc_kheaders_exists(void) -+static inline bool proc_kheaders_exists(void) - { - return file_exists_and_ownedby(PROC_KHEADERS_PATH, 0); - } -@@ -231,8 +237,14 @@ int get_proc_kheaders(std::string &dirpath) - uname_data.release); - dirpath = std::string(dirpath_tmp); - -- if (file_exists_and_ownedby(dirpath_tmp, 0)) -- return 0; -+ if (file_exists(dirpath_tmp)) { -+ if (file_exists_and_ownedby(dirpath_tmp, 0)) -+ return 0; -+ else -+ // The path exists, but is owned by a non-root user -+ // Something fishy is going on -+ return -EEXIST; -+ } - - // First time so extract it - return extract_kheaders(dirpath, uname_data); --- -2.44.0 - diff --git a/bcc-0.30.0-RHEL-Centos-tools-fix-alignment-in-tp_args-for-bio-t.patch b/bcc-0.32.0-RHEL-Centos-tools-fix-alignment-in-tp_args-for-bio-t.patch similarity index 100% rename from bcc-0.30.0-RHEL-Centos-tools-fix-alignment-in-tp_args-for-bio-t.patch rename to bcc-0.32.0-RHEL-Centos-tools-fix-alignment-in-tp_args-for-bio-t.patch diff --git a/bcc.spec b/bcc.spec index 41d50f4..6a63ee5 100644 --- a/bcc.spec +++ b/bcc.spec @@ -24,14 +24,13 @@ Name: bcc -Version: 0.30.0 -Release: 9%{?dist} +Version: 0.32.0 +Release: 1%{?dist} Summary: BPF Compiler Collection (BCC) License: ASL 2.0 URL: https://github.com/iovisor/bcc Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz -Patch0: %%{name}-%%{version}-clang-fail-when-the-kheaders-ownership-is-wrong-4928.patch -Patch1: %%{name}-%%{version}-RHEL-Centos-tools-fix-alignment-in-tp_args-for-bio-t.patch +Patch0: %%{name}-%%{version}-RHEL-Centos-tools-fix-alignment-in-tp_args-for-bio-t.patch # Arches will be included as upstream support is added and dependencies are @@ -265,6 +264,9 @@ cp -a libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir}/ %endif %changelog +* Tue Jan 14 2025 Jerome Marchand - 0.32.0-1 +- Rebase to the latest version (RHEL-63883) + * Wed Nov 06 2024 Jerome Marchand - 0.30.0-9 - Fix gating tests of libbpf gating. diff --git a/sources b/sources index bcda703..4a05c93 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (bcc-0.30.0.tar.gz) = 70478ca8c18e7f106c462513ca9af46f49b4ebcca6380a9393208fca88f83895a7396f918bf5d01dce1bc4a876bccb9b95aa56d426e55d384cf11c9baaa6a89b +SHA512 (bcc-0.32.0.tar.gz) = 3612580976f9c91a52c49bc83abdbaccc9a066c30a7f178997cb91910307e48743d831ec028e0099e776250770b55e8fc8c937bcc9b1e36fbec88370376d1df4