Skip to content

Commit

Permalink
breakpad: backport fixes to support gcc-13 (#26479)
Browse files Browse the repository at this point in the history
* #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/
  • Loading branch information
artem-ogre authored Feb 5, 2025
1 parent 07c7f74 commit 281c563
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions recipes/breakpad/all/conandata.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
10 changes: 10 additions & 0 deletions recipes/breakpad/all/patches/0004-Fix-gcc13-compilation.patch
Original file line number Diff line number Diff line change
@@ -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 <cstdint>
#include <assert.h>
#include <sys/types.h>

24 changes: 24 additions & 0 deletions recipes/breakpad/all/patches/0005-Apply-upstream-fixes.patch
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 281c563

Please sign in to comment.