From 4bb258eaa6bf2929ebe93042b53beca3eee452c7 Mon Sep 17 00:00:00 2001 From: artem-ogre Date: Wed, 29 Jan 2025 13:59:29 +0100 Subject: [PATCH 1/2] #17954 Fix breakpad compilation with gcc-13 --- recipes/breakpad/all/conandata.yml | 1 + .../patches/0004-Fix-gcc13-compilation.patch | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 recipes/breakpad/all/patches/0004-Fix-gcc13-compilation.patch diff --git a/recipes/breakpad/all/conandata.yml b/recipes/breakpad/all/conandata.yml index da051fdc78d51..08d93843ceaf8 100644 --- a/recipes/breakpad/all/conandata.yml +++ b/recipes/breakpad/all/conandata.yml @@ -7,3 +7,4 @@ 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" 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..ea907a48145c2 --- /dev/null +++ b/recipes/breakpad/all/patches/0004-Fix-gcc13-compilation.patch @@ -0,0 +1,20 @@ +--- 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 + +--- a/configure ++++ b/configure +@@ -7476,7 +7476,6 @@ + + done + +-as_fn_append WARN_CXXFLAGS " -Werror" + ac_ext=c + ac_cpp='$CPP $CPPFLAGS' + ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' From 52fadf077ae1f3d40dd1da47dc166004246f87e1 Mon Sep 17 00:00:00 2001 From: artem-ogre Date: Thu, 30 Jan 2025 17:36:34 +0100 Subject: [PATCH 2/2] Apply patch from upstream instead of disabling -Werror See: https://chromium.googlesource.com/breakpad/breakpad/+/30c7f3cfc11cdbf93a12efbe9d46c66d9785879e%5E%21/ --- recipes/breakpad/all/conandata.yml | 1 + .../patches/0004-Fix-gcc13-compilation.patch | 10 -------- .../patches/0005-Apply-upstream-fixes.patch | 24 +++++++++++++++++++ 3 files changed, 25 insertions(+), 10 deletions(-) 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 08d93843ceaf8..6793f8f71cb91 100644 --- a/recipes/breakpad/all/conandata.yml +++ b/recipes/breakpad/all/conandata.yml @@ -8,3 +8,4 @@ patches: - 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 index ea907a48145c2..01bc339d5581d 100644 --- a/recipes/breakpad/all/patches/0004-Fix-gcc13-compilation.patch +++ b/recipes/breakpad/all/patches/0004-Fix-gcc13-compilation.patch @@ -8,13 +8,3 @@ #include #include ---- a/configure -+++ b/configure -@@ -7476,7 +7476,6 @@ - - done - --as_fn_append WARN_CXXFLAGS " -Werror" - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' - ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' 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; + }