diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2020-11-20 21:11:22 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2020-11-20 21:11:22 +0000 |
commit | f50c417a036697eccfad5a1d6ce777246c77635a (patch) | |
tree | 9ef1d2bace680c43f0c9a8b6811cfa0fb1c9a185 /libgcc/unwind-dw2-fde-dip.c | |
parent | df90f070378583f295dd972db4400f324752a240 (diff) | |
download | gcc-f50c417a036697eccfad5a1d6ce777246c77635a.zip gcc-f50c417a036697eccfad5a1d6ce777246c77635a.tar.gz gcc-f50c417a036697eccfad5a1d6ce777246c77635a.tar.bz2 |
NetBSD/libgcc: Check for TARGET_DL_ITERATE_PHDR in the unwinder
Disable USE_PT_GNU_EH_FRAME frame unwinder support for old OS versions,
fixing compilation errors:
.../libgcc/unwind-dw2-fde-dip.c:75:21: error: unknown type name 'Elf_Phdr'
75 | # define ElfW(type) Elf_##type
| ^~~~
.../libgcc/unwind-dw2-fde-dip.c:132:9: note: in expansion of macro 'ElfW'
132 | const ElfW(Phdr) *p_eh_frame_hdr;
| ^~~~
.../libgcc/unwind-dw2-fde-dip.c:75:21: error: unknown type name 'Elf_Phdr'
75 | # define ElfW(type) Elf_##type
| ^~~~
.../libgcc/unwind-dw2-fde-dip.c:133:9: note: in expansion of macro 'ElfW'
133 | const ElfW(Phdr) *p_dynamic;
| ^~~~
.../libgcc/unwind-dw2-fde-dip.c:165:37: warning: 'struct dl_phdr_info' declared inside parameter list will not be visible outside of this definition or declaration
165 | _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
| ^~~~~~~~~~~~
[...]
and producing a working cross-compiler at least with VAX/NetBSD 1.6.2.
libgcc/
* unwind-dw2-fde-dip.c [__OpenBSD__ || __NetBSD__]
(USE_PT_GNU_EH_FRAME): Do not define if !TARGET_DL_ITERATE_PHDR.
Diffstat (limited to 'libgcc/unwind-dw2-fde-dip.c')
-rw-r--r-- | libgcc/unwind-dw2-fde-dip.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libgcc/unwind-dw2-fde-dip.c b/libgcc/unwind-dw2-fde-dip.c index 6e50405..e60c9fe 100644 --- a/libgcc/unwind-dw2-fde-dip.c +++ b/libgcc/unwind-dw2-fde-dip.c @@ -71,6 +71,7 @@ #endif #if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \ + && defined(TARGET_DL_ITERATE_PHDR) \ && (defined(__OpenBSD__) || defined(__NetBSD__)) # define ElfW(type) Elf_##type # define USE_PT_GNU_EH_FRAME |