summaryrefslogtreecommitdiffstats
path: root/debian/patches/gcc-ice-apport.diff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:22:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:22:56 +0000
commit3f472a4e5ca21e3ddb13737473e636b2b11a408a (patch)
tree7db1ab317884b9f6e04b6e13737c1679879cb97a /debian/patches/gcc-ice-apport.diff
parentAdding upstream version 13.2.0. (diff)
downloadgcc-13-3f472a4e5ca21e3ddb13737473e636b2b11a408a.tar.xz
gcc-13-3f472a4e5ca21e3ddb13737473e636b2b11a408a.zip
Adding debian version 13.2.0-10.debian/13.2.0-10debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/gcc-ice-apport.diff')
-rw-r--r--debian/patches/gcc-ice-apport.diff39
1 files changed, 39 insertions, 0 deletions
diff --git a/debian/patches/gcc-ice-apport.diff b/debian/patches/gcc-ice-apport.diff
new file mode 100644
index 0000000..7248253
--- /dev/null
+++ b/debian/patches/gcc-ice-apport.diff
@@ -0,0 +1,39 @@
+# DP: Report an ICE to apport (if apport is available
+# DP: and the environment variable GCC_NOAPPORT is not set)
+
+--- a/src/gcc/gcc.cc
++++ b/src/gcc/gcc.cc
+@@ -7935,13 +7935,16 @@ do_report_bug (const char **new_argv, const int nargs,
+ if (status == ATTEMPT_STATUS_SUCCESS)
+ {
+ const bool gcc_dump = has_deb_build_options ("gcc-ice", "nodump");
++ const bool gcc_apport
++ = !env.get ("GCC_NOAPPORT")
++ && !access ("/usr/share/apport/gcc_ice_hook", R_OK | X_OK);
+
+ if (gcc_dump)
+ fnotice (stderr,
+ "Preprocessed source stored into %s file,"
+ " please attach this to your bugreport.\n",
+ *out_file);
+- if (gcc_dump)
++ if (gcc_dump || gcc_apport)
+ {
+ char *cmd = XNEWVEC (char, 50 + strlen (*out_file));
+
+@@ -7955,6 +7958,15 @@ do_report_bug (const char **new_argv, const int nargs,
+ fflush (stderr);
+ free (cmd);
+ }
++ if (gcc_apport)
++ {
++ char *cmd
++ = XNEWVEC (char, 50 + strlen (*out_file) + strlen (new_argv[0]));
++ sprintf (cmd, "/usr/share/apport/gcc_ice_hook %s %s", new_argv[0],
++ *out_file);
++ system (cmd);
++ free (cmd);
++ }
+ /* Make sure it is not deleted. */
+ free (*out_file);
+ *out_file = NULL;