elfutils: upgrade 0.188 -> 0.189

Refresh the following patch.
0015-config-eu.am-do-not-use-Werror.patch

Remove the following patches as they have been fixed in the new version.
0001-PR29926-debuginfod-Fix-usage-of-deprecated-CURLINFO_.patch
0002-debuginfod-client-Use-CURLOPT_PROTOCOLS_STR-for-libc.patch

changelog:
Version 0.189 "Don't deflate!"

configure: eu-nm, eu-addr2line and eu-stack can provide demangled symbols
           when linked with libstdc++. Use --disable-demangler to disable.

           A new option --enable-sanitize-memory has been added for msan
           sanitizer support.

libelf: elf_compress now supports ELFCOMPRESS_ZSTD when build against
        libzstd

libdwfl: dwfl_module_return_value_location now returns 0 (no return type)
         for DIEs that point to a DW_TAG_unspecified_type.

elfcompress: -t, --type= now support zstd if libelf has been build with
             ELFCOMPRESS_ZSTD support.

backends: Add support for LoongArch and Synopsys ARCv2 processors.

(From OE-Core rev: 918cff06ac52f265428e97307fff9d2b381b1302)

Signed-off-by: Zang Ruochen <zangruochen@loongson.cn>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Zang Ruochen
2023-05-08 10:12:56 +08:00
committed by Richard Purdie
parent 6588655baa
commit 4b77dd0063
5 changed files with 6 additions and 180 deletions

View File

@@ -21,15 +21,12 @@ SRC_URI = "https://sourceware.org/elfutils/ftp/${PV}/${BP}.tar.bz2 \
file://0001-skip-the-test-when-gcc-not-deployed.patch \
file://ptest.patch \
file://0001-tests-Makefile.am-compile-test_nlist-with-standard-C.patch \
file://0001-PR29926-debuginfod-Fix-usage-of-deprecated-CURLINFO_.patch \
file://0002-debuginfod-client-Use-CURLOPT_PROTOCOLS_STR-for-libc.patch \
file://handle_DW_TAG_unspecified_type.patch \
"
SRC_URI:append:libc-musl = " \
file://0003-musl-utils.patch \
file://0015-config-eu.am-do-not-use-Werror.patch \
"
SRC_URI[sha256sum] = "fb8b0e8d0802005b9a309c60c1d8de32dd2951b56f0c3a3cb56d21ce01595dff"
SRC_URI[sha256sum] = "39bd8f1a338e2b7cd4abc3ff11a0eddc6e690f69578a57478d8179b4148708c8"
inherit autotools gettext ptest pkgconfig

View File

