diff --git a/393a058.tar.gz b/393a058.tar.gz deleted file mode 100644 index b25ea383ae66424d1a910a59ef00e8fb13bf7af0..0000000000000000000000000000000000000000 Binary files a/393a058.tar.gz and /dev/null differ diff --git a/backport-dwarf_loader-Support-DW_TAG_label-outside-DW_TAG_lex.patch b/backport-dwarf_loader-Support-DW_TAG_label-outside-DW_TAG_lex.patch deleted file mode 100644 index f5f8d491e09e884539915c53dbb2293702a2be59..0000000000000000000000000000000000000000 --- a/backport-dwarf_loader-Support-DW_TAG_label-outside-DW_TAG_lex.patch +++ /dev/null @@ -1,99 +0,0 @@ -From f01e5f3a849558b8ed6b310686d10738f4c2f3bf Mon Sep 17 00:00:00 2001 -From: Arnaldo Carvalho de Melo -Date: Thu, 29 Sep 2022 09:43:16 -0300 -Subject: [PATCH 1/1] dwarf_loader: Support DW_TAG_label outside - DW_TAG_lexblock - -This happens with asm CUs, noticed when building the Linux kernel with -clang 15, where we have, for instance: - - Contents of the .debug_info section: - - Compilation Unit @ offset 0x0: - Length: 0x1df (32-bit) - Version: 5 - Unit Type: DW_UT_compile (1) - Abbrev Offset: 0x0 - Pointer Size: 8 - <0>: Abbrev Number: 1 (DW_TAG_compile_unit) - DW_AT_stmt_list : 0x0 - <11> DW_AT_ranges : 0xc - <15> DW_AT_name : arch/x86/kernel/verify_cpu.S - <32> DW_AT_comp_dir : /home/nathan/cbl/src/linux - <4d> DW_AT_producer : ClangBuiltLinux clang version 16.0.0 (https://github.com/llvm/llvm-project 7e22179d38c438fedb0d9bb0cff1585843bd7082) - DW_AT_language : 32769 (MIPS assembler) - <1>: Abbrev Number: 2 (DW_TAG_label) - DW_AT_name : startup_64 - DW_AT_decl_file : 0x0 - DW_AT_decl_line : 0x364 - DW_AT_low_pc : 0xffffffff81000000 - <1>: Abbrev Number: 2 (DW_TAG_label) - DW_AT_name : secondary_startup_64 - DW_AT_decl_file : 0x0 - DW_AT_decl_line : 0x399 - DW_AT_low_pc : 0xffffffff81000060 - <1><106>: Abbrev Number: 2 (DW_TAG_label) - <107> DW_AT_name : secondary_startup_64_no_verify - <126> DW_AT_decl_file : 0x0 - <12a> DW_AT_decl_line : 0x39f - <12e> DW_AT_low_pc : 0xffffffff81000065 - <1><136>: Abbrev Number: 2 (DW_TAG_label) - <137> DW_AT_name : verify_cpu - <142> DW_AT_decl_file : 0x0 - <146> DW_AT_decl_line : 0x430 - <14a> DW_AT_low_pc : 0xffffffff81000150 - - -Reported-by: Nathan Chancellor -Cc: Nick Desaulniers -Cc: Yonghong Song -Link: https://lore.kernel.org/dwarves/YzWSzXKcm6rSWOC5@kernel.org -Signed-off-by: Arnaldo Carvalho de Melo ---- - dwarf_loader.c | 16 ++++++++++++++-- - 1 file changed, 14 insertions(+), 2 deletions(-) - -diff --git a/dwarf_loader.c b/dwarf_loader.c -index 631bbd4..28a912e 100644 ---- a/dwarf_loader.c -+++ b/dwarf_loader.c -@@ -1485,7 +1485,12 @@ static struct tag *die__create_new_label(Dwarf_Die *die, - if (label == NULL) - return NULL; - -- lexblock__add_label(lexblock, label); -+ if (lexblock != NULL) { -+ // asm CUs have labels and they will be in the cu top level tag list -+ // See die__process_unit() -+ lexblock__add_label(lexblock, label); -+ } -+ - return &label->ip.tag; - } - -@@ -2037,6 +2042,12 @@ static struct tag *__die__process_tag(Dwarf_Die *die, struct cu *cu, - */ - tag = &unsupported_tag; - break; -+ case DW_TAG_label: -+ if (conf->ignore_labels) -+ tag = &unsupported_tag; // callers will assume conf->ignore_labels is true -+ else // We can have labels in asm CUs, no lexblock -+ tag = die__create_new_label(die, NULL, cu, conf); -+ break; - } - - if (tag != NULL) -@@ -2055,7 +2066,8 @@ static int die__process_unit(Dwarf_Die *die, struct cu *cu, struct conf_load *co - if (tag == &unsupported_tag) { - // XXX special case DW_TAG_dwarf_procedure, appears when looking at a recent ~/bin/perf - // Investigate later how to properly support this... -- if (dwarf_tag(die) != DW_TAG_dwarf_procedure) -+ if (dwarf_tag(die) != DW_TAG_dwarf_procedure && -+ dwarf_tag(die) != DW_TAG_label) // conf->ignore_labels == true, see die__process_tag() - tag__print_not_supported(dwarf_tag(die)); - continue; - } --- -2.33.0 - diff --git a/dwarves-1.25.tar.xz b/dwarves-1.25.tar.xz new file mode 100644 index 0000000000000000000000000000000000000000..fda7dd38cb8c74dd604dd68e02affd1e7045185f Binary files /dev/null and b/dwarves-1.25.tar.xz differ diff --git a/dwarves.spec b/dwarves.spec index 09d6635345275314e8c53c4e00c16c8bff67deaa..1749f4bfd9eb0ed4d13d2021732304ed65cec376 100644 --- a/dwarves.spec +++ b/dwarves.spec @@ -1,24 +1,21 @@ %define libname libdwarves %define libver 1 -%define libbpfver 393a058 +%define libbpfver 1.2.0 Name: dwarves -Version: 1.22 -Release: 2 +Version: 1.25 +Release: 1 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/%{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: replace-deprecated-libbpf-APIs-with-new-ones.patch -Patch1: backport-dwarf_loader-Support-DW_TAG_label-outside-DW_TAG_lex.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 @@ -85,6 +82,13 @@ make install DESTDIR=%{buildroot} %{_libdir}/%{libname}_reorganize.so %changelog +* Sat Aug 19 2023 - Chenxi Mao - 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 - 1.22-2 - Type:bugfix - ID:NA diff --git a/replace-deprecated-libbpf-APIs-with-new-ones.patch b/replace-deprecated-libbpf-APIs-with-new-ones.patch deleted file mode 100644 index 22f2fe3116a36c05d9a04da000ab11b055cb2364..0000000000000000000000000000000000000000 --- a/replace-deprecated-libbpf-APIs-with-new-ones.patch +++ /dev/null @@ -1,113 +0,0 @@ -From 73383b3a39afe86b22e098773e47b8546c48a649 Mon Sep 17 00:00:00 2001 -From: Kui-Feng Lee -Date: Wed, 26 Jan 2022 11:20:39 -0800 -Subject: [PATCH] libbpf: Update libbpf to the latest git HEAD - -Replace deprecated APIs with new ones. - -Signed-off-by: Kui-Feng Lee -Acked-by: Andrii Nakryiko -Cc: Alexei Starovoitov -Cc: Daniel Borkmann -Cc: bpf@vger.kernel.org -Cc: dwarves@vger.kernel.org -Link: https://lore.kernel.org/r/20220126192039.2840752-5-kuifeng@fb.com -Signed-off-by: Arnaldo Carvalho de Melo -Signed-off-by: Kai Liu ---- - btf_encoder.c | 20 ++++++++++---------- - btf_loader.c | 2 +- - lib/bpf | 2 +- - 3 files changed, 12 insertions(+), 12 deletions(-) - -diff --git a/btf_encoder.c b/btf_encoder.c -index 56a76f5d..fa29824f 100644 ---- a/btf_encoder.c -+++ b/btf_encoder.c -@@ -172,7 +172,7 @@ __attribute ((format (printf, 5, 6))) - static void btf__log_err(const struct btf *btf, int kind, const char *name, - bool output_cr, const char *fmt, ...) - { -- fprintf(stderr, "[%u] %s %s", btf__get_nr_types(btf) + 1, -+ fprintf(stderr, "[%u] %s %s", btf__type_cnt(btf), - btf_kind_str[kind], name ?: "(anon)"); - - if (fmt && *fmt) { -@@ -203,7 +203,7 @@ static void btf_encoder__log_type(const struct btf_encoder *encoder, const struc - out = err ? stderr : stdout; - - fprintf(out, "[%u] %s %s", -- btf__get_nr_types(btf), btf_kind_str[kind], -+ btf__type_cnt(btf) - 1, btf_kind_str[kind], - btf__printable_name(btf, t->name_off)); - - if (fmt && *fmt) { -@@ -449,10 +449,10 @@ static int btf_encoder__add_field(struct btf_encoder *encoder, const char *name, - int err; - - err = btf__add_field(btf, name, type, offset, bitfield_size); -- t = btf__type_by_id(btf, btf__get_nr_types(btf)); -+ t = btf__type_by_id(btf, btf__type_cnt(btf) - 1); - if (err) { - fprintf(stderr, "[%u] %s %s's field '%s' offset=%u bit_size=%u type=%u Error emitting field\n", -- btf__get_nr_types(btf), btf_kind_str[btf_kind(t)], -+ btf__type_cnt(btf) - 1, btf_kind_str[btf_kind(t)], - btf__printable_name(btf, t->name_off), - name, offset, bitfield_size, type); - } else { -@@ -899,9 +899,9 @@ static int btf_encoder__write_raw_file(struct btf_encoder *encoder) - const void *raw_btf_data; - int fd, err; - -- raw_btf_data = btf__get_raw_data(encoder->btf, &raw_btf_size); -+ raw_btf_data = btf__raw_data(encoder->btf, &raw_btf_size); - if (raw_btf_data == NULL) { -- fprintf(stderr, "%s: btf__get_raw_data failed!\n", __func__); -+ fprintf(stderr, "%s: btf__raw_data failed!\n", __func__); - return -1; - } - -@@ -976,7 +976,7 @@ static int btf_encoder__write_elf(struct btf_encoder *encoder) - } - } - -- raw_btf_data = btf__get_raw_data(btf, &raw_btf_size); -+ raw_btf_data = btf__raw_data(btf, &raw_btf_size); - - if (btf_data) { - /* Existing .BTF section found */ -@@ -1043,10 +1043,10 @@ int btf_encoder__encode(struct btf_encoder *encoder) - btf_encoder__add_datasec(encoder, PERCPU_SECTION); - - /* Empty file, nothing to do, so... done! */ -- if (btf__get_nr_types(encoder->btf) == 0) -+ if (btf__type_cnt(encoder->btf) == 1) - return 0; - -- if (btf__dedup(encoder->btf, NULL, NULL)) { -+ if (btf__dedup(encoder->btf, NULL)) { - fprintf(stderr, "%s: btf__dedup failed!\n", __func__); - return -1; - } -@@ -1403,7 +1403,7 @@ void btf_encoder__delete(struct btf_encoder *encoder) - - int btf_encoder__encode_cu(struct btf_encoder *encoder, struct cu *cu) - { -- uint32_t type_id_off = btf__get_nr_types(encoder->btf); -+ uint32_t type_id_off = btf__type_cnt(encoder->btf) - 1; - uint32_t core_id; - struct function *fn; - struct tag *pos; -diff --git a/btf_loader.c b/btf_loader.c -index b61cadd5..b5d44464 100644 ---- a/btf_loader.c -+++ b/btf_loader.c -@@ -399,7 +399,7 @@ static int btf__load_types(struct btf *btf, struct cu *cu) - uint32_t type_index; - int err; - -- for (type_index = 1; type_index <= btf__get_nr_types(btf); type_index++) { -+ for (type_index = 1; type_index < btf__type_cnt(btf); type_index++) { - const struct btf_type *type_ptr = btf__type_by_id(btf, type_index); - uint32_t type = btf_kind(type_ptr); - diff --git a/v1.2.0.tar.gz b/v1.2.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..33cf1d775d5f1d73eee26ae3fbb02638b4cc9f26 Binary files /dev/null and b/v1.2.0.tar.gz differ diff --git a/v1.22.tar.gz b/v1.22.tar.gz deleted file mode 100644 index 27d680c853a3619890f12bd72d019bb044682569..0000000000000000000000000000000000000000 Binary files a/v1.22.tar.gz and /dev/null differ