From 1981265e9502917b9092b84c2381d2f9d673537c Mon Sep 17 00:00:00 2001 From: Mark Wielaard Date: Fri, 27 Jan 2023 19:09:16 +0100 Subject: [PATCH] 0.188-5 Add various libcurl fixes for deprecated constants - Add elfutils-0.188-deprecated-CURLINFO.patch, elfutils-0.188-CURL_AT_LEAST_VERSION.patch and elfutils-0.188-CURLOPT_PROTOCOLS_STR.patch --- elfutils-0.188-CURLOPT_PROTOCOLS_STR.patch | 35 ++++++++++++++++ elfutils-0.188-CURL_AT_LEAST_VERSION.patch | 36 ++++++++++++++++ elfutils-0.188-deprecated-CURLINFO.patch | 49 ++++++++++++++++++++++ elfutils.spec | 11 ++++- 4 files changed, 130 insertions(+), 1 deletion(-) create mode 100644 elfutils-0.188-CURLOPT_PROTOCOLS_STR.patch create mode 100644 elfutils-0.188-CURL_AT_LEAST_VERSION.patch create mode 100644 elfutils-0.188-deprecated-CURLINFO.patch diff --git a/elfutils-0.188-CURLOPT_PROTOCOLS_STR.patch b/elfutils-0.188-CURLOPT_PROTOCOLS_STR.patch new file mode 100644 index 0000000..3352c21 --- /dev/null +++ b/elfutils-0.188-CURLOPT_PROTOCOLS_STR.patch @@ -0,0 +1,35 @@ +From 6560fb26a62ef135a804357ef4f15a47de3e49b3 Mon Sep 17 00:00:00 2001 +From: Mark Wielaard +Date: Tue, 10 Jan 2023 23:20:41 +0100 +Subject: [PATCH 8/8] debuginfod-client: Use CURLOPT_PROTOCOLS_STR for libcurl + >= 7.85.0 + +https://sourceware.org/bugzilla/show_bug.cgi?id=29926 + +Signed-off-by: Mark Wielaard +--- + debuginfod/ChangeLog | 5 +++++ + 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 + diff --git a/elfutils-0.188-CURL_AT_LEAST_VERSION.patch b/elfutils-0.188-CURL_AT_LEAST_VERSION.patch new file mode 100644 index 0000000..0eca664 --- /dev/null +++ b/elfutils-0.188-CURL_AT_LEAST_VERSION.patch @@ -0,0 +1,36 @@ +From 304741e11018c29e7ff17751e05dcc5c786a3fd9 Mon Sep 17 00:00:00 2001 +From: Mark Wielaard +Date: Wed, 21 Dec 2022 18:21:08 +0100 +Subject: [PATCH 2/8] debuginfod: Define CURL_AT_LEAST_VERSION if necessary + +Older curl.h don't define CURL_AT_LEAST_VERSION, so define it +ourselves because it is nicer than doing hex encoded version +comparisons. + +Signed-off-by: Mark Wielaard +--- + debuginfod/ChangeLog | 4 ++++ + debuginfod/debuginfod-client.c | 7 +++++++ + 2 files changed, 11 insertions(+) + +diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c +index 692aecce..a16165bd 100644 +--- a/debuginfod/debuginfod-client.c ++++ b/debuginfod/debuginfod-client.c +@@ -105,6 +105,13 @@ void debuginfod_end (debuginfod_client *c) { } + #include + #endif + ++/* Older curl.h don't define CURL_AT_LEAST_VERSION. */ ++#ifndef CURL_AT_LEAST_VERSION ++ #define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z)) ++ #define CURL_AT_LEAST_VERSION(x,y,z) \ ++ (LIBCURL_VERSION_NUM >= CURL_VERSION_BITS(x, y, z)) ++#endif ++ + #include + + static pthread_once_t init_control = PTHREAD_ONCE_INIT; +-- +2.39.1 + diff --git a/elfutils-0.188-deprecated-CURLINFO.patch b/elfutils-0.188-deprecated-CURLINFO.patch new file mode 100644 index 0000000..e9bc9a3 --- /dev/null +++ b/elfutils-0.188-deprecated-CURLINFO.patch @@ -0,0 +1,49 @@ +From d2bf497b12fbd49b4996ccf0744303ffd67735b1 Mon Sep 17 00:00:00 2001 +From: Andrew Paprocki +Date: Wed, 21 Dec 2022 11:15:00 -0500 +Subject: [PATCH 1/8] 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 + +Signed-off-by: Andrew Paprocki +--- + debuginfod/ChangeLog | 4 ++++ + 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/elfutils.spec b/elfutils.spec index 997c470..849868f 100644 --- a/elfutils.spec +++ b/elfutils.spec @@ -1,6 +1,6 @@ Name: elfutils Version: 0.188 -%global baserelease 4 +%global baserelease 5 Release: %{baserelease}%{?dist} URL: http://elfutils.org/ %global source_url ftp://sourceware.org/pub/elfutils/%{version}/ @@ -80,6 +80,10 @@ Patch2: elfutils-0.188-static-extract_section.patch Patch3: elfutils-0.188-compile-warnings.patch # The debuginfod_client object lifetime needs more careful handling Patch4: elfutils-0.188-debuginfod-client-lifetime.patch +# Various libcurl deprecated constants +Patch5: elfutils-0.188-deprecated-CURLINFO.patch +Patch6: elfutils-0.188-CURL_AT_LEAST_VERSION.patch +Patch7: elfutils-0.188-CURLOPT_PROTOCOLS_STR.patch %description Elfutils is a collection of utilities, including stack (to show @@ -448,6 +452,11 @@ exit 0 %systemd_postun_with_restart debuginfod.service %changelog +* Fri Jan 27 2023 Mark Wielaard - 0.188-5 +- Add elfutils-0.188-deprecated-CURLINFO.patch, + elfutils-0.188-CURL_AT_LEAST_VERSION.patch and + elfutils-0.188-CURLOPT_PROTOCOLS_STR.patch + * Thu Jan 19 2023 Fedora Release Engineering - 0.188-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild