diff --git a/0001-tools-uapi-fix-loonarch-64-bit-support.patch b/0001-tools-uapi-fix-loonarch-64-bit-support.patch new file mode 100644 index 0000000000000000000000000000000000000000..f5cae28bda454c3284fa66db772596f54ab90eba --- /dev/null +++ b/0001-tools-uapi-fix-loonarch-64-bit-support.patch @@ -0,0 +1,87 @@ +--- /dev/null 2022-01-05 10:27:39.736744023 +0800 ++++ tools/arch/loongarch/include/uapi/asm/bitsperlong.h 2022-10-19 13:30:41.522009816 +0800 +@@ -0,0 +1,9 @@ ++/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ ++#ifndef __ASM_LOONGARCH_BITSPERLONG_H ++#define __ASM_LOONGARCH_BITSPERLONG_H ++ ++#define __BITS_PER_LONG _LOONGARCH_SZLONG ++ ++#include ++ ++#endif /* __ASM_LOONGARCH_BITSPERLONG_H */ +--- /dev/null 2022-01-05 10:27:39.736744023 +0800 ++++ tools/arch/loongarch/include/uapi/asm/perf_regs.h 2022-10-19 13:30:41.522009816 +0800 +@@ -0,0 +1,40 @@ ++/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ ++#ifndef _ASM_LOONGARCH_PERF_REGS_H ++#define _ASM_LOONGARCH_PERF_REGS_H ++ ++enum perf_event_loongarch_regs { ++ PERF_REG_LOONGARCH_PC, ++ PERF_REG_LOONGARCH_R1, ++ PERF_REG_LOONGARCH_R2, ++ PERF_REG_LOONGARCH_R3, ++ PERF_REG_LOONGARCH_R4, ++ PERF_REG_LOONGARCH_R5, ++ PERF_REG_LOONGARCH_R6, ++ PERF_REG_LOONGARCH_R7, ++ PERF_REG_LOONGARCH_R8, ++ PERF_REG_LOONGARCH_R9, ++ PERF_REG_LOONGARCH_R10, ++ PERF_REG_LOONGARCH_R11, ++ PERF_REG_LOONGARCH_R12, ++ PERF_REG_LOONGARCH_R13, ++ PERF_REG_LOONGARCH_R14, ++ PERF_REG_LOONGARCH_R15, ++ PERF_REG_LOONGARCH_R16, ++ PERF_REG_LOONGARCH_R17, ++ PERF_REG_LOONGARCH_R18, ++ PERF_REG_LOONGARCH_R19, ++ PERF_REG_LOONGARCH_R20, ++ PERF_REG_LOONGARCH_R21, ++ PERF_REG_LOONGARCH_R22, ++ PERF_REG_LOONGARCH_R23, ++ PERF_REG_LOONGARCH_R24, ++ PERF_REG_LOONGARCH_R25, ++ PERF_REG_LOONGARCH_R26, ++ PERF_REG_LOONGARCH_R27, ++ PERF_REG_LOONGARCH_R28, ++ PERF_REG_LOONGARCH_R29, ++ PERF_REG_LOONGARCH_R30, ++ PERF_REG_LOONGARCH_R31, ++ PERF_REG_LOONGARCH_MAX = PERF_REG_LOONGARCH_R31 + 1, ++}; ++#endif /* _ASM_LOONGARCH_PERF_REGS_H */ +--- /dev/null 2022-01-05 10:27:39.736744023 +0800 ++++ tools/arch/loongarch/include/uapi/asm/unistd.h 2022-10-19 13:30:41.522009816 +0800 +@@ -0,0 +1,18 @@ ++/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ ++/* ++ * Copyright (C) 2020 Loongson Technology Co., Ltd. ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program. If not, see . ++ */ ++ ++#include +--- tools/include/uapi/asm/bitsperlong.h.orig 2022-10-19 13:39:52.849341155 +0800 ++++ tools/include/uapi/asm/bitsperlong.h 2022-10-19 13:40:35.112983209 +0800 +@@ -13,6 +13,8 @@ + #include "../../../arch/mips/include/uapi/asm/bitsperlong.h" + #elif defined(__ia64__) + #include "../../../arch/ia64/include/uapi/asm/bitsperlong.h" ++#elif defined(__loongarch__) ++#include "../../../arch/loongarch/include/uapi/asm/bitsperlong.h" + #elif defined(__riscv) + #include "../../../arch/riscv/include/uapi/asm/bitsperlong.h" + #elif defined(__alpha__) diff --git a/download b/download deleted file mode 100644 index de9594466236a1fa65b5aae2ead978c7d6b97556..0000000000000000000000000000000000000000 --- a/download +++ /dev/null @@ -1 +0,0 @@ -6990a3eba7c4d5e19014746e8b4ddcac linux-4.18.0-357.el8.tar.xz diff --git a/libbpf.spec b/libbpf.spec index 920a3ba12c50f26eecc640fcb4ede972b9f54c1f..c988f8597cf22d7bcc615f38601a4fc87679b524 100644 --- a/libbpf.spec +++ b/libbpf.spec @@ -1,21 +1,31 @@ +%define anolis_release .0.1 + # We build libbpf from RHEL kernel sources, that's why we use # directly kernel tar for RHEL kernel build. # We update libbpf's 'sources' file with proper hash that's # used as kernel tar. # RHEL kernel version-release -%define kver 4.18.0-357 -%define source linux-%{kver}.el8 +%define kver 5.14.0-118 +%define source linux-%{kver}.el9 +%define anolis_release .0.1 Name: libbpf -Version: 0.4.0 -Release: 3%{?dist} +Version: 0.6.0 +Release: 1%{anolis_release}%{?dist} Summary: Libbpf library License: LGPLv2 or BSD Source0: %{source}.tar.xz BuildRequires: gcc elfutils-libelf-devel elfutils-devel python3 -Conflicts: bcc < 0.10 +BuildRequires: make + +# This package supersedes libbpf from kernel-tools, +# which has default Epoch: 0. By having Epoch: > 0 +# this libbpf will take over smoothly +Epoch: 2 + +Patch1: 0001-tools-uapi-fix-loonarch-64-bit-support.patch %description A mirror of bpf-next linux tree bpf-next/tools/lib/bpf directory plus its @@ -24,8 +34,9 @@ ABI. %package devel Summary: Development files for %{name} -Requires: %{name} = %{version}-%{release} +Requires: %{name} = 2:%{version}-%{release} Requires: kernel-headers >= %{kver} +Requires: zlib %description devel The %{name}-devel package contains libraries header files for @@ -33,18 +44,28 @@ developing applications that use %{name} %package static Summary: Static library for libbpf development -Requires: %{name}-devel = %{version}-%{release} +Requires: %{name}-devel = 2:%{version}-%{release} %description static The %{name}-static package contains static library for developing applications that use %{name} %global libbpf_make \ - make EXTRA_CFLAGS="${RPM_OPT_FLAGS}" LDFLAGS="%{__global_ldflags}" DESTDIR=%{buildroot} V=1 + make DESTDIR=%{buildroot} OBJDIR=%{_builddir} CFLAGS="%{build_cflags} -fPIC" LDFLAGS="%{build_ldflags} -Wl,--no-as-needed" LIBDIR=/%{_libdir} NO_PKG_CONFIG=1 + +%package doc +Summary: Documents for %{name} +BuildArch: noarch +Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description doc +Doc pages for %{name}. %prep %setup -n %{source} +%patch1 -p0 + %build pushd tools/lib/bpf %{libbpf_make} prefix=%{_prefix} @@ -61,62 +82,102 @@ popd %files devel %{_libdir}/libbpf.so -%{_includedir}/bpf +%{_includedir}/bpf/ %{_libdir}/pkgconfig/libbpf.pc %files static %{_libdir}/libbpf.a +%files doc +%doc README COPYING + %changelog -* Thu Dec 23 2021 Jiri Olsa - 2:0.4.0-3 -- kernel update -- Related: rhbz#2010431 +* Fri Nov 25 2022 Xiaoping Liu - 2:0.6.0-1.0.1 +- Add doc sub package +- Support loongarch64(rb01097748@alibaba-inc.com) + + +* Fri Jun 24 2022 Viktor Malik - 2:0.6.0-1 +- Update to 0.6.0 (BPF 5.16 rebase) +- Related: rhbz#2010428 +- Enable LTO +- Related: rhbz#1990029 + +* Wed Feb 23 2022 Viktor Malik - 2:0.5.0-4 +- Backport fix for netlink operations on ppc +- Related: rhbz#2057476 + +* Tue Nov 09 2021 Jiri Olsa - 2:0.5.0-3 +- pull new kernel sources with fixes +- Related: rhbz#2006305 + +* Fri Oct 11 2021 Jiri Olsa - 2:0.5.0-2 +- Fix passing of system's CFLAGS/LDFLAGS +- Related: rhbz#2012774 + +* Fri Oct 1 2021 Jiri Olsa - 2:0.5.0-1 +- update to RHEL spec +- Related: rhbz#2009725 + +* Wed Aug 25 2021 Jiri Olsa - 2:0.4.0-1 +- updated to 0.4.0 + Related: rhbz#1997597 + +* Mon Aug 09 2021 Mohan Boddu - 2:0.3.0-4 +- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags + Related: rhbz#1991688 + +* Fri Apr 16 2021 Mohan Boddu - 2:0.3.0-3 +- Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937 + +* Tue Jan 26 2021 Fedora Release Engineering - 2:0.3.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild -* Tue Nov 16 2021 Jiri Olsa - 2:0.5.0-2 -- fix LDFLAGS passing -- Related: rhbz#2023488 +* Fri Jan 22 2021 Jiri Olsa - 2:0.3.0-1 +- release 0.3.0-1 -* Wed Aug 18 2021 Jiri Olsa - 0.4.0-1 -- update [1995111] +* Thu Oct 01 2020 Jiri Olsa - 2:0.1.0-1 +- release 0.1.0 -* Wed Jul 21 2021 Jiri Olsa - 0.3.0-1 -- update [1944754] +* Sun Aug 02 2020 Jiri Olsa - 2:0.0.9-1 +- release 0.0.9 -* Sun Jun 06 2021 Jiri Olsa - 0.2.0-2 -- update [1944754] +* Sat Aug 01 2020 Fedora Release Engineering - 2:0.0.8-3 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild -* Fri Feb 05 2021 Jiri Olsa - 0.2.0-1 -- new kernel version [1919345] +* Tue Jul 28 2020 Fedora Release Engineering - 2:0.0.8-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild -* Fri Jan 22 2021 Jiri Olsa - 0.0.9-1 -- new kernel version [1919345] +* Sun May 10 2020 Jiri Olsa - 2:0.0.8-1 +- release 0.0.8 -* Wed Aug 12 2020 Jiri Olsa - 0.0.8-4 -- new kernel version [1846820] +* Wed Mar 03 2020 Jiri Olsa - 2:0.0.7-1 +- release 0.0.7 -* Mon Jul 20 2020 Jiri Olsa - 0.0.8-3 -- add Conflicts for bcc < 0.10 [1855816] +* Wed Jan 29 2020 Fedora Release Engineering - 2:0.0.6-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild -* Wed Jul 08 2020 Jiri Olsa - 0.0.8-2 -- new kernel version [1846820] +* Mon Jan 2 2020 Jiri Olsa - 0.0.6-2 +- release 0.0.6-2, build server issues -* Fri Jun 26 2020 Jiri Olsa - 0.0.8-1 -- new kernel version [1846820] +* Mon Dec 30 2019 Jiri Olsa - 0.0.6-1 +- release 0.0.6 -* Wed Mar 04 2020 Jiri Olsa - 0.0.4-5 -- new kernel version [1809913] +* Thu Nov 28 2019 Jiri Olsa - 0.0.5-3 +- release 0.0.5 -* Thu Jan 09 2020 Jiri Olsa - 0.0.4-4 -- missing libbpf.pc file [1759154] +* Fri Nov 22 2019 Jiri Olsa - 0.0.3-3 +- Revert to 0.0.3 version and adjust kernel-headers dependency (BZ#1755317) -* Sun Dec 15 2019 Jiri Olsa - 0.0.4-3 -- new kernel version [1759154] +* Tue Nov 12 2019 Jiri Olsa - 0.0.5-2 +- Add kernel-headers dependency -* Tue Dec 10 2019 Jiri Olsa - 0.0.4-2 -- new build for gating [1759154] +* Thu Oct 03 2019 Jiri Olsa - 0.0.5-1 +- release 0.0.5 -* Mon Nov 02 2019 Jiri Olsa - 0.0.4-1 -- version 0.0.4 [1759154] +* Wed Sep 25 2019 Jiri Olsa - 0.0.3-2 +- Fix libelf linking (BZ#1755317) -* Mon Nov 02 2019 Jiri Olsa - 0.0.2-1 -- initial package [1759154] +* Fri Sep 13 2019 Jiri Olsa - 0.0.3-1 +- Initial release diff --git a/linux-5.14.0-118.el9.tar.xz b/linux-5.14.0-118.el9.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..9cfc473e326d46808520b3caf29e0d022ccdab92 Binary files /dev/null and b/linux-5.14.0-118.el9.tar.xz differ