aboutsummaryrefslogtreecommitdiff
path: root/gcc/defaults.h
diff options
context:
space:
mode:
authorOlivier Hainque <hainque@adacore.com>2022-09-26 16:05:48 +0000
committerOlivier Hainque <hainque@adacore.com>2022-10-07 06:53:30 +0000
commit8dffd0e9621d93faabb6676e7a018cb5267dfa22 (patch)
treed0a90802d2284ff8d65a684481447d2b5551c45c /gcc/defaults.h
parent8307b7d6d0335da952a87bf56015f830072ac431 (diff)
downloadgcc-8dffd0e9621d93faabb6676e7a018cb5267dfa22.zip
gcc-8dffd0e9621d93faabb6676e7a018cb5267dfa22.tar.gz
gcc-8dffd0e9621d93faabb6676e7a018cb5267dfa22.tar.bz2
Introduce DWARF_VERSION_DEFAULT and redefine for VxWorks
This change introduces a target overridable macro to replace the hardcoded value used to initialize dwarf_version from common.opt. The main advantage compared to special code in a target override_options hook is that redefinitions by target config files are visible by both the compiler proper and by the driver, which might refer to dwarf_version in ASM_DEBUG_SPECs and friends. This is useful at least on VxWorks, where we usually need to default to dwarf 4 or even 2 to accommodate non-gdb debuggers provided by the environment, including for assembly sources used in libgcc for some ports (witnessed with lse.S on aarch64). 2022-02-28 Olivier Hainque <hainque@adacore.com> gcc/ * defaults.h (DWARF_DEFAULT_VERSION): Define if not defined already. * common.opt (gdwarf-): Use it. * doc/tm.texi.in (DWARF_DEFAULT_VERSION): Document. * doc/tm.texi: Update accordingly. * config/vxworks.h (DWARF_DEFAULT_VERSION): Redefine. * config/vxworks.cc: Remove code setting dwarf_version, now handled by the DWARF_DEFAULT_VERSION redefinition.
Diffstat (limited to 'gcc/defaults.h')
-rw-r--r--gcc/defaults.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 953605c..376687d 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -1441,6 +1441,12 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
#define DWARF_GNAT_ENCODINGS_DEFAULT DWARF_GNAT_ENCODINGS_GDB
#endif
+/* When generating dwarf info, the default standard version we'll honor
+ and advertise in absence of -gdwarf-<N> on the command line. */
+#ifndef DWARF_VERSION_DEFAULT
+#define DWARF_VERSION_DEFAULT 5
+#endif
+
#ifndef USED_FOR_TARGET
/* Done this way to keep gengtype happy. */
#if BITS_PER_UNIT == 8