@@ -1,49 +0,0 @@
From d2bf497b12fbd49b4996ccf0744303ffd67735b1 Mon Sep 17 00:00:00 2001
From: Andrew Paprocki <andrew@ishiboo.com>
Date: Wed, 21 Dec 2022 11:15:00 -0500
Subject: [PATCH] PR29926: debuginfod: Fix usage of deprecated CURLINFO_*
The `CURLINFO_SIZE_DOWNLOAD_T` and `CURLINFO_CONTENT_LENGTH_DOWNLOAD_T`
identifiers are `enum`s, not pre-processor definitions, so the current
`#ifdef` logic is not selecting the newer API. This results in the
older identifiers being used and they now generate errors when compiled
against Curl 7.87, which has silently deprecated them, causing GCC to
emit `-Werror=deprecated-declarations`.
Instead, the newer identifiers were added in Curl 7.55, so explicitly
check for `CURL_AT_LEAST_VERSION(7, 55, 0)` instead of the current
logic. This eliminates the error when compiling against Curl 7.87.
Ref: https://github.com/curl/curl/pull/1511
Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=d2bf497b12fbd49b4996ccf0744303ffd67735b1]
Signed-off-by: Andrew Paprocki <andrew@ishiboo.com>
---
debuginfod/debuginfod-client.c | 4 ++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index 8873fcc8..692aecce 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -1456,7 +1456,7 @@ debuginfod_query_server (debuginfod_client *c,
deflate-compressing proxies, this number is likely to be
unavailable, so -1 may show. */
CURLcode curl_res;
-#ifdef CURLINFO_CONTENT_LENGTH_DOWNLOAD_T
+#if CURL_AT_LEAST_VERSION(7, 55, 0)
curl_off_t cl;
curl_res = curl_easy_getinfo(target_handle,
CURLINFO_CONTENT_LENGTH_DOWNLOAD_T,
@@ -1491,7 +1491,7 @@ debuginfod_query_server (debuginfod_client *c,
if (target_handle) /* we've committed to a server; report its download progress */
{
CURLcode curl_res;
-#ifdef CURLINFO_SIZE_DOWNLOAD_T
+#if CURL_AT_LEAST_VERSION(7, 55, 0)
curl_off_t dl;
curl_res = curl_easy_getinfo(target_handle,
CURLINFO_SIZE_DOWNLOAD_T,
--
2.39.1

View File

@@ -1,34 +0,0 @@
From 6560fb26a62ef135a804357ef4f15a47de3e49b3 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Tue, 10 Jan 2023 23:20:41 +0100
Subject: [PATCH] debuginfod-client: Use CURLOPT_PROTOCOLS_STR for libcurl >= 7.85.0
https://sourceware.org/bugzilla/show_bug.cgi?id=29926
Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=6560fb26a62ef135a804357ef4f15a47de3e49b3]
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
debuginfod/debuginfod-client.c | 5 +++++
2 files changed, 10 insertions(+)
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index a16165bd..1ce45632 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -1336,8 +1336,13 @@ debuginfod_query_server (debuginfod_client *c,
/* Only allow http:// + https:// + file:// so we aren't being
redirected to some unsupported protocol. */
+#if CURL_AT_LEAST_VERSION(7, 85, 0)
+ curl_easy_setopt_ck(data[i].handle, CURLOPT_PROTOCOLS_STR,
+ "http,https,file");
+#else
curl_easy_setopt_ck(data[i].handle, CURLOPT_PROTOCOLS,
(CURLPROTO_HTTP | CURLPROTO_HTTPS | CURLPROTO_FILE));
+#endif
curl_easy_setopt_ck(data[i].handle, CURLOPT_URL, data[i].url);
if (vfd >= 0)
curl_easy_setopt_ck(data[i].handle, CURLOPT_ERRORBUFFER,
--
2.39.1

View File

@@ -14,20 +14,19 @@ Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
---
config/eu.am | 2 --
1 file changed, 2 deletions(-)
diff --git a/config/eu.am b/config/eu.am
index 58cd3c4..ac42390 100644
index e6c241f..4136e7c 100644
--- a/config/eu.am
+++ b/config/eu.am
@@ -91,7 +91,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
-Wold-style-definition -Wstrict-prototypes $(TRAMPOLINES_WARNING) \
@@ -99,7 +99,6 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
$(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
$(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
$(USE_AFTER_FREE3_WARNING) \
- $(if $($(*F)_no_Werror),,-Werror) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
$(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \
@@ -101,7 +100,6 @@ AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \
@@ -109,7 +108,6 @@ AM_CXXFLAGS = -std=c++11 -Wall -Wshadow \
$(TRAMPOLINES_WARNING) \
$(LOGICAL_OP_WARNING) $(DUPLICATED_COND_WARNING) \
$(NULL_DEREFERENCE_WARNING) $(IMPLICIT_FALLTHROUGH_WARNING) \
@@ -35,3 +34,4 @@ index 58cd3c4..ac42390 100644
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
$(if $($(*F)_no_Wpacked_not_aligned),$(NO_PACKED_NOT_ALIGNED_WARNING),) \
--

View File

@@ -1,88 +0,0 @@
From: Mark Wielaard <mark@klomp.org>
Date: Thu, 26 Jan 2023 17:19:15 +0000 (+0100)
Subject: backends: Handle DW_TAG_unspecified_type in dwarf_peeled_die_type
X-Git-Url: https://sourceware.org/git/?p=elfutils.git;a=commitdiff_plain;h=f2c522567ad63ac293535fba9704895e685ab5bc;hp=3fa98a6f29b0f370e32549ead7eb897c839af980
backends: Handle DW_TAG_unspecified_type in dwarf_peeled_die_type
binutils 2.40 introduces DW_TAG_unspecified_type for assembly
functions with an unknown return type. This breaks the
run-funcretval.sh testcase because dwfl_module_return_value_location
returns an error for such functions because it cannot determine the
return value location. Fix that by treating DW_TAG_unspecified_type
as if the DIE doesn't have a DW_AT_type.
Also update the testcase to explicitly checking for
DW_TAG_unspecified_type and printing "returns unspecified type".
https://sourceware.org/bugzilla/show_bug.cgi?id=30047
Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commitdiff;h=f2c522567ad63ac293535fba9704895e685ab5bc;hp=3fa98a6f29b0f370e32549ead7eb897c839af980]
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
--- a/backends/libebl_CPU.h
+++ b/backends/libebl_CPU.h
@@ -1,5 +1,6 @@
/* Common interface for libebl modules.
Copyright (C) 2000, 2001, 2002, 2003, 2005, 2013, 2014 Red Hat, Inc.
+ Copyright (C) 2023 Mark J. Wielaard <mark@klomp.org>
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -53,7 +54,9 @@ extern bool (*generic_debugscn_p) (const
dwarf_tag (_die); })
/* Get a type die corresponding to DIE. Peel CV qualifiers off
- it. */
+ it. Returns zero if the DIE doesn't have a type, or the type
+ is DW_TAG_unspecified_type. Returns -1 on error. Otherwise
+ returns the result tag DW_AT value. */
static inline int
dwarf_peeled_die_type (Dwarf_Die *die, Dwarf_Die *result)
{
@@ -69,7 +72,14 @@ dwarf_peeled_die_type (Dwarf_Die *die, D
if (dwarf_peel_type (result, result) != 0)
return -1;
- return DWARF_TAG_OR_RETURN (result);
+ if (result == NULL)
+ return -1;
+
+ int tag = dwarf_tag (result);
+ if (tag == DW_TAG_unspecified_type)
+ return 0; /* Treat an unspecified type as if there was no type. */
+
+ return tag;
}
#endif /* libebl_CPU.h */
--- a/tests/funcretval.c
+++ b/tests/funcretval.c
@@ -1,5 +1,6 @@
/* Test program for dwfl_module_return_value_location.
Copyright (C) 2005 Red Hat, Inc.
+ Copyright (C) 2023 Mark J. Wielaard <mark@klomp.org>
This file is part of elfutils.
This file is free software; you can redistribute it and/or modify
@@ -67,7 +68,18 @@ handle_function (Dwarf_Die *funcdie, voi
error (EXIT_FAILURE, 0, "dwfl_module_return_value_location: %s",
dwfl_errmsg (-1));
else if (nlocops == 0)
- puts ("returns no value");
+ {
+ // Check if this is the special unspecified type
+ // https://sourceware.org/bugzilla/show_bug.cgi?id=30047
+ Dwarf_Die die_mem, *typedie = &die_mem;
+ Dwarf_Attribute attr_mem, *attr;
+ attr = dwarf_attr_integrate (funcdie, DW_AT_type, &attr_mem);
+ if (dwarf_formref_die (attr, typedie) != NULL
+ && dwarf_tag (typedie) == DW_TAG_unspecified_type)
+ puts ("returns unspecified type");
+ else
+ puts ("returns no value");
+ }
else
{
printf ("return value location:");