/* The first input file with an extension of .go. */
const char *first_go_file = NULL;
+ /* Whether we saw any -g option. */
+ bool saw_opt_g = false;
+
argc = *in_decoded_options_count;
decoded_options = *in_decoded_options;
added_libraries = *in_added_libraries;
saw_opt_o = true;
break;
+ case OPT_g:
+ case OPT_gdwarf:
+ case OPT_gdwarf_:
+ case OPT_ggdb:
+ case OPT_gstabs:
+ case OPT_gstabs_:
+ case OPT_gvms:
+ case OPT_gxcoff:
+ case OPT_gxcoff_:
+ saw_opt_g = true;
+ break;
+
case OPT_static:
static_link = 1;
break;
j++;
}
+ /* The go1 compiler is going to enable debug info by default. If we
+ don't see any -g options, force -g, so that we invoke the
+ assembler with the right debug option. */
+ if (!saw_opt_g)
+ {
+ generate_option (OPT_g, "1", 0, CL_DRIVER, &new_decoded_options[j]);
+ j++;
+ }
+
/* NOTE: We start at 1 now, not 0. */
while (i < argc)
{