diff options
author | Olivier Hainque <hainque@adacore.com> | 2022-09-26 16:05:48 +0000 |
---|---|---|
committer | Olivier Hainque <hainque@adacore.com> | 2022-10-07 06:53:30 +0000 |
commit | 8dffd0e9621d93faabb6676e7a018cb5267dfa22 (patch) | |
tree | d0a90802d2284ff8d65a684481447d2b5551c45c /gcc/config | |
parent | 8307b7d6d0335da952a87bf56015f830072ac431 (diff) | |
download | gcc-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/config')
-rw-r--r-- | gcc/config/vxworks.cc | 10 | ||||
-rw-r--r-- | gcc/config/vxworks.h | 8 |
2 files changed, 6 insertions, 12 deletions
diff --git a/gcc/config/vxworks.cc b/gcc/config/vxworks.cc index 9d25873..f0c0df2 100644 --- a/gcc/config/vxworks.cc +++ b/gcc/config/vxworks.cc @@ -164,16 +164,10 @@ vxworks_override_options (void) if (flag_pic > 0 && !TARGET_VXWORKS_RTP) error ("PIC is only supported for RTPs"); - /* VxWorks comes with non-gdb debuggers which only support strict - dwarf up to certain version. Default dwarf control to friendly - values for these. */ - + /* VxWorks comes with non-gdb debuggers which only support strict dwarf + up to certain versions, as controlled by DWARF_VERSION_DEFAULT. */ if (!OPTION_SET_P (dwarf_strict)) dwarf_strict = 1; - - if (!OPTION_SET_P (dwarf_version)) - dwarf_version = VXWORKS_DWARF_VERSION_DEFAULT; - } /* We don't want to use library symbol __clear_cache on SR0640. Avoid diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h index 84a9c93..d6ac83b 100644 --- a/gcc/config/vxworks.h +++ b/gcc/config/vxworks.h @@ -376,11 +376,11 @@ extern void vxworks_asm_out_destructor (rtx symbol, int priority); vxworks_emit_call_builtin___clear_cache extern void vxworks_emit_call_builtin___clear_cache (rtx begin, rtx end); -/* Default dwarf control values, for non-gdb debuggers that come with - VxWorks. */ +/* Default dwarf control values, accounting for non-gdb debuggers that come + with VxWorks. */ -#undef VXWORKS_DWARF_VERSION_DEFAULT -#define VXWORKS_DWARF_VERSION_DEFAULT (TARGET_VXWORKS7 ? 4 : 2) +#undef DWARF_VERSION_DEFAULT +#define DWARF_VERSION_DEFAULT (TARGET_VXWORKS7 ? 4 : 2) #undef DWARF_GNAT_ENCODINGS_DEFAULT #define DWARF_GNAT_ENCODINGS_DEFAULT \ |