[Bug target/47269] DSYMUTIL_SPEC doesn't handle -gtoggle
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47269 --- Comment #4 from Jack Howarth 2011-02-06 02:15:08 UTC --- Mike, I thought it was pretty clear in the man page... -gtoggle Turn off generation of debug info, if leaving out this option would have generated it, or turn it on at level 2 otherwise. The position of this argument in the command line does not matter, it takes effect after all other options are processed, and it does so only once, no matter how many times it is given. This is mainly intended to be used with -fcompare-debug. It inverts whatever the final status of debug code generation was. I think this is why you see it handled in toplev.c... if (flag_gtoggle) { if (debug_info_level == DINFO_LEVEL_NONE) { debug_info_level = DINFO_LEVEL_NORMAL; if (write_symbols == NO_DEBUG) write_symbols = PREFERRED_DEBUGGING_TYPE; } else debug_info_level = DINFO_LEVEL_NONE; } rather than in opts.c.
[Bug target/47269] DSYMUTIL_SPEC doesn't handle -gtoggle
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47269 --- Comment #3 from Mike Stump 2011-02-06 01:31:52 UTC --- If I understand what they intend, though, the documentation isn't clear on this point: %{!gtoggle: %{gdwarf-2:%{!gstabs*:%{!g0: -idsym}}}\ %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \ %{gdwarf-2:%{!gstabs*:%{!g0: -dsym } %(gtoggle: %{!gdwarf-2:%{!gstabs*:%{!g0: -idsym}}}\ %{.c|.cc|.C|.cpp|.cp|.c++|.cxx|.CPP|.m|.mm: \ %{!gdwarf-2:%{!gstabs*:%{!g0: -dsym } that said, I'd have the explain in detail exactly what happens with -g0 and -gstabs. You'd have to check to {} nesting to make sure I the } at the very end is right.
[Bug target/47269] DSYMUTIL_SPEC doesn't handle -gtoggle
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47269 --- Comment #2 from Mike Stump 2011-02-06 01:10:06 UTC --- Luckily specs can do this: %{!fdump=*:%{!fsyntax-only:foo}} says to put in foo, if those two flags are not given; this is and.
[Bug target/47269] DSYMUTIL_SPEC doesn't handle -gtoggle
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47269 --- Comment #1 from Jack Howarth 2011-01-13 05:23:00 UTC --- This seems impossible to implement without the addition of a logical AND to the spec language and the ability to place parentheses. We have two cases which have to be tested as true... (!g0 & !gtoggle) | (g0 & gtoggle) in order to properly decided if -dsym should be passed.