I have committed the attached patch to add t-eh-dw2-dip to NetBSD libgcc
tmake_file.
Bootstrapped and tested on i386-unknown-netbsdelf6.1 and
x86_64-unknown-netbsd6.1.
/Krister
2016-12-19 Krister Walfridsson <krister.walfrids...@gmail.com>
* config.host (*-*-netbsd*): Add t-eh-dw2-dip to tmake_file.
* crtstuff.c (BSD_DL_ITERATE_PHDR_AVAILABLE): Define for NetBSD.
* unwind-dw2-fde-dip.c (USE_PT_GNU_EH_FRAME, ElfW): Likewise.
Index: libgcc/config.host
===================================================================
--- libgcc/config.host (revision 243789)
+++ libgcc/config.host (revision 243790)
@@ -240,7 +240,8 @@
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
;;
*-*-netbsd*)
- tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-slibgcc t-slibgcc-gld
t-slibgcc-elf-ver"
+ tmake_file="$tmake_file t-crtstuff-pic t-libgcc-pic t-eh-dw2-dip"
+ tmake_file="$tmake_file t-slibgcc t-slibgcc-gld t-slibgcc-elf-ver"
# NetBSD 1.7 and later are set up to use GCC's crtstuff for
# ELF configurations. We will clear extra_parts in the
# a.out configurations.
Index: libgcc/unwind-dw2-fde-dip.c
===================================================================
--- libgcc/unwind-dw2-fde-dip.c (revision 243789)
+++ libgcc/unwind-dw2-fde-dip.c (revision 243790)
@@ -71,7 +71,7 @@
#endif
#if !defined(inhibit_libc) && defined(HAVE_LD_EH_FRAME_HDR) \
- && defined(__OpenBSD__)
+ && (defined(__OpenBSD__) || defined(__NetBSD__))
# define ElfW(type) Elf_##type
# define USE_PT_GNU_EH_FRAME
#endif
Index: libgcc/crtstuff.c
===================================================================
--- libgcc/crtstuff.c (revision 243789)
+++ libgcc/crtstuff.c (revision 243790)
@@ -81,7 +81,7 @@
#endif
#if defined(TARGET_DL_ITERATE_PHDR) && \
- (defined(__DragonFly__) || defined(__FreeBSD__))
+ (defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__))
#define BSD_DL_ITERATE_PHDR_AVAILABLE
#endif