aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-lang.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2015-01-23 22:26:41 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2015-01-23 22:26:41 +0000
commit818424b256bd6d50be4d52f71ec5c7fd6c065b63 (patch)
tree36f3ff32f6cdf2a9f3d5cf0594a3f3666b82d543 /gcc/go/go-lang.c
parentaf955a5298ee443339b378fb2beb337150924f33 (diff)
downloadgcc-818424b256bd6d50be4d52f71ec5c7fd6c065b63.zip
gcc-818424b256bd6d50be4d52f71ec5c7fd6c065b63.tar.gz
gcc-818424b256bd6d50be4d52f71ec5c7fd6c065b63.tar.bz2
re PR go/64595 (go programs abort when debug info is stripped)
PR go/64595 * go-lang.c (go_langhook_init_options_struct): Set default debug_info_level. (go_langhook_post_options): If debug_info_level is still the default, make sure write_symbols is set. * gccgo.texi (Invoking gccgo): Document that -g1 is the default. From-SVN: r220064
Diffstat (limited to 'gcc/go/go-lang.c')
-rw-r--r--gcc/go/go-lang.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/go/go-lang.c b/gcc/go/go-lang.c
index 2797e99..fe5b583 100644
--- a/gcc/go/go-lang.c
+++ b/gcc/go/go-lang.c
@@ -171,6 +171,12 @@ go_langhook_init_options_struct (struct gcc_options *opts)
/* Exceptions are used to handle recovering from panics. */
opts->x_flag_exceptions = 1;
opts->x_flag_non_call_exceptions = 1;
+
+ /* Go programs expect runtime.Callers to work, and that uses
+ libbacktrace that uses debug info. Set the debug info level to 1
+ by default. In post_options we will set the debug type if the
+ debug info level was not set back to 0 on the command line. */
+ opts->x_debug_info_level = DINFO_LEVEL_TERSE;
}
/* Infrastructure for a vector of char * pointers. */
@@ -289,6 +295,12 @@ go_langhook_post_options (const char **pfilename ATTRIBUTE_UNUSED)
if (!global_options_set.x_flag_optimize_sibling_calls)
global_options.x_flag_optimize_sibling_calls = 0;
+ /* If the debug info level is still 1, as set in init_options, make
+ sure that some debugging type is selected. */
+ if (global_options.x_debug_info_level == DINFO_LEVEL_TERSE
+ && global_options.x_write_symbols == NO_DEBUG)
+ global_options.x_write_symbols = PREFERRED_DEBUGGING_TYPE;
+
/* Returning false means that the backend should be used. */
return false;
}