0.180-3 - Add elfutils-0.180-mhd-result.patch

This commit is contained in:
Mark Wielaard 2020-07-03 23:46:19 +02:00
parent ab00a462ae
commit 170c3e44ea
2 changed files with 72 additions and 0 deletions

View File

@ -0,0 +1,67 @@
commit acb453851c9e6c46531b70fda7396885c0e7e1db
Author: Frank Ch. Eigler <fche@redhat.com>
Date: Thu Jul 2 14:52:48 2020 +0000
PR26195: adapt debuginfod to API change in libmicrohttpd-0.9.71
To make our code build with -Werror as well as against older libmicrohttpd,
we must conditionalize the data type (int vs. enum) returned by callbacks
and some mhd functions.
Signed-off-by: Frank Ch. Eigler <fche@redhat.com>
diff --git a/debuginfod/debuginfod.cxx b/debuginfod/debuginfod.cxx
index 76f1fa52..56210302 100644
--- a/debuginfod/debuginfod.cxx
+++ b/debuginfod/debuginfod.cxx
@@ -92,6 +92,14 @@ using namespace std;
#include <libdwelf.h>
#include <microhttpd.h>
+
+#if MHD_VERSION >= 0x00097002
+// libmicrohttpd 0.9.71 broke API
+#define MHD_RESULT enum MHD_Result
+#else
+#define MHD_RESULT int
+#endif
+
#include <curl/curl.h>
#include <archive.h>
#include <archive_entry.h>
@@ -519,12 +527,12 @@ struct reportable_exception
void report(ostream& o) const; // defined under obatched() class below
- int mhd_send_response(MHD_Connection* c) const {
+ MHD_RESULT mhd_send_response(MHD_Connection* c) const {
MHD_Response* r = MHD_create_response_from_buffer (message.size(),
(void*) message.c_str(),
MHD_RESPMEM_MUST_COPY);
MHD_add_response_header (r, "Content-Type", "text/plain");
- int rc = MHD_queue_response (c, code, r);
+ MHD_RESULT rc = MHD_queue_response (c, code, r);
MHD_destroy_response (r);
return rc;
}
@@ -1723,7 +1731,7 @@ handle_metrics (off_t* size)
/* libmicrohttpd callback */
-static int
+static MHD_RESULT
handler_cb (void * /*cls*/,
struct MHD_Connection *connection,
const char *url,
@@ -1736,7 +1744,11 @@ handler_cb (void * /*cls*/,
struct MHD_Response *r = NULL;
string url_copy = url;
+#if MHD_VERSION >= 0x00097002
+ enum MHD_Result rc;
+#else
int rc = MHD_NO; // mhd
+#endif
int http_code = 500;
off_t http_size = -1;
struct timeval tv_start, tv_end;

View File

@ -55,6 +55,7 @@ BuildRequires: curl
%endif
# Patches
Patch1: elfutils-0.180-mhd-result.patch
%description
Elfutils is a collection of utilities, including stack (to show
@ -246,6 +247,7 @@ such servers to download those files on demand.
%setup -q
# Apply patches
%patch1 -p1 -b .mhd_result
# In case the above patches added any new test scripts, make sure they
# are executable.
@ -431,6 +433,9 @@ exit 0
%systemd_postun_with_restart debuginfod.service
%changelog
* Fri Jul 3 2020 Mark Wielaard <mjw@fedoraproject.org> - 0.180-3
- Add elfutils-0.180-mhd-result.patch
* Wed Jul 1 2020 Jeff Law <law@redhat.com> - 0.180-2
- Disable LTO