All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Luca Ceresoli <luca.ceresoli@bootlin.com>,
	Alejandro Hernandez <aehs29@gmail.com>,
	Richard Purdie <rpurdie@rpsys.net>, Khem Raj <raj.khem@gmail.com>
Subject: [PATCH v2 3/3] elfutils: Fix build with libcurl >= 7.87
Date: Wed, 18 Jan 2023 20:27:24 -0800	[thread overview]
Message-ID: <20230119042724.1413857-3-raj.khem@gmail.com> (raw)
In-Reply-To: <20230119042724.1413857-1-raj.khem@gmail.com>

Backport needed patches and remove local workaround

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../elfutils/elfutils_0.188.bb                |  4 +-
 ...od-Fix-usage-of-deprecated-CURLINFO_.patch | 49 +++++++++++++++++++
 ...t-Use-CURLOPT_PROTOCOLS_STR-for-libc.patch | 34 +++++++++++++
 3 files changed, 85 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-devtools/elfutils/files/0001-PR29926-debuginfod-Fix-usage-of-deprecated-CURLINFO_.patch
 create mode 100644 meta/recipes-devtools/elfutils/files/0002-debuginfod-client-Use-CURLOPT_PROTOCOLS_STR-for-libc.patch

diff --git a/meta/recipes-devtools/elfutils/elfutils_0.188.bb b/meta/recipes-devtools/elfutils/elfutils_0.188.bb
index 084908a38c..65cae868c7 100644
--- a/meta/recipes-devtools/elfutils/elfutils_0.188.bb
+++ b/meta/recipes-devtools/elfutils/elfutils_0.188.bb
@@ -21,6 +21,8 @@ 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 \
            "
 SRC_URI:append:libc-musl = " \
            file://0003-musl-utils.patch \
@@ -33,8 +35,6 @@ inherit autotools gettext ptest pkgconfig
 EXTRA_OECONF = "--program-prefix=eu-"
 
 BUILD_CFLAGS += "-Wno-error=stringop-overflow"
-# compatibility with curl 7.87; can be removed when elfutils upstream fixes the deprecation fails
-CFLAGS:append = " -Wno-error=deprecated-declarations"
 
 DEPENDS_BZIP2 = "bzip2-replacement-native"
 DEPENDS_BZIP2:class-target = "bzip2"
diff --git a/meta/recipes-devtools/elfutils/files/0001-PR29926-debuginfod-Fix-usage-of-deprecated-CURLINFO_.patch b/meta/recipes-devtools/elfutils/files/0001-PR29926-debuginfod-Fix-usage-of-deprecated-CURLINFO_.patch
new file mode 100644
index 0000000000..ee192e3581
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/0001-PR29926-debuginfod-Fix-usage-of-deprecated-CURLINFO_.patch
@@ -0,0 +1,49 @@
+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
+
diff --git a/meta/recipes-devtools/elfutils/files/0002-debuginfod-client-Use-CURLOPT_PROTOCOLS_STR-for-libc.patch b/meta/recipes-devtools/elfutils/files/0002-debuginfod-client-Use-CURLOPT_PROTOCOLS_STR-for-libc.patch
new file mode 100644
index 0000000000..2d4c912e82
--- /dev/null
+++ b/meta/recipes-devtools/elfutils/files/0002-debuginfod-client-Use-CURLOPT_PROTOCOLS_STR-for-libc.patch
@@ -0,0 +1,34 @@
+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
+
-- 
2.39.1



  parent reply	other threads:[~2023-01-19  4:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-19  4:27 [PATCH v2 1/3] binutils: Upgrade to 2.40 release Khem Raj
2023-01-19  4:27 ` [PATCH v2 2/3] binutils: Package libsframe Khem Raj
2023-01-19  4:27 ` Khem Raj [this message]
2023-01-19  9:44 ` [OE-core] [PATCH v2 1/3] binutils: Upgrade to 2.40 release Luca Ceresoli
2023-01-19 16:52   ` Khem Raj
2023-01-19 22:58     ` Luca Ceresoli
2023-01-19 23:52       ` Khem Raj
2023-01-19 17:25 ` Jeff Law
2023-01-19 18:47   ` Khem Raj
2023-01-23 23:38   ` Khem Raj
2023-01-24  4:02     ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230119042724.1413857-3-raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=aehs29@gmail.com \
    --cc=luca.ceresoli@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=rpurdie@rpsys.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.