From 281c563d9157cd8353afc7592969853916bb85c2 Mon Sep 17 00:00:00 2001 From: Artem Amirkhanov Date: Wed, 5 Feb 2025 10:58:49 +0100 Subject: [PATCH] breakpad: backport fixes to support gcc-13 (#26479) * #17954 Fix breakpad compilation with gcc-13 * Apply patch from upstream instead of disabling -Werror See: https://chromium.googlesource.com/breakpad/breakpad/+/30c7f3cfc11cdbf93a12efbe9d46c66d9785879e%5E%21/ --- recipes/breakpad/all/conandata.yml | 2 ++ .../patches/0004-Fix-gcc13-compilation.patch | 10 ++++++++ .../patches/0005-Apply-upstream-fixes.patch | 24 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 recipes/breakpad/all/patches/0004-Fix-gcc13-compilation.patch create mode 100644 recipes/breakpad/all/patches/0005-Apply-upstream-fixes.patch diff --git a/recipes/breakpad/all/conandata.yml b/recipes/breakpad/all/conandata.yml index da051fdc78d51..6793f8f71cb91 100644 --- a/recipes/breakpad/all/conandata.yml +++ b/recipes/breakpad/all/conandata.yml @@ -7,3 +7,5 @@ patches: - patch_file: "patches/0001-Use_conans_lss.patch" - patch_file: "patches/0002-Remove-hardcoded-fpic.patch" - patch_file: "patches/0003-Fix-gcc11-compilation.patch" + - patch_file: "patches/0004-Fix-gcc13-compilation.patch" + - patch_file: "patches/0005-Apply-upstream-fixes.patch" diff --git a/recipes/breakpad/all/patches/0004-Fix-gcc13-compilation.patch b/recipes/breakpad/all/patches/0004-Fix-gcc13-compilation.patch new file mode 100644 index 0000000000000..01bc339d5581d --- /dev/null +++ b/recipes/breakpad/all/patches/0004-Fix-gcc13-compilation.patch @@ -0,0 +1,10 @@ +--- a/src/client/linux/handler/minidump_descriptor.h ++++ b/src/client/linux/handler/minidump_descriptor.h +@@ -30,6 +30,7 @@ + #ifndef CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_ + #define CLIENT_LINUX_HANDLER_MINIDUMP_DESCRIPTOR_H_ + ++#include + #include + #include + diff --git a/recipes/breakpad/all/patches/0005-Apply-upstream-fixes.patch b/recipes/breakpad/all/patches/0005-Apply-upstream-fixes.patch new file mode 100644 index 0000000000000..631bde13234de --- /dev/null +++ b/recipes/breakpad/all/patches/0005-Apply-upstream-fixes.patch @@ -0,0 +1,24 @@ +--- a/src/processor/exploitability_linux.cc ++++ b/src/processor/exploitability_linux.cc +@@ -516,18 +516,17 @@ + raw_bytes_tmpfile); + FILE* objdump_fp = popen(cmd, "r"); + if (!objdump_fp) { +- fclose(objdump_fp); + unlink(raw_bytes_tmpfile); + BPLOG(ERROR) << "Failed to call objdump."; + return false; + } +- if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) <= 0) { +- fclose(objdump_fp); ++ if (fread(objdump_output_buffer, 1, buffer_len, objdump_fp) != buffer_len) { ++ pclose(objdump_fp); + unlink(raw_bytes_tmpfile); + BPLOG(ERROR) << "Failed to read objdump output."; + return false; + } +- fclose(objdump_fp); ++ pclose(objdump_fp); + unlink(raw_bytes_tmpfile); + return true; + }