diff options
author | doko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca> | 2015-03-25 17:31:44 +0000 |
---|---|---|
committer | doko <doko@6ca36cf4-e1d1-0310-8c6f-e303bb2178ca> | 2015-03-25 17:31:44 +0000 |
commit | e8aa612dccc914553f195aee0be5745ac7f46e62 (patch) | |
tree | 8c8bc8c3bcfd8fa95733718e39dfcaebbb0cad1c /debian | |
parent | 7f1fb12db8118863a1481ee961dc21f09e3e2043 (diff) | |
download | gcc-5-e8aa612dccc914553f195aee0be5745ac7f46e62.tar.gz |
* For ICEs, dump the preprocessed source file to stderr when in a
distro build environment.
git-svn-id: svn://anonscm.debian.org/gcccvs/branches/sid/gcc-5@7914 6ca36cf4-e1d1-0310-8c6f-e303bb2178ca
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | debian/patches/gcc-ice-apport.diff | 28 | ||||
-rw-r--r-- | debian/patches/gcc-ice-dump.diff | 41 | ||||
-rw-r--r-- | debian/rules.patch | 1 |
4 files changed, 58 insertions, 14 deletions
diff --git a/debian/changelog b/debian/changelog index 749c949..94382e3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,8 @@ gcc-5 (5-20150321-2) UNRELEASED; urgency=medium * Fix PR go/65417: Add support for PPC32 relocs to debug/elf. LP: #1431388. * Fix PR go/65462: Fix go get dependencies. LP: #1432497. * Limit the omp.h multilib fix to Linux. Closes: #778440. + * For ICEs, dump the preprocessed source file to stderr when in a + distro build environment. -- Matthias Klose <doko@ubuntu.com> Sat, 21 Mar 2015 20:50:47 +0100 diff --git a/debian/patches/gcc-ice-apport.diff b/debian/patches/gcc-ice-apport.diff index 25f0d6a..b976426 100644 --- a/debian/patches/gcc-ice-apport.diff +++ b/debian/patches/gcc-ice-apport.diff @@ -5,20 +5,20 @@ Index: b/src/gcc/gcc.c =================================================================== --- a/src/gcc/gcc.c +++ b/src/gcc/gcc.c -@@ -6571,6 +6571,16 @@ do_report_bug (const char **new_argv, co - { - fnotice (stderr, "Preprocessed source stored into %s file," - " please attach this to your bugreport.\n", *out_file); -+ if (!getenv ("GCC_NOAPPORT") -+ && !access ("/usr/share/apport/gcc_ice_hook", R_OK | X_OK)) -+ { -+ 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); -+ } +@@ -6588,6 +6588,16 @@ do_report_bug (const char **new_argv, co + fflush(stderr); + free(cmd); + } ++ if (!getenv ("GCC_NOAPPORT") ++ && !access ("/usr/share/apport/gcc_ice_hook", R_OK | X_OK)) ++ { ++ 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; diff --git a/debian/patches/gcc-ice-dump.diff b/debian/patches/gcc-ice-dump.diff new file mode 100644 index 0000000..d712130 --- /dev/null +++ b/debian/patches/gcc-ice-dump.diff @@ -0,0 +1,41 @@ +# DP: For ICEs, dump the preprocessed source file to stderr +# DP: when in a distro build environment. + +Index: b/src/gcc/gcc.c +=================================================================== +--- a/src/gcc/gcc.c ++++ b/src/gcc/gcc.c +@@ -2939,7 +2939,8 @@ execute (void) + /* For ICEs in cc1, cc1obj, cc1plus see if it is + reproducible or not. */ + const char *p; +- if (flag_report_bug ++ char *deb_build_options = getenv("DEB_BUILD_OPTIONS"); ++ if ((flag_report_bug || deb_build_options) + && WEXITSTATUS (status) == ICE_EXIT_CODE + && i == 0 + && (p = strrchr (commands[0].argv[0], DIR_SEPARATOR)) +@@ -6570,8 +6571,23 @@ do_report_bug (const char **new_argv, co + + if (status == ATTEMPT_STATUS_SUCCESS) + { ++ char *deb_build_options = getenv("DEB_BUILD_OPTIONS"); ++ + fnotice (stderr, "Preprocessed source stored into %s file," + " please attach this to your bugreport.\n", *out_file); ++ if (deb_build_options) ++ { ++ char *cmd = XNEWVEC (char, 50 + strlen (*out_file)); ++ ++ sprintf(cmd, "/bin/cat %s >&2", *out_file); ++ fprintf(stderr, "=== BEGIN GCC DUMP ===\n"); ++ fflush(stderr); ++ system(cmd); ++ fflush(stderr); ++ fprintf(stderr, "=== END GCC DUMP ===\n"); ++ fflush(stderr); ++ free(cmd); ++ } + /* Make sure it is not deleted. */ + free (*out_file); + *out_file = NULL; diff --git a/debian/rules.patch b/debian/rules.patch index fcb695b..a759050 100644 --- a/debian/rules.patch +++ b/debian/rules.patch @@ -78,6 +78,7 @@ debian_patches += \ sparc64-biarch-long-double-128 \ pr65417 \ pr65462 \ + gcc-ice-dump \ # $(if $(filter yes, $(DEB_CROSS)),,gcc-print-file-name) \ # libstdc++-nothumb-check \ |