Compare commits
10 Commits
ea6027258e
...
bd795ccae6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd795ccae6 | ||
|
|
089039a298 | ||
|
|
a9c1dc987c | ||
|
|
1cced95dd2 | ||
|
|
8418eac107 | ||
|
|
934a5d12d5 | ||
|
|
7f3107f741 | ||
|
|
8709c8b953 | ||
|
|
a9ca898dd6 | ||
|
|
96895db3dd |
@ -0,0 +1,47 @@
|
||||
From b9607b8bf5fe3180ae4cd44cddaf054e5595e699 Mon Sep 17 00:00:00 2001
|
||||
From: Yonghong Song <yonghong.song@linux.dev>
|
||||
Date: Wed, 24 Apr 2024 15:35:38 -0700
|
||||
Subject: [PATCH dwarves] btf_encoder: Fix dwarf int type with greater-than-16 byte issue
|
||||
|
||||
Nick Desaulniers and Xin Liu separately reported that int type might
|
||||
have greater-than-16 byte size ([1] and [2]). More specifically, the
|
||||
reported int type sizes are 1024 and 64 bytes.
|
||||
|
||||
The libbpf and bpf program does not really support any int type greater
|
||||
than 16 bytes. Therefore, with current pahole, btf encoding will fail
|
||||
with greater-than-16 byte int types.
|
||||
|
||||
Since for now bpf does not support '> 16' bytes int type, the simplest
|
||||
way is to sanitize such types, similar to existing conditions like
|
||||
'!byte_sz' and 'byte_sz & (byte_sz - 1)'. This way, pahole won't
|
||||
call libbpf with an unsupported int type size. The patch [3] was
|
||||
proposed before. Now I resubmitted this patch as there are another
|
||||
failure due to the same issue.
|
||||
|
||||
[1] https://github.com/libbpf/libbpf/pull/680
|
||||
[2]https://lore.kernel.org/bpf/20240422144538.351722-1-liuxin350@huawei.com/
|
||||
[3] https://lore.kernel.org/bpf/20230426055030.3743074-1-yhs@fb.com/
|
||||
|
||||
Cc: Xin Liu <liuxin350@huawei.com>
|
||||
Cc: Alan Maguire <alan.maguire@oracle.com>
|
||||
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
|
||||
---
|
||||
btf_encoder.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/btf_encoder.c b/btf_encoder.c
|
||||
index 65f6e71..1aa0ad0 100644
|
||||
--- a/btf_encoder.c
|
||||
+++ b/btf_encoder.c
|
||||
@@ -394,7 +394,7 @@ static int32_t btf_encoder__add_base_type(struct btf_encoder *encoder, const str
|
||||
* these non-regular int types to avoid libbpf/kernel complaints.
|
||||
*/
|
||||
byte_sz = BITS_ROUNDUP_BYTES(bt->bit_size);
|
||||
- if (!byte_sz || (byte_sz & (byte_sz - 1))) {
|
||||
+ if (!byte_sz || (byte_sz & (byte_sz - 1)) || byte_sz > 16) {
|
||||
name = "__SANITIZED_FAKE_INT__";
|
||||
byte_sz = 4;
|
||||
}
|
||||
--
|
||||
2.33.0
|
||||
|
||||
BIN
dwarves-1.25.tar.xz
Normal file
BIN
dwarves-1.25.tar.xz
Normal file
Binary file not shown.
49
dwarves.spec
49
dwarves.spec
@ -1,21 +1,23 @@
|
||||
%define libname libdwarves
|
||||
%define libver 1
|
||||
%define libbpfver 0.1.0
|
||||
%define libbpfver 1.2.0
|
||||
|
||||
Name: dwarves
|
||||
Version: 1.17
|
||||
Release: 1
|
||||
Version: 1.25
|
||||
Release: 2
|
||||
License: GPLv2
|
||||
Summary: Debugging Information Manipulation Tools
|
||||
URL: http://acmel.wordpress.com
|
||||
Source: http://github.com/acmel/dwarves/archive/v%{version}.tar.gz
|
||||
Source1: http://github.com/libbpf/libbpf/archive/v%{libbpfver}.tar.gz
|
||||
Source: http://fedorapeople.org/~acme/dwarves/%{name}-%{version}.tar.xz
|
||||
Source1: https://github.com/libbpf/libbpf/archive/refs/tags/v%{libbpfver}.tar.gz
|
||||
Requires: %{libname}%{libver} = %{version}-%{release}
|
||||
BuildRequires: gcc
|
||||
BuildRequires: cmake
|
||||
BuildRequires: zlib-devel
|
||||
BuildRequires: elfutils-devel >= 0.170
|
||||
|
||||
Patch0: backport-btf_encoder-Fix-dwarf-int-type-with-greater-than-16-.patch
|
||||
|
||||
%description
|
||||
dwarves is a set of tools that use the debugging information inserted in
|
||||
ELF binaries by compilers such as GCC, used by well known debuggers such as
|
||||
@ -39,6 +41,10 @@ Debugging information processing library development files.
|
||||
tar -zxvf %{SOURCE1} --strip-components 1 -C %{_builddir}/%{name}-%{version}/lib/bpf/
|
||||
|
||||
%build
|
||||
# Remove _FORTIFY_SOURCE from CFLAGS or else will get below error:
|
||||
# error: #warning _FORTIFY_SOURCE requires compiling with optimization (-O) [-Werror=cpp]
|
||||
export CFLAGS=$(echo %optflags | sed -e 's/-Wp,-D_FORTIFY_SOURCE=2//g')
|
||||
|
||||
%cmake .
|
||||
make VERBOSE=1 %{?_smp_mflags}
|
||||
|
||||
@ -78,6 +84,39 @@ make install DESTDIR=%{buildroot}
|
||||
%{_libdir}/%{libname}_reorganize.so
|
||||
|
||||
%changelog
|
||||
* Mon Jul 29 2024 - liuxin <liuxin350@huawei.com> - 1.25-2
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: fix dwarf int type with greater than 16 bytes issue
|
||||
|
||||
* Sat Aug 19 2023 - Chenxi Mao <chenxi.mao@suse.com> - 1.25-1
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: Upgrade dwarves version to 1.25 to fix build error
|
||||
if kernel version upgrade to 6.4
|
||||
|
||||
* Mon Mar 21 2022 - Kai Liu <kai.liu@suse.com> - 1.22-2
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC: Fix spew of warnings if build kernel with LLVM and
|
||||
CONFIG_DEBUG_INFO_BTF after commit 32ef9e5054ec
|
||||
("Makefile.debug: re-enable debug info for .S files")
|
||||
|
||||
* Mon Mar 21 2022 - Kai Liu <kai.liu@suse.com> - 1.22-1
|
||||
- Upgrade to v1.22. Also upgrade bundled libbpf to commit 393a058,
|
||||
the same as upstream submodule version.
|
||||
Introduce a patch from upstream commit 73383b3a3 to avoid using
|
||||
deprecated libbpf APIs.
|
||||
|
||||
* Mon May 24 2021 xiaqirong <xiaqirong1@huawei.com> - 1.17-2
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:bugfix about stopping using the deprecated mallinfo function
|
||||
|
||||
* Wed Sep 16 2020 xiaqirong <xiaqirong1@huawei.com> - 1.17-1
|
||||
- Type:package init
|
||||
- ID:NA
|
||||
|
||||
BIN
v0.1.0.tar.gz
BIN
v0.1.0.tar.gz
Binary file not shown.
BIN
v1.17.tar.gz
BIN
v1.17.tar.gz
Binary file not shown.
BIN
v1.2.0.tar.gz
Normal file
BIN
v1.2.0.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user