pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

ldc: Update to version 0.17.6 (last C++ version)



Module Name:	pkgsrc-wip
Committed By:	Dan Cîrnaț <dan%alt.md@localhost>
Pushed By:	cirnatdan
Date:		Thu May 7 16:11:01 2020 +0200
Changeset:	d02449ee1069067c6e0df5ae5693a31f1d27aa8b

Modified Files:
	ldc/Makefile
	ldc/PLIST
	ldc/distinfo
	ldc/patches/patch-runtime_druntime_osmodel.mak
	ldc/patches/patch-runtime_druntime_src_core_runtime.d
	ldc/patches/patch-runtime_druntime_src_core_stdc_errno.d
	ldc/patches/patch-runtime_druntime_src_core_stdc_fenv.d
	ldc/patches/patch-runtime_druntime_src_core_stdc_math.d
	ldc/patches/patch-runtime_druntime_src_core_stdc_stdio.d
	ldc/patches/patch-runtime_druntime_src_core_stdc_stdlib.d
	ldc/patches/patch-runtime_druntime_src_core_stdc_time.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_arpa_inet.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_dirent.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_fcntl.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_grp.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_netdb.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_netinet_in__.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_poll.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_pthread.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_pwd.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_sched.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_semaphore.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_setjmp.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_signal.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_stdlib.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_mman.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_resource.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_socket.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_stat.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_time.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_wait.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_termios.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_time.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_ucontext.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_unistd.d
	ldc/patches/patch-runtime_druntime_src_core_thread.d
	ldc/patches/patch-runtime_druntime_src_gc_os.d
	ldc/patches/patch-runtime_druntime_src_rt_bss__section.c
	ldc/patches/patch-runtime_druntime_src_rt_sections.d
	ldc/patches/patch-runtime_druntime_src_rt_sections__elf__shared.d
	ldc/patches/patch-runtime_druntime_src_rt_sections__ldc.d
	ldc/patches/patch-runtime_druntime_test_shared_src_load.d
	ldc/patches/patch-runtime_phobos_osmodel.mak
	ldc/patches/patch-runtime_phobos_std_conv.d
	ldc/patches/patch-runtime_phobos_std_datetime.d
	ldc/patches/patch-runtime_phobos_std_file.d
	ldc/patches/patch-runtime_phobos_std_math.d
	ldc/patches/patch-runtime_phobos_std_system.d
	libLLVM38/buildlink3.mk
Added Files:
	ldc/patches/patch-runtime_CMakeLists.txt
Removed Files:
	ldc/patches/patch-runtime_druntime_src_core_stdc_config.d
	ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_dlfcn.d
	ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_execinfo.d
	ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_cdefs.d
	ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf.d
	ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf32.d
	ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf64.d
	ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf__common.d
	ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_event.d
	ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_link__elf.d
	ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_mman.d
	ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_time.d
	ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_types.d
	ldc/patches/patch-runtime_druntime_src_core_threadasm.S
	ldc/patches/patch-runtime_druntime_src_rt_dmain2.d
	ldc/patches/patch-runtime_phobos_std_internal_math_gammafunction.d

Log Message:
ldc: Update to version 0.17.6 (last C++ version)

Tested on Linux AArch64
Builds successfully against libLLVM38 but is probably broken on NetBSD

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d02449ee1069067c6e0df5ae5693a31f1d27aa8b

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 ldc/Makefile                                       |  65 +-
 ldc/PLIST                                          |  35 +-
 ldc/distinfo                                       | 115 ++-
 ldc/patches/patch-runtime_CMakeLists.txt           |  13 +
 ldc/patches/patch-runtime_druntime_osmodel.mak     |   4 +-
 .../patch-runtime_druntime_src_core_runtime.d      |  24 +-
 .../patch-runtime_druntime_src_core_stdc_config.d  |  15 -
 .../patch-runtime_druntime_src_core_stdc_errno.d   |  10 +-
 .../patch-runtime_druntime_src_core_stdc_fenv.d    |  53 +-
 .../patch-runtime_druntime_src_core_stdc_math.d    | 559 +------------
 .../patch-runtime_druntime_src_core_stdc_stdio.d   | 118 +--
 .../patch-runtime_druntime_src_core_stdc_stdlib.d  |   6 +-
 .../patch-runtime_druntime_src_core_stdc_time.d    |  20 +-
 ...ch-runtime_druntime_src_core_sys_netbsd_dlfcn.d | 120 ---
 ...runtime_druntime_src_core_sys_netbsd_execinfo.d | 140 ----
 ...untime_druntime_src_core_sys_netbsd_sys_cdefs.d |  23 -
 ...-runtime_druntime_src_core_sys_netbsd_sys_elf.d |  18 -
 ...untime_druntime_src_core_sys_netbsd_sys_elf32.d | 194 -----
 ...untime_druntime_src_core_sys_netbsd_sys_elf64.d | 200 -----
 ..._druntime_src_core_sys_netbsd_sys_elf__common.d | 866 ---------------------
 ...untime_druntime_src_core_sys_netbsd_sys_event.d | 115 ---
 ...me_druntime_src_core_sys_netbsd_sys_link__elf.d |  85 --
 ...runtime_druntime_src_core_sys_netbsd_sys_mman.d | 153 ----
 ...tch-runtime_druntime_src_core_sys_netbsd_time.d |  26 -
 ...runtime_druntime_src_core_sys_posix_arpa_inet.d |   8 +-
 ...ch-runtime_druntime_src_core_sys_posix_dirent.d |  16 +-
 ...tch-runtime_druntime_src_core_sys_posix_fcntl.d |   8 +-
 ...patch-runtime_druntime_src_core_sys_posix_grp.d |  20 +-
 ...tch-runtime_druntime_src_core_sys_posix_netdb.d |   9 +-
 ...time_druntime_src_core_sys_posix_netinet_in__.d |  10 +-
 ...atch-runtime_druntime_src_core_sys_posix_poll.d |   6 +-
 ...h-runtime_druntime_src_core_sys_posix_pthread.d |  99 +--
 ...patch-runtime_druntime_src_core_sys_posix_pwd.d |  22 +-
 ...tch-runtime_druntime_src_core_sys_posix_sched.d |  20 +-
 ...runtime_druntime_src_core_sys_posix_semaphore.d |   8 +-
 ...ch-runtime_druntime_src_core_sys_posix_setjmp.d |  25 +-
 ...ch-runtime_druntime_src_core_sys_posix_signal.d |  22 +-
 ...ch-runtime_druntime_src_core_sys_posix_stdlib.d |  44 +-
 ...-runtime_druntime_src_core_sys_posix_sys_mman.d |  24 +-
 ...time_druntime_src_core_sys_posix_sys_resource.d |  18 +-
 ...untime_druntime_src_core_sys_posix_sys_socket.d |  28 +-
 ...-runtime_druntime_src_core_sys_posix_sys_stat.d |  28 +-
 ...-runtime_druntime_src_core_sys_posix_sys_time.d |   6 +-
 ...runtime_druntime_src_core_sys_posix_sys_types.d | 102 ---
 ...-runtime_druntime_src_core_sys_posix_sys_wait.d |  40 +-
 ...h-runtime_druntime_src_core_sys_posix_termios.d | 122 +--
 ...atch-runtime_druntime_src_core_sys_posix_time.d |  74 +-
 ...-runtime_druntime_src_core_sys_posix_ucontext.d |   6 +-
 ...ch-runtime_druntime_src_core_sys_posix_unistd.d |  37 +-
 .../patch-runtime_druntime_src_core_thread.d       |  37 +-
 .../patch-runtime_druntime_src_core_threadasm.S    |  15 -
 ldc/patches/patch-runtime_druntime_src_gc_os.d     |   8 +-
 .../patch-runtime_druntime_src_rt_bss__section.c   |   6 +-
 ldc/patches/patch-runtime_druntime_src_rt_dmain2.d |  50 --
 .../patch-runtime_druntime_src_rt_sections.d       |   6 +-
 ...runtime_druntime_src_rt_sections__elf__shared.d |  64 +-
 .../patch-runtime_druntime_src_rt_sections__ldc.d  |  23 +-
 .../patch-runtime_druntime_test_shared_src_load.d  |   6 +-
 ldc/patches/patch-runtime_phobos_osmodel.mak       |   4 +-
 ldc/patches/patch-runtime_phobos_std_conv.d        |   6 +-
 ldc/patches/patch-runtime_phobos_std_datetime.d    |  66 +-
 ldc/patches/patch-runtime_phobos_std_file.d        |  10 +-
 ...untime_phobos_std_internal_math_gammafunction.d | 116 ---
 ldc/patches/patch-runtime_phobos_std_math.d        |  38 +-
 ldc/patches/patch-runtime_phobos_std_system.d      |  22 +-
 libLLVM38/buildlink3.mk                            |   2 +
 66 files changed, 393 insertions(+), 3865 deletions(-)

diffs:
diff --git a/ldc/Makefile b/ldc/Makefile
index f5008ce274..1c1b2d7522 100644
--- a/ldc/Makefile
+++ b/ldc/Makefile
@@ -1,6 +1,6 @@
 # $NetBSD$
 
-PKGNAME=	ldc-0.17.0
+PKGNAME=	ldc-0.17.6
 PKGREVISION=	1
 DISTNAME=	${PKGNAME_NOREV}-src
 GITHUB_RELEASE=	v${PKGVERSION_NOREV}
@@ -33,69 +33,6 @@ post-install:
 	${MKDIR} -p ${DESTDIR}${EGDIR}	\
 		&& ${MV} ${DESTDIR}${PREFIX}/etc/ldc2.conf	\
 			${DESTDIR}${EGDIR}
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/runtime.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/stdc/config.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/stdc/errno.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/stdc/fenv.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/stdc/locale.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/stdc/math.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/stdc/stdio.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/stdc/stdlib.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/stdc/string.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/stdc/tgmath.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/stdc/time.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/netbsd/dlfcn.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/netbsd/execinfo.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/netbsd/sys/cdefs.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/netbsd/sys/elf.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/netbsd/sys/elf32.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/netbsd/sys/elf64.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/netbsd/sys/elf_common.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/netbsd/sys/event.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/netbsd/sys/link_elf.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/netbsd/sys/mman.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/netbsd/time.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/arpa/inet.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/dirent.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/dlfcn.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/fcntl.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/grp.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/net/if_.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/netdb.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/netinet/in_.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/netinet/tcp.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/poll.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/pthread.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/pwd.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sched.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/semaphore.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/setjmp.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/signal.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/stdio.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/stdlib.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/ioctl.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/ipc.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/mman.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/resource.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/select.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/shm.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/socket.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/stat.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/time.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/types.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/uio.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/un.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/utsname.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/sys/wait.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/syslog.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/termios.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/time.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/ucontext.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/unistd.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/sys/posix/utime.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/thread.d.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/threadasm.S.orig
-	${RM} ${DESTDIR}${PREFIX}/include/d/core/time.d.orig
 
 .include "../../wip/libLLVM38/buildlink3.mk"
 .include "../../devel/libconfig/buildlink3.mk"
diff --git a/ldc/PLIST b/ldc/PLIST
index bac9ceb0f9..72abc79d5d 100644
--- a/ldc/PLIST
+++ b/ldc/PLIST
@@ -1,6 +1,7 @@
 @comment $NetBSD$
 bin/ldc2
 bin/ldmd2
+etc/bash_completion.d/ldc2
 include/d/core/atomic.d
 include/d/core/bitop.d
 include/d/core/checkedint.d
@@ -43,6 +44,21 @@ include/d/core/sync/exception.d
 include/d/core/sync/mutex.d
 include/d/core/sync/rwmutex.d
 include/d/core/sync/semaphore.d
+include/d/core/sys/dragonflybsd/dlfcn.d
+include/d/core/sys/dragonflybsd/execinfo.d
+include/d/core/sys/dragonflybsd/netinet/in_.d
+include/d/core/sys/dragonflybsd/pthread_np.d
+include/d/core/sys/dragonflybsd/sys/_bitset.d
+include/d/core/sys/dragonflybsd/sys/_cpuset.d
+include/d/core/sys/dragonflybsd/sys/cdefs.d
+include/d/core/sys/dragonflybsd/sys/elf.d
+include/d/core/sys/dragonflybsd/sys/elf32.d
+include/d/core/sys/dragonflybsd/sys/elf64.d
+include/d/core/sys/dragonflybsd/sys/elf_common.d
+include/d/core/sys/dragonflybsd/sys/event.d
+include/d/core/sys/dragonflybsd/sys/link_elf.d
+include/d/core/sys/dragonflybsd/sys/mman.d
+include/d/core/sys/dragonflybsd/time.d
 include/d/core/sys/freebsd/dlfcn.d
 include/d/core/sys/freebsd/execinfo.d
 include/d/core/sys/freebsd/sys/cdefs.d
@@ -70,17 +86,6 @@ include/d/core/sys/linux/sys/xattr.d
 include/d/core/sys/linux/termios.d
 include/d/core/sys/linux/time.d
 include/d/core/sys/linux/tipc.d
-include/d/core/sys/netbsd/dlfcn.d
-include/d/core/sys/netbsd/execinfo.d
-include/d/core/sys/netbsd/sys/cdefs.d
-include/d/core/sys/netbsd/sys/elf.d
-include/d/core/sys/netbsd/sys/elf32.d
-include/d/core/sys/netbsd/sys/elf64.d
-include/d/core/sys/netbsd/sys/elf_common.d
-include/d/core/sys/netbsd/sys/event.d
-include/d/core/sys/netbsd/sys/link_elf.d
-include/d/core/sys/netbsd/sys/mman.d
-include/d/core/sys/netbsd/time.d
 include/d/core/sys/osx/execinfo.d
 include/d/core/sys/osx/mach/dyld.d
 include/d/core/sys/osx/mach/getsect.d
@@ -179,12 +184,9 @@ include/d/ldc/eh/fixedpool.d
 include/d/ldc/eh/libunwind.d
 include/d/ldc/eh/win32.d
 include/d/ldc/eh/win64.d
+include/d/ldc/eh_asm.S
 include/d/ldc/gccbuiltins_aarch64.di
-include/d/ldc/gccbuiltins_arm.di
-include/d/ldc/gccbuiltins_mips.di
-include/d/ldc/gccbuiltins_ppc.di
-include/d/ldc/gccbuiltins_s390.di
-include/d/ldc/gccbuiltins_x86.di
+include/d/ldc/internal/vararg.di
 include/d/ldc/intrinsics.di
 include/d/ldc/llvmasm.di
 include/d/ldc/msvc.c
@@ -330,3 +332,4 @@ lib/libdruntime-ldc.a
 lib/libphobos2-ldc-debug.a
 lib/libphobos2-ldc.a
 share/examples/ldc/ldc2.conf
+@pkgdir include/d/etc/c/zlib
diff --git a/ldc/distinfo b/ldc/distinfo
index 38e5a59004..bc42425a8a 100644
--- a/ldc/distinfo
+++ b/ldc/distinfo
@@ -1,89 +1,74 @@
 $NetBSD$
 
-SHA1 (ldc-0.17.0-src.tar.gz) = 5cf60c835cde891b996ea69f0d934dac10002b82
-RMD160 (ldc-0.17.0-src.tar.gz) = 08ecc79943527b21887c78941445fa27fe1e308c
-SHA512 (ldc-0.17.0-src.tar.gz) = 89ebac16bbe2b2b2baa421b6e96371926fd3c78a38b0be6c322cc1f1eda880598027464c18bce8d3b206742038d0d35b1df061f878da43233184bcd3c2778d8a
-Size (ldc-0.17.0-src.tar.gz) = 4947638 bytes
-SHA1 (patch-runtime_druntime_osmodel.mak) = 79ec151a5c4548da9b398dd24509df9f051fa3c3
-SHA1 (patch-runtime_druntime_src_core_runtime.d) = abb900a58d9e9405207e4046ab2b3c115afa9565
-SHA1 (patch-runtime_druntime_src_core_stdc_config.d) = 30cf376ceddf9e161c7d9587e77df391e7b9c382
-SHA1 (patch-runtime_druntime_src_core_stdc_errno.d) = 904f511a8659a4dce3a135c97730258b55d11f96
-SHA1 (patch-runtime_druntime_src_core_stdc_fenv.d) = 42493a06ed3b62ec36f1014dd6ba8053499f975e
+SHA1 (ldc-0.17.6-src.tar.gz) = b702484fc38feded05e5f42c34ce66d0d14db139
+RMD160 (ldc-0.17.6-src.tar.gz) = 2e77c5c50fef02c6d6ae912dad478d3043389560
+SHA512 (ldc-0.17.6-src.tar.gz) = 433a3582bb5214004a676741d7483ed87066b47b8bfec4633796ca5a717c78ea54ee7b9c2ce1cf7bc399082802f15133d28cb4884b879326d224f48687af68e3
+Size (ldc-0.17.6-src.tar.gz) = 4986528 bytes
+SHA1 (patch-runtime_CMakeLists.txt) = a3521c5d824e9d832ed3b183147ff6c9050d2b4a
+SHA1 (patch-runtime_druntime_osmodel.mak) = 547cec590e69a96909894361affc464b250ceb7d
+SHA1 (patch-runtime_druntime_src_core_runtime.d) = cade769b1da2d7abe71533cc85bafffc06938046
+SHA1 (patch-runtime_druntime_src_core_stdc_errno.d) = 55e14f8d16928f97a03d6a45858d9dfa873f9094
+SHA1 (patch-runtime_druntime_src_core_stdc_fenv.d) = 1c9ac3e39e6539f6468cdece973f5ac4a4151c0e
 SHA1 (patch-runtime_druntime_src_core_stdc_locale.d) = cb0d3424dfbe61570e446ea04d1298bba5123f83
-SHA1 (patch-runtime_druntime_src_core_stdc_math.d) = f020416b74539c5c47460a27a777258af400188b
-SHA1 (patch-runtime_druntime_src_core_stdc_stdio.d) = 9db34e143a47055276f800dd08fb0d4e857e1889
-SHA1 (patch-runtime_druntime_src_core_stdc_stdlib.d) = 316a55df93f5cd0631af0501dd02d7994b6d18c2
+SHA1 (patch-runtime_druntime_src_core_stdc_math.d) = 575c6169f92c72ba1bac9a3a0775467f090f19b2
+SHA1 (patch-runtime_druntime_src_core_stdc_stdio.d) = bde2de27d32a24513871cc6d06f1e0cea4db0933
+SHA1 (patch-runtime_druntime_src_core_stdc_stdlib.d) = 5c4815141e1ffd5b2033524d3cf11fd423379afd
 SHA1 (patch-runtime_druntime_src_core_stdc_string.d) = 7b32050fbc38700ec9b258f4c7ed497ed8d6cde2
 SHA1 (patch-runtime_druntime_src_core_stdc_tgmath.d) = 4d8945b639362035b9bc45d325e50291e77a0eaa
-SHA1 (patch-runtime_druntime_src_core_stdc_time.d) = 8c06a57314f9426c5cc3823e8c2ad6661049e155
-SHA1 (patch-runtime_druntime_src_core_sys_netbsd_dlfcn.d) = 70ec062cbf25e5b36df5bca96fd0dcb41d9576ea
-SHA1 (patch-runtime_druntime_src_core_sys_netbsd_execinfo.d) = db9625cbb38824b79ce70a9cda8f8952c0014f14
-SHA1 (patch-runtime_druntime_src_core_sys_netbsd_sys_cdefs.d) = 5593bd0e2fc1149cee85bbe0f79377e802a814e2
-SHA1 (patch-runtime_druntime_src_core_sys_netbsd_sys_elf.d) = a0793194daab3282b9ef1335a0024b68b4d26b2f
-SHA1 (patch-runtime_druntime_src_core_sys_netbsd_sys_elf32.d) = 4e835863c3d0c6a09a8a78edad07206ee59b0c0d
-SHA1 (patch-runtime_druntime_src_core_sys_netbsd_sys_elf64.d) = 22551af51967749286e8e22940317b8f64a34872
-SHA1 (patch-runtime_druntime_src_core_sys_netbsd_sys_elf__common.d) = 819c3454fe15003416eb5fa64fdc5548066e9384
-SHA1 (patch-runtime_druntime_src_core_sys_netbsd_sys_event.d) = d0e2895914178bd79a6fa30dce519e08e7bd3cec
-SHA1 (patch-runtime_druntime_src_core_sys_netbsd_sys_link__elf.d) = 35b380d001f1f911a9cbac349c95fffc17e5a0a3
-SHA1 (patch-runtime_druntime_src_core_sys_netbsd_sys_mman.d) = 794923731548e0c9397bb15b30de965652b9de7f
-SHA1 (patch-runtime_druntime_src_core_sys_netbsd_time.d) = 970f4204ce08c7c6019e9491009afeba93bfc2dc
-SHA1 (patch-runtime_druntime_src_core_sys_posix_arpa_inet.d) = b0a0ee39475d5801a982b6387fb5b2c3c96a4745
-SHA1 (patch-runtime_druntime_src_core_sys_posix_dirent.d) = 2973149c750af149f0210d83805dc22540a15466
+SHA1 (patch-runtime_druntime_src_core_stdc_time.d) = 949dd115a983c378c411e205c0d5f4d5e7d295eb
+SHA1 (patch-runtime_druntime_src_core_sys_posix_arpa_inet.d) = 2cf8ad42ebae1a238b2e11daab7daddde1b908f1
+SHA1 (patch-runtime_druntime_src_core_sys_posix_dirent.d) = 2355ef250f2401a6542b6a9ff5df5362520f4eeb
 SHA1 (patch-runtime_druntime_src_core_sys_posix_dlfcn.d) = 10e243b140b50fddd2304f343a28d778fca4ee75
-SHA1 (patch-runtime_druntime_src_core_sys_posix_fcntl.d) = 7f3302aade6031b3359219a2b1b618b2fb14878a
-SHA1 (patch-runtime_druntime_src_core_sys_posix_grp.d) = 2ce33f0732166dffcfe8d6a3670b789a5d192bfc
+SHA1 (patch-runtime_druntime_src_core_sys_posix_fcntl.d) = bfab0d7bdfc9a55795668884aac77fac7f9b9e3b
+SHA1 (patch-runtime_druntime_src_core_sys_posix_grp.d) = 9fe4d406ed4b49b9291900934e287bf95c9824d4
 SHA1 (patch-runtime_druntime_src_core_sys_posix_net_if__.d) = 56ccad60f480a0052224b07978050057174724c1
-SHA1 (patch-runtime_druntime_src_core_sys_posix_netdb.d) = eb2c65470961bd845eb03322282cb09186d9fad6
-SHA1 (patch-runtime_druntime_src_core_sys_posix_netinet_in__.d) = f06cc34b5d032272092d356d04899662ec77fe13
+SHA1 (patch-runtime_druntime_src_core_sys_posix_netdb.d) = 028ad42939529e2d6c2bed61cf07dbb44c8c68c3
+SHA1 (patch-runtime_druntime_src_core_sys_posix_netinet_in__.d) = 73177953d3f720762690312f3914d389081a5e66
 SHA1 (patch-runtime_druntime_src_core_sys_posix_netinet_tcp.d) = cef34601e8c65692a828ced8b0ccdc381611d4c8
-SHA1 (patch-runtime_druntime_src_core_sys_posix_poll.d) = cb8a51a0751a98283b185999f0f7fc2720939a68
-SHA1 (patch-runtime_druntime_src_core_sys_posix_pthread.d) = ca30b198f735d9f20c030aeff22d7a8b54a762e5
-SHA1 (patch-runtime_druntime_src_core_sys_posix_pwd.d) = fe19b7934973d5eed2bc07b6a93ec7b266a4bd12
-SHA1 (patch-runtime_druntime_src_core_sys_posix_sched.d) = 374f5037aed80a818b79aa99be58780747e8981a
-SHA1 (patch-runtime_druntime_src_core_sys_posix_semaphore.d) = 9ba232716f64ff27bae870c78b34a1f93d4bd691
-SHA1 (patch-runtime_druntime_src_core_sys_posix_setjmp.d) = 27df98df8b40901b0e0487d4aa16c63234ddc49b
-SHA1 (patch-runtime_druntime_src_core_sys_posix_signal.d) = 247024ca1036b5dbb10b11e8fd27f6d8e3426997
+SHA1 (patch-runtime_druntime_src_core_sys_posix_poll.d) = ba528e4bc0bc6437cd537d17abe6a7eea69b1adf
+SHA1 (patch-runtime_druntime_src_core_sys_posix_pthread.d) = 652e533f8b484ba440c507df17351de21291de43
+SHA1 (patch-runtime_druntime_src_core_sys_posix_pwd.d) = 9be61a4dc40f7f6aed896d34a99e3c69e317fe3c
+SHA1 (patch-runtime_druntime_src_core_sys_posix_sched.d) = 31575d0885a7f778e24698e5246e79687d27c534
+SHA1 (patch-runtime_druntime_src_core_sys_posix_semaphore.d) = 543678a528f1ac31f0413086971e15860ef4860a
+SHA1 (patch-runtime_druntime_src_core_sys_posix_setjmp.d) = ff1cc78d36171e2ec510a0328653edbd015fbc40
+SHA1 (patch-runtime_druntime_src_core_sys_posix_signal.d) = ea412381a7a239877a90d379a219bde5926ce7a1
 SHA1 (patch-runtime_druntime_src_core_sys_posix_stdio.d) = 4ed539032bcf8fb4626e9b1933e01c82afbe4476
-SHA1 (patch-runtime_druntime_src_core_sys_posix_stdlib.d) = 4b71a243b566ad3a0fefe21c96a154b2d9b41292
+SHA1 (patch-runtime_druntime_src_core_sys_posix_stdlib.d) = 82d9dbf6dbb2970e87b78f6f29567b87da83e21e
 SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_ioctl.d) = 5cbe309208ce02b0e2b39fc8794452c16fc905d6
 SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_ipc.d) = b3f63a86b25104cf281927993f119c42e0729cc3
-SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_mman.d) = 695acba21ad3fb402768942e8d4c17be0c61e124
-SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_resource.d) = 0760417ca4d3fbf104cf19293ce83f46bece9556
+SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_mman.d) = ecdd0d0caedd9d268e1784318db9f46cca4c683d
+SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_resource.d) = cdf348a19e93d60bece85f2df176042b317f0929
 SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_select.d) = 5a8c8a580f6fd79ad81d98ce2a7e0eaefce67c8b
 SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_shm.d) = 0e3c3c2bd97d9d1053aba468db1580566d93733e
-SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_socket.d) = 1a2b2c8108021b1849302f3a139294032a259eda
-SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_stat.d) = a56a9adf7afa7cd7dd34ac716bd068f87d1b7cd1
-SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_time.d) = 48a48542a268643ff480e4e1ffbba97b8a8a56e2
-SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_types.d) = b2bbeeb6fccf683f2f48a8addd31181b9b809180
+SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_socket.d) = 4d18fe407850b77e8d1ce5de48c02d6439b5d4b6
+SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_stat.d) = dd8f7735a59bab989c3d26a28d7dca15a86b70a0
+SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_time.d) = c162669540f8cceb9e3cae943cc9047d85a8e12d
 SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_uio.d) = 313aa166c0905d5230a9d54322b79bd47d2b7181
 SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_un.d) = 267e89401dfe63c64d81292d87e9d2a01aab4d11
 SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_utsname.d) = 30092b5586b66f3b5da4623ae51829af66fd837d
-SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_wait.d) = 52985253102d703f94e44408985a833fdce03461
+SHA1 (patch-runtime_druntime_src_core_sys_posix_sys_wait.d) = f77e2fd7c73d25669021669596a83ac567e93983
 SHA1 (patch-runtime_druntime_src_core_sys_posix_syslog.d) = 04da01b67b6248fdbad4d7e3a8f05c11fabfdcab
-SHA1 (patch-runtime_druntime_src_core_sys_posix_termios.d) = 6ca3b89f97e8dbc7c719a58fac77bb66d30d7b62
-SHA1 (patch-runtime_druntime_src_core_sys_posix_time.d) = 53ce8206fcfa68bec46033ead9ce9204a6f3d96e
-SHA1 (patch-runtime_druntime_src_core_sys_posix_ucontext.d) = 01721508a88174d5bcd948849d4918ac0ab78b31
-SHA1 (patch-runtime_druntime_src_core_sys_posix_unistd.d) = 318b9a5318ebee88b001adc6aed05d600648533b
+SHA1 (patch-runtime_druntime_src_core_sys_posix_termios.d) = 75406c3e698d3cc89a5bea48a1fc0f7215ffbc37
+SHA1 (patch-runtime_druntime_src_core_sys_posix_time.d) = aa3f5090c798096f838f21acf819747485130129
+SHA1 (patch-runtime_druntime_src_core_sys_posix_ucontext.d) = 07801bd15648a0f0bd76dad4763768addbc6261e
+SHA1 (patch-runtime_druntime_src_core_sys_posix_unistd.d) = f3cb6cbd02f0cad76460faa1293247199794bbd7
 SHA1 (patch-runtime_druntime_src_core_sys_posix_utime.d) = 2099425c3687f79d945103029432499368ea209b
-SHA1 (patch-runtime_druntime_src_core_thread.d) = 7e3c354a9396d22501c64d630b035efe7c51da65
-SHA1 (patch-runtime_druntime_src_core_threadasm.S) = 61da1b6fff6d1cebb5e8c2f88e4fe04249d15cbf
+SHA1 (patch-runtime_druntime_src_core_thread.d) = 61230088ba3327b6e98573d9edca1af82035e634
 SHA1 (patch-runtime_druntime_src_core_time.d) = bf3555fcc057b0e3b76a3a9cd265137cdeec90d0
-SHA1 (patch-runtime_druntime_src_gc_os.d) = 5cbc3818655f23f6d755f2d4960d543db8765a4d
-SHA1 (patch-runtime_druntime_src_rt_bss__section.c) = b2748c8076ddb6e98be95e7ed26749d3f309d301
-SHA1 (patch-runtime_druntime_src_rt_dmain2.d) = 888b170bad46c9c7ce4a7e381644083e956db1a0
-SHA1 (patch-runtime_druntime_src_rt_sections.d) = f6ff734d28dfb2bcbde015b1e64b35ba9464d708
-SHA1 (patch-runtime_druntime_src_rt_sections__elf__shared.d) = 5034f0264ccfd35846a12b3f6e8adaa7add346ca
-SHA1 (patch-runtime_druntime_src_rt_sections__ldc.d) = 595f1fe0f21c7ce3f6299ab645ad2c46a9979350
-SHA1 (patch-runtime_druntime_test_shared_src_load.d) = 38db7d5220931446093e96e7cc6e7a395e447752
-SHA1 (patch-runtime_phobos_osmodel.mak) = 77596eb1c6a3bb8dc94321d2e84a0d498ab42304
+SHA1 (patch-runtime_druntime_src_gc_os.d) = 4ffdfe958a2a42d832828fb85817fbaea2ef94fe
+SHA1 (patch-runtime_druntime_src_rt_bss__section.c) = fdd58f4255abc77f68eb9203df5a7951235c0871
+SHA1 (patch-runtime_druntime_src_rt_sections.d) = 72a0e4a3afc7fc36bd79f20793347ffd4906569d
+SHA1 (patch-runtime_druntime_src_rt_sections__elf__shared.d) = 1bb42fa3b890c7befefdb535481afa8904558d68
+SHA1 (patch-runtime_druntime_src_rt_sections__ldc.d) = c41ae450fcb85b40040d208d1328da0f7cb1ac1d
+SHA1 (patch-runtime_druntime_test_shared_src_load.d) = 804c00808e2e32d12834412d61ca5139d449f16c
+SHA1 (patch-runtime_phobos_osmodel.mak) = 075d6bdec960fa7c1de1db57df671d951479a9cb
 SHA1 (patch-runtime_phobos_std_complex.d) = d559b11fe05bdceaf1306591f76f6a737a23ac65
-SHA1 (patch-runtime_phobos_std_conv.d) = c89cabeda3ff7cc165e6941141a994e70dfe06fd
-SHA1 (patch-runtime_phobos_std_datetime.d) = 34dca75b528e8d446b46b29410348923ecd603e6
-SHA1 (patch-runtime_phobos_std_file.d) = 1c215ff469025b9752ed952a43b0cfef3fd3543e
-SHA1 (patch-runtime_phobos_std_internal_math_gammafunction.d) = 9b438f81d9eaaad734f8ccc05ae3cedb258f1403
-SHA1 (patch-runtime_phobos_std_math.d) = d78e28331a01f044509d84b0ddc41d3f2491715a
+SHA1 (patch-runtime_phobos_std_conv.d) = ae959c9db96c693dfd3a2e1de38572b7e7c4edc7
+SHA1 (patch-runtime_phobos_std_datetime.d) = a14f6f093737969dde0f8bb98d98bf7faadd6328
+SHA1 (patch-runtime_phobos_std_file.d) = 5d302b37936210a34b057184fa7bd7dffcdafacf
+SHA1 (patch-runtime_phobos_std_math.d) = c80ad1bc880e69ce6876e0e309ed511eb704c166
 SHA1 (patch-runtime_phobos_std_numeric.d) = cae1a1ea5576f7a035c7a4823cf5b190a79b3c9e
 SHA1 (patch-runtime_phobos_std_parallelism.d) = f5a6a8613178fd8531a15941a85b38085c29145b
 SHA1 (patch-runtime_phobos_std_socket.d) = 9dd63f526c89b81e80c4bc839a2ed7563602af9d
 SHA1 (patch-runtime_phobos_std_stdio.d) = dc0602eaa116c9da6706b7d89902f5783e75aefc
-SHA1 (patch-runtime_phobos_std_system.d) = c125ed02b8215bea8887266867dda93e587499f1
+SHA1 (patch-runtime_phobos_std_system.d) = 52292a046f338630962b3c700c717b32d4cc3a0c
diff --git a/ldc/patches/patch-runtime_CMakeLists.txt b/ldc/patches/patch-runtime_CMakeLists.txt
new file mode 100644
index 0000000000..85a5849204
--- /dev/null
+++ b/ldc/patches/patch-runtime_CMakeLists.txt
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- runtime/CMakeLists.txt.orig	2018-08-23 23:29:39.000000000 +0000
++++ runtime/CMakeLists.txt
+@@ -575,7 +575,7 @@ set(DRUNTIME_PACKAGES core etc ldc)
+ 
+ install(FILES ${RUNTIME_DIR}/src/object.d DESTINATION ${INCLUDE_INSTALL_DIR}/ldc)
+ foreach(p ${DRUNTIME_PACKAGES})
+-    install(DIRECTORY ${RUNTIME_DIR}/src/${p} DESTINATION ${INCLUDE_INSTALL_DIR})
++    install(DIRECTORY ${RUNTIME_DIR}/src/${p} DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT copy-files PATTERN "*.orig" EXCLUDE)
+ endforeach()
+ if(PHOBOS2_DIR)
+     install(DIRECTORY ${PHOBOS2_DIR}/std DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.d")
diff --git a/ldc/patches/patch-runtime_druntime_osmodel.mak b/ldc/patches/patch-runtime_druntime_osmodel.mak
index ae2f6d2609..53b93b090c 100644
--- a/ldc/patches/patch-runtime_druntime_osmodel.mak
+++ b/ldc/patches/patch-runtime_druntime_osmodel.mak
@@ -1,8 +1,6 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/osmodel.mak.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/osmodel.mak.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/osmodel.mak
 @@ -15,6 +15,9 @@ ifeq (,$(OS))
    ifeq (OpenBSD,$(uname_S))
diff --git a/ldc/patches/patch-runtime_druntime_src_core_runtime.d b/ldc/patches/patch-runtime_druntime_src_core_runtime.d
index 68a85b6a70..bbeaa13401 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_runtime.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_runtime.d
@@ -1,28 +1,8 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/runtime.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/runtime.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/runtime.d
-@@ -407,6 +407,8 @@ extern (C) bool runModuleUnitTests()
-         import core.sys.osx.execinfo;
-     else version( FreeBSD )
-         import core.sys.freebsd.execinfo;
-+    else version( NetBSD )
-+        import core.sys.netbsd.execinfo;
-     else version( Windows )
-         import core.sys.windows.stacktrace;
-     else version( Solaris )
-@@ -489,6 +491,8 @@ Throwable.TraceInfo defaultTraceHandler(
-         import core.sys.osx.execinfo;
-     else version( FreeBSD )
-         import core.sys.freebsd.execinfo;
-+    else version( NetBSD )
-+        import core.sys.netbsd.execinfo;
-     else version( Windows )
-         import core.sys.windows.stacktrace;
-     else version( Solaris )
-@@ -650,6 +654,18 @@ Throwable.TraceInfo defaultTraceHandler(
+@@ -666,6 +666,18 @@ Throwable.TraceInfo defaultTraceHandler(
                          symEnd = eptr - buf.ptr;
                      }
                  }
diff --git a/ldc/patches/patch-runtime_druntime_src_core_stdc_config.d b/ldc/patches/patch-runtime_druntime_src_core_stdc_config.d
deleted file mode 100644
index b9695eeda8..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_stdc_config.d
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/stdc/config.d.orig	2016-02-13 20:02:16.000000000 +0000
-+++ runtime/druntime/src/core/stdc/config.d
-@@ -116,6 +116,8 @@ else version( DigitalMars )
-             alias real c_long_double;
-         else version( FreeBSD )
-             alias real c_long_double;
-+        else version( NetBSD )
-+            alias real c_long_double;
-         else version( Solaris )
-             alias real c_long_double;
-         else version( OSX )
diff --git a/ldc/patches/patch-runtime_druntime_src_core_stdc_errno.d b/ldc/patches/patch-runtime_druntime_src_core_stdc_errno.d
index 8d45aefc3e..f9bce6567c 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_stdc_errno.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_stdc_errno.d
@@ -1,12 +1,10 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/stdc/errno.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/stdc/errno.d.orig	2020-05-07 08:52:13.684688490 +0000
 +++ runtime/druntime/src/core/stdc/errno.d
-@@ -1000,6 +1000,138 @@ else version( FreeBSD )
-     enum EPROTO             = 92;       /// Protocol error
-     enum ELAST              = 92;       /// Must be equal largest errno
+@@ -1414,6 +1414,138 @@ else version( DragonFlyBSD )
+     enum EASYNC             = 99;
+     enum ELAST              = 99;
  }
 +else version (NetBSD)
 +{
diff --git a/ldc/patches/patch-runtime_druntime_src_core_stdc_fenv.d b/ldc/patches/patch-runtime_druntime_src_core_stdc_fenv.d
index cc7ed58545..67a163d267 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_stdc_fenv.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_stdc_fenv.d
@@ -1,57 +1,8 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/stdc/fenv.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/stdc/fenv.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/stdc/fenv.d
-@@ -190,6 +190,46 @@ else version ( FreeBSD )
- 
-     alias ushort fexcept_t;
- }
-+else version ( NetBSD )
-+{
-+    version(X86_64)
-+    {
-+        struct fenv_t
-+        {
-+            struct _x87
-+            {
-+                    uint control;       /* Control word register */
-+                    uint status;        /* Status word register */
-+                    uint tag;           /* Tag word register */
-+                    uint[4] others;     /* EIP, Pointer Selector, etc */
-+            };
-+            _x87 x87;
-+
-+            uint mxcsr;                 /* Control and status register */
-+        }
-+   }
-+   version(X86)
-+   {
-+        struct fenv_t
-+        {
-+            struct _x87
-+            {
-+                    ushort control;       /* Control word register */
-+                    ushort unused1;
-+                    ushort status;        /* Status word register */
-+                    ushort unused2;
-+                    ushort tag;           /* Tag word register */
-+                    ushort unused3;
-+                    uint[4] others;     /* EIP, Pointer Selector, etc */
-+            };
-+            _x87 x87;
-+            uint32_t mxcsr;                 /* Control and status register */
-+        };
-+
-+    }
-+
-+    alias uint fexcept_t;
-+}
- else version( CRuntime_Bionic )
- {
-     version(X86)
-@@ -304,6 +344,12 @@ else version( FreeBSD )
+@@ -338,6 +338,12 @@ else version( DragonFlyBSD )
      ///
      enum FE_DFL_ENV = &__fe_dfl_env;
  }
diff --git a/ldc/patches/patch-runtime_druntime_src_core_stdc_math.d b/ldc/patches/patch-runtime_druntime_src_core_stdc_math.d
index 05179479e7..a4f8eed327 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_stdc_math.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_stdc_math.d
@@ -1,10 +1,8 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/stdc/math.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/stdc/math.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/stdc/math.d
-@@ -45,6 +45,13 @@ version (FreeBSD)
+@@ -52,6 +52,13 @@ else version (DragonFlyBSD)
      ///
      enum int FP_ILOGBNAN      = int.max;
  }
@@ -18,105 +16,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (CRuntime_Bionic)
  {
      ///
-@@ -813,6 +820,97 @@ else version( FreeBSD )
-     int signbit(real x)         { return __signbit(x); }
-   }
- }
-+else version( NetBSD )
-+{
-+    enum
-+    {
-+        ///
-+        FP_INFINITE    = 0,
-+        ///
-+        FP_NAN         = 1,
-+        ///
-+        FP_NORMAL      = 2,
-+        ///
-+        FP_SUBNORMAL   = 3,
-+        ///
-+        FP_ZERO        = 4,
-+    }
-+
-+    enum
-+    {
-+        ///
-+        FP_FAST_FMA  = 0,
-+        ///
-+        FP_FAST_FMAF = 0,
-+        ///
-+        FP_FAST_FMAL = 0,
-+    }
-+
-+    uint __fpclassifyf(float x);
-+    uint __fpclassifyd(double x);
-+    uint __fpclassifyl(real x);
-+
-+  extern (D)
-+  {
-+    //int fpclassify(real-floating x);
-+    ///
-+    int fpclassify(float x)     { return __fpclassifyf(x); }
-+    ///
-+    int fpclassify(double x)    { return __fpclassifyd(x); }
-+    ///
-+    int fpclassify(real x)
-+    {
-+        return (real.sizeof == double.sizeof)
-+            ? __fpclassifyd(x)
-+            : __fpclassifyl(x);
-+    }
-+
-+    //int isfinite(real-floating x);
-+    ///
-+    int isfinite(float x)       { return fpclassify(x) >= FP_NORMAL; }
-+    ///
-+    int isfinite(double x)      { return fpclassify(x) >= FP_NORMAL; }
-+    ///
-+    int isfinite(real x)        { return fpclassify(x) >= FP_NORMAL; }
-+
-+    //int isinf(real-floating x);
-+    ///
-+    int isinf(float x)          { return fpclassify(x) == FP_INFINITE; }
-+    ///
-+    int isinf(double x)         { return fpclassify(x) == FP_INFINITE; }
-+    ///
-+    int isinf(real x)           { return fpclassify(x) == FP_INFINITE; }
-+
-+    //int isnan(real-floating x);
-+    ///
-+    int isnan(float x)          { return fpclassify(x) == FP_NAN;   }
-+    ///
-+    int isnan(double x)         { return fpclassify(x) == FP_NAN;   }
-+    ///
-+    int isnan(real x)           { return fpclassify(x) == FP_NAN;   }
-+
-+    //int isnormal(real-floating x);
-+    ///
-+    int isnormal(float x)       { return fpclassify(x) == FP_NORMAL; }
-+    ///
-+    int isnormal(double x)      { return fpclassify(x) == FP_NORMAL; }
-+    ///
-+    int isnormal(real x)        { return fpclassify(x) == FP_NORMAL; }
-+
-+    //int signbit(real-floating x);
-+    ///
-+    int signbit(float x)     { return (cast(short*)&(x))[1] & 0x8000; }
-+    ///
-+    int signbit(double x)    { return (cast(short*)&(x))[3] & 0x8000; }
-+    ///
-+    int signbit(real x)
-+    {
-+        return (real.sizeof == double.sizeof)
-+            ? (cast(short*)&(x))[3] & 0x8000
-+            : (cast(short*)&(x))[4] & 0x8000;
-+    }
-+  }
-+}
- else version( Solaris )
- {
-     int __isnanf(float x);
-@@ -1450,7 +1548,7 @@ else version( FreeBSD )
+@@ -1521,7 +1528,7 @@ else version( FreeBSD )
    }
    else
    {
@@ -125,456 +25,3 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
      real    acosl(real x);
      ///
      real    asinl(real x);
-@@ -1850,6 +1948,452 @@ else version( FreeBSD )
-     ///
-     float   fmaf(float x, float y, float z);
- }
-+else version( NetBSD )
-+{
-+
-+    ///
-+    real    acosl(real x) ;
-+    ///
-+    real    asinl(real x) ;
-+    ///
-+    real    atanl(real x) ;
-+    ///
-+    real    atan2l(real y, real x) ;
-+    ///
-+    real    cosl(real x) ;
-+    ///
-+    real    sinl(real x) ;
-+    ///
-+    real    tanl(real x) ;
-+    ///
-+    real    exp2l(real x) ;
-+    ///
-+    real    frexpl(real value, int* exp) ;
-+    ///
-+    int     ilogbl(real x) ;
-+    ///
-+    real    ldexpl(real x, int exp) ;
-+    ///
-+    real    logbl(real x) ;
-+    ///
-+    real    modfl(real value, real *iptr) ;
-+    ///
-+    real    scalbnl(real x, int n) ;
-+    ///
-+    real    scalblnl(real x, c_long n) ;
-+    ///
-+    real    fabsl(real x) ;
-+    ///
-+    real    hypotl(real x, real y) ;
-+    ///
-+    real    sqrtl(real x) ;
-+    ///
-+    real    ceill(real x) ;
-+    ///
-+    real    floorl(real x) ;
-+    ///
-+    real    nearbyintl(real x) ;
-+    ///
-+    real    rintl(real x) ;
-+    ///
-+    c_long  lrintl(real x) { return cast(c_long)rintl(x); }
-+    ///
-+    real    roundl(real x) ;
-+    ///
-+    c_long  lroundl(real x) { return cast(c_long)roundl(x);}
-+    ///
-+    long    llroundl(real x) { return cast(long)roundl(x);}
-+    ///
-+    real    truncl(real x) ;
-+    ///
-+    real    fmodl(real x, real y) ;
-+    ///
-+    real    remainderl(real x, real y)  { return remainder(x,y); }
-+    ///
-+    real    remquol(real x, real y, int* quo){ return remquo(x,y,quo); }
-+    ///
-+    real    copysignl(real x, real y)  ;
-+    ///
-+    double  nan(char* tagp);
-+    ///
-+    float   nanf(char* tagp);
-+    ///
-+    real    nanl(char* tagp);
-+    ///
-+    real    nextafterl(real x, real y) ;
-+    ///
-+    real    nexttowardl(real x, real y) { return nexttoward(cast(double) x, cast(double) y); }
-+    ///
-+    real    fdiml(real x, real y) ;
-+    ///
-+    real    fmaxl(real x, real y) ;
-+    ///
-+    real    fminl(real x, real y) ;
-+    ///
-+    real    fmal(real x, real y, real z) ;
-+
-+    ///
-+    double  acos(double x);
-+    ///
-+    float   acosf(float x);
-+
-+    ///
-+    double  asin(double x);
-+    ///
-+    float   asinf(float x);
-+
-+    ///
-+    double  atan(double x);
-+    ///
-+    float   atanf(float x);
-+
-+    ///
-+    double  atan2(double y, double x);
-+    ///
-+    float   atan2f(float y, float x);
-+
-+    ///
-+    double  cos(double x);
-+    ///
-+    float   cosf(float x);
-+
-+    ///
-+    double  sin(double x);
-+    ///
-+    float   sinf(float x);
-+
-+    ///
-+    double  tan(double x);
-+    ///
-+    float   tanf(float x);
-+
-+    ///
-+    double  acosh(double x);
-+    ///
-+    float   acoshf(float x);
-+    ///
-+    real    acoshl(real x) ;
-+
-+    ///
-+    double  asinh(double x);
-+    ///
-+    float   asinhf(float x);
-+    ///
-+    real    asinhl(real x) ;
-+
-+    ///
-+    double  atanh(double x);
-+    ///
-+    float   atanhf(float x);
-+    ///
-+    real    atanhl(real x) ;
-+
-+    ///
-+    double  cosh(double x);
-+    ///
-+    float   coshf(float x);
-+    ///
-+    real    coshl(real x) ;
-+
-+    ///
-+    double  sinh(double x);
-+    ///
-+    float   sinhf(float x);
-+    ///
-+    real    sinhl(real x);
-+
-+    ///
-+    double  tanh(double x);
-+    ///
-+    float   tanhf(float x);
-+    ///
-+    real    tanhl(real x) ;
-+
-+    ///
-+    double  exp(double x);
-+    ///
-+    float   expf(float x);
-+    ///
-+    real    expl(real x) ;
-+
-+    ///
-+    double  exp2(double x);
-+    ///
-+    float   exp2f(float x);
-+
-+    ///
-+    double  expm1(double x);
-+    ///
-+    float   expm1f(float x);
-+    ///
-+    real    expm1l(real x)  { return expm1(cast(double) x); }
-+
-+    ///
-+    double  frexp(double value, int* exp);
-+    ///
-+    float   frexpf(float value, int* exp);
-+
-+    ///
-+    int     ilogb(double x);
-+    ///
-+    int     ilogbf(float x);
-+
-+    ///
-+    double  ldexp(double x, int exp);
-+    ///
-+    float   ldexpf(float x, int exp);
-+
-+    ///
-+    double  log(double x);
-+    ///
-+    float   logf(float x);
-+    /// NetBSD has no logl. It is just alias log(double)
-+    real    logl(real x)
-+    {
-+        if(x<0) return real.nan;
-+        if(x==0) return -real.infinity;
-+        if(isnan(x) || isinf(x)) return x;
-+        real rs = 0;
-+        if(x>double.max)
-+        {
-+            immutable MAX = log(double.max);
-+            for(; x>double.max; x /= double.max)
-+                rs += MAX;
-+        }
-+        else if(x<double.min_normal)
-+        {
-+            immutable MIN = log(double.min_normal);
-+            for(; x<double.min_normal; x /= double.min_normal)
-+                rs += MIN;
-+        }
-+        rs += log(x);
-+        return rs;
-+    }
-+
-+    ///
-+    double  log10(double x);
-+    ///
-+    float   log10f(float x);
-+    ///NetBSD has no log10l. It is just alias log(double)
-+    real    log10l(real x)
-+    {
-+        if(x<0) return real.nan;
-+        if(x==0) return -real.infinity;
-+        if(isnan(x) || isinf(x)) return x;
-+
-+        real rs = 0;
-+        if(x>double.max)
-+        {
-+            immutable MAX = log10(double.max);
-+            for(; x>double.max; x /= double.max)
-+                rs += MAX;
-+        }
-+        else if(x<double.min_normal)
-+        {
-+            immutable MIN = log10(double.min_normal);
-+            for(; x<double.min_normal; x /= double.min_normal)
-+                rs += MIN;
-+        }
-+        rs += log10(x);
-+
-+        return rs;
-+    }
-+
-+
-+    ///
-+    double  log1p(double x);
-+    ///
-+    float   log1pf(float x);
-+    ///
-+    real    log1pl(real x) { return log1p(cast(double) x); }
-+
-+    private enum real ONE_LN2 = 1 / 0x1.62e42fefa39ef358p-1L;
-+    ///
-+    double  log2(double x) { return log(x) * ONE_LN2; }
-+    ///
-+    float   log2f(float x) { return logf(x) * ONE_LN2; }
-+    ///
-+    real    log2l(real x)  { return logl(x) * ONE_LN2; }
-+
-+    ///
-+    double  logb(double x);
-+    ///
-+    float   logbf(float x);
-+
-+    ///
-+    double  modf(double value, double* iptr);
-+    ///
-+    float   modff(float value, float* iptr);
-+
-+    ///
-+    double  scalbn(double x, int n);
-+    ///
-+    float   scalbnf(float x, int n);
-+
-+    ///
-+    double  scalbln(double x, c_long n);
-+    ///
-+    float   scalblnf(float x, c_long n);
-+
-+    ///
-+    double  cbrt(double x);
-+    ///
-+    float   cbrtf(float x);
-+    ///
-+    real    cbrtl(real x);
-+
-+    ///
-+    double  fabs(double x);
-+    ///
-+    float   fabsf(float x);
-+
-+    ///
-+    double  hypot(double x, double y);
-+    ///
-+    float   hypotf(float x, float y);
-+
-+    ///
-+    double  pow(double x, double y);
-+    ///
-+    float   powf(float x, float y);
-+    ///
-+    real    powl(real x, real y);
-+
-+    ///
-+    double  sqrt(double x);
-+    ///
-+    float   sqrtf(float x);
-+
-+    ///
-+    double  erf(double x);
-+    ///
-+    float   erff(float x);
-+    ///
-+    real    erfl(real x) { return erf(cast(double) x); }
-+
-+    ///
-+    double  erfc(double x);
-+    ///
-+    float   erfcf(float x);
-+    ///
-+    real    erfcl(real x)  { return erfc(cast(double) x); }
-+
-+    ///
-+    double  lgamma(double x);
-+    ///
-+    float   lgammaf(float x);
-+    ///
-+    real    lgammal(real x){ return lgamma(x); }
-+
-+    ///
-+    double  tgamma(double x);
-+    ///
-+    float   tgammaf(float x);
-+    ///
-+    real    tgammal(real x){ return tgamma(cast(double) x); }
-+
-+    ///
-+    double  ceil(double x);
-+    ///
-+    float   ceilf(float x);
-+
-+    ///
-+    double  floor(double x);
-+    ///
-+    float   floorf(float x);
-+
-+    ///
-+    double  nearbyint(double x);
-+    ///
-+    float   nearbyintf(float x);
-+
-+    ///
-+    double  rint(double x);
-+    ///
-+    float   rintf(float x);
-+
-+    ///
-+    c_long  lrint(double x);
-+    ///
-+    c_long  lrintf(float x);
-+
-+    ///
-+    long    llrint(double x);
-+    ///
-+    long    llrintf(float x);
-+    ///
-+    long    llrintl(real x) { return cast(long)rintl(x); }
-+
-+    ///
-+    double  round(double x);
-+    ///
-+    float   roundf(float x);
-+
-+    ///
-+    c_long  lround(double x);
-+    ///
-+    c_long  lroundf(float x);
-+
-+    ///
-+    long    llround(double x);
-+    ///
-+    long    llroundf(float x);
-+
-+    ///
-+    double  trunc(double x);
-+    ///
-+    float   truncf(float x);
-+
-+    ///
-+    double  fmod(double x, double y);
-+    ///
-+    float   fmodf(float x, float y);
-+
-+    ///
-+    double  remainder(double x, double y);
-+    ///
-+    float   remainderf(float x, float y);
-+
-+    ///
-+    double  remquo(double x, double y, int* quo);
-+    ///
-+    float   remquof(float x, float y, int* quo);
-+
-+    ///
-+    double  copysign(double x, double y);
-+    ///
-+    float   copysignf(float x, float y);
-+
-+    ///
-+    double  nextafter(double x, double y);
-+    ///
-+    float   nextafterf(float x, float y);
-+
-+    ///
-+    double  nexttoward(double x, real y);
-+    ///
-+    float   nexttowardf(float x, real y);
-+
-+    ///
-+    double  fdim(double x, double y);
-+    ///
-+    float   fdimf(float x, float y);
-+
-+    ///
-+    double  fmax(double x, double y);
-+    ///
-+    float   fmaxf(float x, float y);
-+
-+    ///
-+    double  fmin(double x, double y);
-+    ///
-+    float   fminf(float x, float y);
-+
-+    ///
-+    double  fma(double x, double y, double z);
-+    ///
-+    float   fmaf(float x, float y, float z);
-+}
- else version(CRuntime_Bionic)
- {
-     // Bionic defines long double as 64 bits, same as double, so several long
diff --git a/ldc/patches/patch-runtime_druntime_src_core_stdc_stdio.d b/ldc/patches/patch-runtime_druntime_src_core_stdc_stdio.d
index 0a951fd474..a38cbaec64 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_stdc_stdio.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_stdc_stdio.d
@@ -1,10 +1,8 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/stdc/stdio.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/stdc/stdio.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/stdc/stdio.d
-@@ -25,6 +25,10 @@ private
+@@ -29,6 +29,10 @@ private
    {
      import core.sys.posix.sys.types;
    }
@@ -15,7 +13,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  }
  
  extern (C):
-@@ -166,6 +170,37 @@ else version ( FreeBSD )
+@@ -209,6 +213,37 @@ else version ( DragonFlyBSD )
          long        _mbstateL;
      }
  }
@@ -53,113 +51,3 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      enum
-@@ -392,6 +427,50 @@ else version( FreeBSD )
-     ///
-     alias shared(__sFILE) FILE;
- }
-+else version( NetBSD )
-+{
-+    ///
-+    alias off_t fpos_t;
-+
-+    ///
-+    struct __sFILE
-+    {
-+        ubyte*          _p;
-+        int             _r;
-+        int             _w;
-+        ushort           _flags;
-+        short           _file;
-+        __sbuf          _bf;
-+        int             _lbfsize;
-+
-+        void*           _cookie;
-+        int     function(void*)                 _close;
-+        ssize_t     function(void*, char*, size_t)     _read;
-+        fpos_t  function(void*, fpos_t, int)    _seek;
-+        ssize_t     function(void*, in char*, size_t)  _write;
-+
-+        __sbuf          _ub;
-+        ubyte*          _up;
-+        int             _ur;
-+
-+        ubyte[3]        _ubuf;
-+        ubyte[1]        _nbuf;
-+
-+        int     function(void *)    _flush;
-+        /* Formerly used by fgetln/fgetwln; kept for binary compatibility */
-+        char[__sbuf.sizeof - _flush.sizeof]    _lb_unused;
-+
-+
-+        int             _blksize;
-+        off_t          _offset;
-+        static assert(off_t.sizeof==8);
-+    }
-+
-+    ///
-+    alias __sFILE _iobuf;
-+    ///
-+    alias shared(__sFILE) FILE;
-+}
- else version (Solaris)
- {
-     ///
-@@ -637,6 +716,29 @@ else version( FreeBSD )
-     ///
-     alias __stderrp stderr;
- }
-+else version( NetBSD )
-+{
-+    enum
-+    {
-+        ///
-+        _IOFBF = 0,
-+        ///
-+        _IOLBF = 1,
-+        ///
-+        _IONBF = 2,
-+    }
-+
-+    private extern __gshared FILE[3] __sF;
-+    @property auto __stdin() { return &__sF[0]; }
-+    @property auto __stdout() { return &__sF[1]; }
-+    @property auto __stderr() { return &__sF[2]; }
-+    ///
-+    alias __stdin stdin;
-+    ///
-+    alias __stdout stdout;
-+    ///
-+    alias __stderr stderr;
-+}
- else version (Solaris)
- {
-     enum
-@@ -1039,6 +1141,28 @@ else version( FreeBSD )
-     ///
-     int  vsnprintf(char* s, size_t n, in char* format, va_list arg);
- }
-+else version( NetBSD )
-+{
-+  // No unsafe pointer manipulation.
-+  @trusted
-+  {
-+      ///
-+    void rewind(FILE*);
-+    ///
-+    pure void clearerr(FILE*);
-+    ///
-+    pure int  feof(FILE*);
-+    ///
-+    pure int  ferror(FILE*);
-+    ///
-+    int  fileno(FILE*);
-+  }
-+
-+  ///
-+    int  snprintf(char* s, size_t n, in char* format, ...);
-+    ///
-+    int  vsnprintf(char* s, size_t n, in char* format, va_list arg);
-+}
- else version (Solaris)
- {
-   // No unsafe pointer manipulation.
diff --git a/ldc/patches/patch-runtime_druntime_src_core_stdc_stdlib.d b/ldc/patches/patch-runtime_druntime_src_core_stdc_stdlib.d
index 9cc17ea4b2..0e3d92a2a5 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_stdc_stdlib.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_stdc_stdlib.d
@@ -2,12 +2,12 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/stdc/stdlib.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/stdc/stdlib.d.orig	2020-05-07 08:52:13.934687779 +0000
 +++ runtime/druntime/src/core/stdc/stdlib.d
-@@ -66,6 +66,7 @@ version(Windows)      enum RAND_MAX = 0x
- else version(CRuntime_Glibc)  enum RAND_MAX = 0x7fffffff;
+@@ -67,6 +67,7 @@ else version(CRuntime_Glibc)  enum RAND_
  else version(OSX)     enum RAND_MAX = 0x7fffffff;
  else version(FreeBSD) enum RAND_MAX = 0x7fffffff;
+ else version(DragonFlyBSD) enum RAND_MAX = 0x7fffffff;
 +else version(NetBSD)  enum RAND_MAX = 0x7fffffff;
  else version(Solaris) enum RAND_MAX = 0x7fff;
  else version(CRuntime_Bionic) enum RAND_MAX = 0x7fffffff;
diff --git a/ldc/patches/patch-runtime_druntime_src_core_stdc_time.d b/ldc/patches/patch-runtime_druntime_src_core_stdc_time.d
index 86c3c47401..a8b30accf6 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_stdc_time.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_stdc_time.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/stdc/time.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/stdc/time.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/stdc/time.d
-@@ -82,6 +82,10 @@ else version( FreeBSD )
+@@ -86,6 +86,10 @@ else version( DragonFlyBSD )
  {
      enum clock_t CLOCKS_PER_SEC = 128;
  }
@@ -15,17 +15,17 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (CRuntime_Glibc)
  {
      enum clock_t CLOCKS_PER_SEC = 1_000_000;
-@@ -145,6 +149,13 @@ else version( FreeBSD )
+@@ -153,6 +157,13 @@ else version( DragonFlyBSD )
+ {
      ///
-     extern __gshared const(char)*[2] tzname; // non-standard
- }
+     void tzset();                            // non-standard
++    ///
++    extern __gshared const(char)*[2] tzname; // non-standard
++}
 +else version( NetBSD )
 +{
 +    ///
 +    void tzset();                            // non-standard
-+    ///
-+    extern __gshared const(char)*[2] tzname; // non-standard
-+}
- else version (Solaris)
- {
      ///
+     extern __gshared const(char)*[2] tzname; // non-standard
+ }
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_dlfcn.d b/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_dlfcn.d
deleted file mode 100644
index a8f39978df..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_dlfcn.d
+++ /dev/null
@@ -1,120 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/netbsd/dlfcn.d.orig	2016-03-02 01:38:47.233139170 +0000
-+++ runtime/druntime/src/core/sys/netbsd/dlfcn.d
-@@ -0,0 +1,113 @@
-+/**
-+ * D header file for NetBSD.
-+ *
-+ * Copyright: Copyright Martin Nowak 2012.
-+ * License:   $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
-+ * Authors:   Martin Nowak
-+ */
-+module core.sys.netbsd.dlfcn;
-+
-+public import core.sys.posix.dlfcn;
-+
-+version (NetBSD):
-+extern (C):
-+nothrow:
-+
-+enum __BSD_VISIBLE = true;
-+
-+/*
-+ * Modes and flags for dlopen().
-+ */
-+static assert(RTLD_LAZY   == 1);
-+static assert(RTLD_NOW    == 2);
-+enum RTLD_MODEMASK        =  0x3;
-+static assert(RTLD_GLOBAL == 0x100);
-+static assert(RTLD_LOCAL  == 0x200);
-+//enum RTLD_TRACE           =  0x200;
-+enum RTLD_NODELETE        =  0x01000;
-+enum RTLD_NOLOAD          =  0x02000;
-+
-+/*
-+ * Request arguments for dlinfo().
-+ */
-+enum RTLD_DI_LINKMAP     = 2;    /* Obtain link map. */
-+enum RTLD_DI_SERINFO     = 4;    /* Obtain search path info. */
-+enum RTLD_DI_SERINFOSIZE = 5;    /*  ... query for required space. */
-+enum RTLD_DI_ORIGIN      = 6;    /* Obtain object origin */
-+enum RTLD_DI_MAX         = RTLD_DI_ORIGIN;
-+
-+/*
-+ * Special handle arguments for dlsym()/dlinfo().
-+ */
-+enum RTLD_NEXT    = cast(void *)-1;    /* Search subsequent objects. */
-+enum RTLD_DEFAULT = cast(void *)-2;    /* Use default search algorithm. */
-+enum RTLD_SELF    = cast(void *)-3;    /* Search the caller itself. */
-+
-+static if (__BSD_VISIBLE)
-+{
-+    /*
-+     * Structure filled in by dladdr().
-+     */
-+    struct Dl_info {
-+        const(char)     *dli_fname;     /* Pathname of shared object. */
-+        void            *dli_fbase;     /* Base address of shared object. */
-+        const(char)     *dli_sname;     /* Name of nearest symbol. */
-+        void            *dli_saddr;     /* Address of nearest symbol. */
-+    };
-+
-+    /*-
-+     * The actual type declared by this typedef is immaterial, provided that
-+     * it is a function pointer.  Its purpose is to provide a return type for
-+     * dlfunc() which can be cast to a function pointer type without depending
-+     * on behavior undefined by the C standard, which might trigger a compiler
-+     * diagnostic.  We intentionally declare a unique type signature to force
-+     * a diagnostic should the application not cast the return value of dlfunc()
-+     * appropriately.
-+     */
-+    struct __dlfunc_arg {
-+        int     __dlfunc_dummy;
-+    };
-+
-+    alias void function(__dlfunc_arg) dlfunc_t;
-+
-+    /*
-+     * Structures, returned by the RTLD_DI_SERINFO dlinfo() request.
-+     */
-+    struct Dl_serpath {
-+        char *          dls_name;       /* single search path entry */
-+        uint            dls_flags;      /* path information */
-+    };
-+
-+    struct Dl_serinfo {
-+        size_t          dls_size;       /* total buffer size */
-+        uint            dls_cnt;        /* number of path entries */
-+        Dl_serpath[1]   dls_serpath;    /* there may be more than one */
-+    };
-+}
-+
-+private template __externC(RT, P...)
-+{
-+    alias extern(C) RT function(P) nothrow @nogc __externC;
-+}
-+
-+/* XSI functions first. */
-+static assert(is(typeof(&dlclose) == __externC!(int, void*)));
-+static assert(is(typeof(&dlerror) == __externC!(char*)));
-+static assert(is(typeof(&dlopen)  == __externC!(void*, const char*, int)));
-+static assert(is(typeof(&dlsym)   == __externC!(void*, void*, const char*)));
-+
-+static if (__BSD_VISIBLE)
-+{
-+    void*    fdlopen(int, int);
-+    int      dladdr(const(void)*, Dl_info*);
-+    dlfunc_t dlfunc(void*, const(char)*);
-+    int      dlinfo(void*, int, void*);
-+    void     dllockinit(void* _context,
-+        void* function(void* _context) _lock_create,
-+        void  function(void* _lock)    _rlock_acquire,
-+        void  function(void* _lock)    _wlock_acquire,
-+        void  function(void* _lock)    _lock_release,
-+        void  function(void* _lock)    _lock_destroy,
-+        void  function(void* _context) _context_destroy);
-+    void*    dlvsym(void*, const(char)*, const(char)*);
-+}
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_execinfo.d b/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_execinfo.d
deleted file mode 100644
index 725c9035c1..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_execinfo.d
+++ /dev/null
@@ -1,140 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/netbsd/execinfo.d.orig	2016-03-02 01:38:47.234934858 +0000
-+++ runtime/druntime/src/core/sys/netbsd/execinfo.d
-@@ -0,0 +1,133 @@
-+/**
-+ * NetBSD implementation of glibc's $(LINK2 http://www.gnu.org/software/libc/manual/html_node/Backtraces.html backtrace) facility.
-+ *
-+ * Copyright: Copyright Martin Nowak 2012.
-+ * License:   $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0)
-+ * Authors:   Martin Nowak
-+ * Source:    $(DRUNTIMESRC core/sys/netbsd/_execinfo.d)
-+ */
-+module core.sys.netbsd.execinfo;
-+
-+version (NetBSD):
-+extern (C):
-+nothrow:
-+
-+import core.sys.netbsd.dlfcn;
-+
-+// Use extern (D) so that these functions don't collide with libexecinfo.
-+
-+extern (D) int backtrace(void** buffer, int size)
-+{
-+    import core.thread : thread_stackBottom;
-+
-+    void** p, pend=cast(void**)thread_stackBottom();
-+    version (D_InlineAsm_X86)
-+        asm nothrow @trusted { mov p[EBP], EBP; }
-+    else version (D_InlineAsm_X86_64)
-+        asm nothrow @trusted { mov p[RBP], RBP; }
-+    else
-+        static assert(false, "Architecture not supported.");
-+
-+    int i;
-+    for (; i < size && p < pend; ++i)
-+    {
-+        buffer[i] = *(p + 1);
-+        auto pnext = cast(void**)*p;
-+        if (pnext <= p) break;
-+        p = pnext;
-+    }
-+    return i;
-+}
-+
-+
-+extern (D) char** backtrace_symbols(const(void*)* buffer, int size)
-+{
-+    static void* realloc(void* p, size_t len) nothrow
-+    {
-+        static import cstdlib=core.stdc.stdlib;
-+        auto res = cstdlib.realloc(p, len);
-+        if (res is null) cstdlib.free(p);
-+        return res;
-+    }
-+
-+    if (size <= 0) return null;
-+
-+    size_t pos = size * (char*).sizeof;
-+    char** p = cast(char**)realloc(null, pos);
-+    if (p is null) return null;
-+
-+    Dl_info info;
-+    foreach (i, addr; buffer[0 .. size])
-+    {
-+        if (dladdr(addr, &info) == 0)
-+            (cast(ubyte*)&info)[0 .. info.sizeof] = 0;
-+        fixupDLInfo(addr, info);
-+
-+        immutable len = formatStackFrame(null, 0, addr, info);
-+        assert(len > 0);
-+
-+        p = cast(char**)realloc(p, pos + len);
-+        if (p is null) return null;
-+
-+        formatStackFrame(cast(char*)p + pos, len, addr, info) == len || assert(0);
-+
-+        p[i] = cast(char*)pos;
-+        pos += len;
-+    }
-+    foreach (i; 0 .. size)
-+    {
-+        pos = cast(size_t)p[i];
-+        p[i] = cast(char*)p + pos;
-+    }
-+    return p;
-+}
-+
-+
-+extern (D) void backtrace_symbols_fd(const(void*)* buffer, int size, int fd)
-+{
-+    import core.sys.posix.unistd : write;
-+    import core.stdc.stdlib : alloca;
-+
-+    if (size <= 0) return;
-+
-+    Dl_info info;
-+    foreach (i, addr; buffer[0 .. size])
-+    {
-+        if (dladdr(addr, &info) == 0)
-+            (cast(ubyte*)&info)[0 .. info.sizeof] = 0;
-+        fixupDLInfo(addr, info);
-+
-+        enum maxAlloca = 1024;
-+        enum min = (size_t a, size_t b) => a <= b ? a : b;
-+        immutable len = min(formatStackFrame(null, 0, addr, info), maxAlloca);
-+        assert(len > 0);
-+
-+        auto p = cast(char*)alloca(len);
-+        if (p is null) return;
-+
-+        formatStackFrame(p, len, addr, info) >= len || assert(0);
-+        p[len - 1] = '\n';
-+        write(fd, p, len);
-+    }
-+}
-+
-+
-+private void fixupDLInfo(const(void)* addr, ref Dl_info info)
-+{
-+    if (info.dli_fname is null) info.dli_fname = "???";
-+    if (info.dli_fbase is null) info.dli_fbase = null;
-+    if (info.dli_sname is null) info.dli_sname = "???";
-+    if (info.dli_saddr is null) info.dli_saddr = cast(void*)addr;
-+}
-+
-+
-+private size_t formatStackFrame(char* p, size_t plen, const(void)* addr, const ref Dl_info info)
-+{
-+    import core.stdc.stdio : snprintf;
-+
-+    immutable off = addr - info.dli_saddr;
-+    immutable len = snprintf(p, plen, "%p <%s+%zd> at %s",
-+                             addr, info.dli_sname, off, info.dli_fname);
-+    assert(len > 0);
-+    return cast(size_t)len + 1; // + '\0'
-+}
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_cdefs.d b/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_cdefs.d
deleted file mode 100644
index 75dd2eb3ee..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_cdefs.d
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/netbsd/sys/cdefs.d.orig	2016-03-02 01:38:47.237364846 +0000
-+++ runtime/druntime/src/core/sys/netbsd/sys/cdefs.d
-@@ -0,0 +1,16 @@
-+/**
-+ * D header file for FreeBSD
-+ *
-+ * Authors: Martin Nowak
-+ */
-+module core.sys.netbsd.sys.cdefs;
-+
-+version (NetBSD):
-+
-+public import core.sys.posix.config;
-+
-+
-+enum __POSIX_VISIBLE = 200112;
-+enum __XSI_VISIBLE = 700;
-+enum __BSD_VISIBLE = true;
-+enum __ISO_C_VISIBLE = 1999;
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf.d b/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf.d
deleted file mode 100644
index b1dc9d7991..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf.d
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/netbsd/sys/elf.d.orig	2016-03-02 01:38:47.238980833 +0000
-+++ runtime/druntime/src/core/sys/netbsd/sys/elf.d
-@@ -0,0 +1,11 @@
-+/**
-+ * D header file for NetBSD.
-+ *
-+ * $(LINK2 http://svnweb.freebsd.org/base/head/sys/sys/elf.h?view=markup, sys/elf.h)
-+ */
-+module core.sys.netbsd.sys.elf;
-+
-+version (NetBSD):
-+
-+public import core.sys.netbsd.sys.elf32;
-+public import core.sys.netbsd.sys.elf64;
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf32.d b/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf32.d
deleted file mode 100644
index 522830f70a..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf32.d
+++ /dev/null
@@ -1,194 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/netbsd/sys/elf32.d.orig	2016-03-02 01:38:47.240511265 +0000
-+++ runtime/druntime/src/core/sys/netbsd/sys/elf32.d
-@@ -0,0 +1,187 @@
-+/**
-+ * D header file for NetBSD.
-+ *
-+ * $(LINK2 http://svnweb.freebsd.org/base/head/sys/sys/elf32.h?view=markup, sys/elf32.h)
-+ */
-+module core.sys.netbsd.sys.elf32;
-+
-+version (NetBSD):
-+extern (C):
-+pure:
-+nothrow:
-+
-+import core.stdc.stdint;
-+public import core.sys.netbsd.sys.elf_common;
-+
-+alias uint16_t Elf32_Half;
-+alias uint32_t Elf32_Word;
-+alias int32_t  Elf32_Sword;
-+alias uint64_t Elf32_Lword;
-+alias uint32_t Elf32_Addr;
-+alias uint32_t Elf32_Off;
-+alias Elf32_Word Elf32_Hashelt;
-+alias Elf32_Word Elf32_Size;
-+alias Elf32_Sword Elf32_Ssize;
-+
-+struct Elf32_Ehdr
-+{
-+    char[EI_NIDENT] e_ident;
-+    Elf32_Half    e_type;
-+    Elf32_Half    e_machine;
-+    Elf32_Word    e_version;
-+    Elf32_Addr    e_entry;
-+    Elf32_Off     e_phoff;
-+    Elf32_Off     e_shoff;
-+    Elf32_Word    e_flags;
-+    Elf32_Half    e_ehsize;
-+    Elf32_Half    e_phentsize;
-+    Elf32_Half    e_phnum;
-+    Elf32_Half    e_shentsize;
-+    Elf32_Half    e_shnum;
-+    Elf32_Half    e_shstrndx;
-+}
-+
-+struct Elf32_Shdr
-+{
-+    Elf32_Word    sh_name;
-+    Elf32_Word    sh_type;
-+    Elf32_Word    sh_flags;
-+    Elf32_Addr    sh_addr;
-+    Elf32_Off     sh_offset;
-+    Elf32_Word    sh_size;
-+    Elf32_Word    sh_link;
-+    Elf32_Word    sh_info;
-+    Elf32_Word    sh_addralign;
-+    Elf32_Word    sh_entsize;
-+}
-+
-+struct Elf32_Phdr
-+{
-+    Elf32_Word    p_type;
-+    Elf32_Off     p_offset;
-+    Elf32_Addr    p_vaddr;
-+    Elf32_Addr    p_paddr;
-+    Elf32_Word    p_filesz;
-+    Elf32_Word    p_memsz;
-+    Elf32_Word    p_flags;
-+    Elf32_Word    p_align;
-+}
-+
-+struct Elf32_Dyn
-+{
-+  Elf32_Sword   d_tag;
-+  union _d_un
-+  {
-+      Elf32_Word d_val;
-+      Elf32_Addr d_ptr;
-+  } _d_un d_un;
-+}
-+
-+struct Elf32_Rel
-+{
-+    Elf32_Addr    r_offset;
-+    Elf32_Word    r_info;
-+}
-+
-+struct Elf32_Rela
-+{
-+    Elf32_Addr    r_offset;
-+    Elf32_Word    r_info;
-+    Elf32_Sword   r_addend;
-+}
-+
-+extern (D)
-+{
-+    auto ELF32_R_SYM(V)(V val) { return val >> 8; }
-+    auto ELF32_R_TYPE(V)(V val) { return val & 0xff; }
-+    auto ELF32_R_INFO(S, T)(S sym, T type) { return (sym << 8) + (type & 0xff); }
-+}
-+
-+alias Elf_Note Elf32_Nhdr;
-+
-+struct Elf32_Move
-+{
-+    Elf32_Lword   m_value;
-+    Elf32_Word    m_info;
-+    Elf32_Word    m_poffset;
-+    Elf32_Half    m_repeat;
-+    Elf32_Half    m_stride;
-+}
-+
-+extern (D)
-+{
-+    auto ELF32_M_SYM(I)(I info) { return info >> 8; }
-+    auto ELF32_M_SIZE(I)(I info) { return cast(ubyte)info; }
-+    auto ELF32_M_INFO(S, SZ)(S sym, SZ size) { return (sym << 8) + cast(ubye)size; }
-+}
-+
-+struct Elf32_Cap
-+{
-+    Elf32_Word    c_tag;
-+    union _c_un
-+    {
-+        Elf32_Word      c_val;
-+        Elf32_Addr      c_ptr;
-+    } _c_un c_un;
-+}
-+
-+struct Elf32_Sym
-+{
-+    Elf32_Word    st_name;
-+    Elf32_Addr    st_value;
-+    Elf32_Word    st_size;
-+    ubyte st_info;
-+    ubyte st_other;
-+    Elf32_Half st_shndx;
-+}
-+
-+extern (D)
-+{
-+    auto ELF32_ST_BIND(T)(T val) { return cast(ubyte)val >> 4; }
-+    auto ELF32_ST_TYPE(T)(T val) { return val & 0xf; }
-+    auto ELF32_ST_INFO(B, T)(B bind, T type) { return (bind << 4) + (type & 0xf); }
-+    auto ELF32_ST_VISIBILITY(O)(O o) { return o & 0x03; }
-+}
-+
-+struct Elf32_Verdef
-+{
-+    Elf32_Half    vd_version;
-+    Elf32_Half    vd_flags;
-+    Elf32_Half    vd_ndx;
-+    Elf32_Half    vd_cnt;
-+    Elf32_Word    vd_hash;
-+    Elf32_Word    vd_aux;
-+    Elf32_Word    vd_next;
-+}
-+
-+struct Elf32_Verdaux
-+{
-+    Elf32_Word    vda_name;
-+    Elf32_Word    vda_next;
-+}
-+
-+struct Elf32_Verneed
-+{
-+    Elf32_Half    vn_version;
-+    Elf32_Half    vn_cnt;
-+    Elf32_Word    vn_file;
-+    Elf32_Word    vn_aux;
-+    Elf32_Word    vn_next;
-+}
-+
-+struct Elf32_Vernaux
-+{
-+    Elf32_Word    vna_hash;
-+    Elf32_Half    vna_flags;
-+    Elf32_Half    vna_other;
-+    Elf32_Word    vna_name;
-+    Elf32_Word    vna_next;
-+}
-+
-+alias Elf32_Half Elf32_Versym;
-+
-+struct Elf32_Syminfo
-+{
-+    Elf32_Half si_boundto;
-+    Elf32_Half si_flags;
-+}
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf64.d b/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf64.d
deleted file mode 100644
index f06153ee0e..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf64.d
+++ /dev/null
@@ -1,200 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/netbsd/sys/elf64.d.orig	2016-03-02 01:38:47.242446986 +0000
-+++ runtime/druntime/src/core/sys/netbsd/sys/elf64.d
-@@ -0,0 +1,193 @@
-+/**
-+ * D header file for NetBSD.
-+ *
-+ * $(LINK2 http://svnweb.freebsd.org/base/head/sys/sys/elf64.h?view=markup, sys/elf64.h)
-+ */
-+module core.sys.netbsd.sys.elf64;
-+
-+version (NetBSD):
-+extern (C):
-+pure:
-+nothrow:
-+
-+import core.stdc.stdint;
-+public import core.sys.netbsd.sys.elf_common;
-+
-+alias uint16_t Elf64_Half;
-+alias uint32_t Elf64_Word;
-+alias int32_t  Elf64_Sword;
-+alias uint64_t Elf64_Lword;
-+alias uint64_t Elf64_Xword;
-+alias int64_t  Elf64_Sxword;
-+alias uint64_t Elf64_Addr;
-+alias uint64_t Elf64_Off;
-+alias Elf64_Word Elf64_Hashelt;
-+alias Elf64_Xword Elf64_Size;
-+alias Elf64_Sxword Elf64_Ssize;
-+
-+struct Elf64_Ehdr
-+{
-+    char[EI_NIDENT] e_ident;
-+    Elf64_Half    e_type;
-+    Elf64_Half    e_machine;
-+    Elf64_Word    e_version;
-+    Elf64_Addr    e_entry;
-+    Elf64_Off     e_phoff;
-+    Elf64_Off     e_shoff;
-+    Elf64_Word    e_flags;
-+    Elf64_Half    e_ehsize;
-+    Elf64_Half    e_phentsize;
-+    Elf64_Half    e_phnum;
-+    Elf64_Half    e_shentsize;
-+    Elf64_Half    e_shnum;
-+    Elf64_Half    e_shstrndx;
-+}
-+
-+struct Elf64_Shdr
-+{
-+    Elf64_Word    sh_name;
-+    Elf64_Word    sh_type;
-+    Elf64_Xword   sh_flags;
-+    Elf64_Addr    sh_addr;
-+    Elf64_Off     sh_offset;
-+    Elf64_Xword   sh_size;
-+    Elf64_Word    sh_link;
-+    Elf64_Word    sh_info;
-+    Elf64_Xword   sh_addralign;
-+    Elf64_Xword   sh_entsize;
-+}
-+
-+struct Elf64_Phdr
-+{
-+    Elf64_Word    p_type;
-+    Elf64_Word    p_flags;
-+    Elf64_Off     p_offset;
-+    Elf64_Addr    p_vaddr;
-+    Elf64_Addr    p_paddr;
-+    Elf64_Xword   p_filesz;
-+    Elf64_Xword   p_memsz;
-+    Elf64_Xword   p_align;
-+}
-+
-+struct Elf64_Dyn
-+{
-+  Elf64_Sxword  d_tag;
-+  union _d_un
-+  {
-+      Elf64_Xword d_val;
-+      Elf64_Addr d_ptr;
-+  } _d_un d_un;
-+}
-+
-+struct Elf64_Rel
-+{
-+    Elf64_Addr    r_offset;
-+    Elf64_Xword   r_info;
-+}
-+
-+struct Elf64_Rela
-+{
-+    Elf64_Addr    r_offset;
-+    Elf64_Xword   r_info;
-+    Elf64_Sxword  r_addend;
-+}
-+
-+extern (D)
-+{
-+    auto ELF64_R_SYM(I)(I i) { return i >> 32; }
-+    auto ELF64_R_TYPE(I)(I i) { return i & 0xffffffff; }
-+    auto ELF64_R_INFO(S, T)(S sym, T type) { return (sym << 32) + (type & 0xffffffff); }
-+
-+    auto ELF64_R_TYPE_DATA(I)(I i) { return (cast(Elf64_Xword) i << 32) >> 40; }
-+    auto ELF64_R_TYPE_ID(I)(I i) { return (cast(Elf64_Xword) i << 56 ) >> 56; }
-+    auto ELF64_R_TYPE_INFO(D, T)(D d, T t) { return cast(Elf64_Xword) d << 8 + cast(Elf64_Xword) t; }
-+}
-+
-+alias Elf_Note Elf64_Nhdr;
-+
-+struct Elf64_Move
-+{
-+    Elf64_Lword   m_value;
-+    Elf64_Xword   m_info;
-+    Elf64_Xword   m_poffset;
-+    Elf64_Half    m_repeat;
-+    Elf64_Half    m_stride;
-+}
-+
-+extern (D)
-+{
-+    auto ELF64_M_SYM(I)(I info) { return info >> 8; }
-+    auto ELF64_M_SIZE(I)(I info) { return cast(ubyte)info; }
-+    auto ELF64_M_INFO(S, SZ)(S sym, SZ size) { return (sym << 8) + cast(ubye)size; }
-+}
-+
-+struct Elf64_Cap
-+{
-+    Elf64_Xword   c_tag;
-+    union _c_un
-+    {
-+        Elf64_Xword     c_val;
-+        Elf64_Addr      c_ptr;
-+    } _c_un c_un;
-+}
-+
-+struct Elf64_Sym
-+{
-+    Elf64_Word    st_name;
-+    ubyte st_info;
-+    ubyte st_other;
-+    Elf64_Half st_shndx;
-+    Elf64_Addr    st_value;
-+    Elf64_Xword   st_size;
-+}
-+
-+extern (D)
-+{
-+    auto ELF64_ST_BIND(T)(T val) { return cast(ubyte)val >> 4; }
-+    auto ELF64_ST_TYPE(T)(T val) { return val & 0xf; }
-+    auto ELF64_ST_INFO(B, T)(B bind, T type) { return (bind << 4) + (type & 0xf); }
-+    auto ELF64_ST_VISIBILITY(O)(O o) { return o & 0x03; }
-+}
-+
-+struct Elf64_Verdef
-+{
-+    Elf64_Half    vd_version;
-+    Elf64_Half    vd_flags;
-+    Elf64_Half    vd_ndx;
-+    Elf64_Half    vd_cnt;
-+    Elf64_Word    vd_hash;
-+    Elf64_Word    vd_aux;
-+    Elf64_Word    vd_next;
-+}
-+
-+struct Elf64_Verdaux
-+{
-+    Elf64_Word    vda_name;
-+    Elf64_Word    vda_next;
-+}
-+
-+struct Elf64_Verneed
-+{
-+    Elf64_Half    vn_version;
-+    Elf64_Half    vn_cnt;
-+    Elf64_Word    vn_file;
-+    Elf64_Word    vn_aux;
-+    Elf64_Word    vn_next;
-+}
-+
-+struct Elf64_Vernaux
-+{
-+    Elf64_Word    vna_hash;
-+    Elf64_Half    vna_flags;
-+    Elf64_Half    vna_other;
-+    Elf64_Word    vna_name;
-+    Elf64_Word    vna_next;
-+}
-+
-+alias Elf64_Half Elf64_Versym;
-+
-+struct Elf64_Syminfo
-+{
-+    Elf64_Half si_boundto;
-+    Elf64_Half si_flags;
-+}
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf__common.d b/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf__common.d
deleted file mode 100644
index 55c1056c55..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_elf__common.d
+++ /dev/null
@@ -1,866 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/netbsd/sys/elf_common.d.orig	2016-03-02 01:38:47.244219558 +0000
-+++ runtime/druntime/src/core/sys/netbsd/sys/elf_common.d
-@@ -0,0 +1,859 @@
-+/**
-+ * D header file for NetBSD.
-+ * TODO - check
-+ *
-+ * $(LINK2 http://svnweb.freebsd.org/base/head/sys/sys/elf_common.h?view=markup, sys/elf_common.h)
-+ */
-+module core.sys.netbsd.sys.elf_common;
-+
-+version (NetBSD):
-+extern (C):
-+pure:
-+nothrow:
-+
-+import core.stdc.stdint;
-+
-+struct Elf_Note
-+{
-+    uint32_t      n_namesz;
-+    uint32_t      n_descsz;
-+    uint32_t      n_type;
-+}
-+
-+struct Elf_GNU_Hash_Header
-+{
-+    uint32_t      gh_nbuckets;
-+    uint32_t      gh_symndx;
-+    uint32_t      gh_maskwords;
-+    uint32_t      gh_shift2;
-+}
-+
-+enum EI_MAG0 =         0;
-+enum EI_MAG1 =         1;
-+enum EI_MAG2 =         2;
-+enum EI_MAG3 =         3;
-+enum EI_CLASS =        4;
-+enum EI_DATA =         5;
-+enum EI_VERSION =      6;
-+enum EI_OSABI =        7;
-+enum EI_ABIVERSION =   8;
-+enum OLD_EI_BRAND =    8;
-+enum EI_PAD =          9;
-+enum EI_NIDENT =       16;
-+
-+enum ELFMAG0 =         0x7f;
-+enum ELFMAG1 =         'E';
-+enum ELFMAG2 =         'L';
-+enum ELFMAG3 =         'F';
-+enum ELFMAG =          "\177ELF";
-+enum SELFMAG =         4;
-+
-+enum EV_NONE =         0;
-+enum EV_CURRENT =      1;
-+
-+enum ELFCLASSNONE =    0;
-+enum ELFCLASS32 =      1;
-+enum ELFCLASS64 =      2;
-+
-+enum ELFDATANONE =     0;
-+enum ELFDATA2LSB =     1;
-+enum ELFDATA2MSB =     2;
-+
-+enum ELFOSABI_NONE =           0;
-+enum ELFOSABI_SYSV =           0;
-+enum ELFOSABI_HPUX =           1;
-+enum ELFOSABI_NETBSD =         2;
-+enum ELFOSABI_LINUX =          3;
-+enum ELFOSABI_HURD  =          4;
-+enum ELFOSABI_86OPEN =         5;
-+enum ELFOSABI_SOLARIS =        6;
-+enum ELFOSABI_AIX =            7;
-+enum ELFOSABI_MONTEREY =       7;
-+enum ELFOSABI_IRIX =           8;
-+enum ELFOSABI_FREEBSD =        9;
-+enum ELFOSABI_TRU64 =          10;
-+enum ELFOSABI_MODESTO =        11;
-+enum ELFOSABI_OPENBSD =        12;
-+enum ELFOSABI_OPENVMS =        13;
-+enum ELFOSABI_NSK =            14;
-+enum ELFOSABI_AROS =           15;
-+enum ELFOSABI_ARM =            97;
-+enum ELFOSABI_STANDALONE =     255;
-+
-+extern (D)
-+{
-+    auto IS_ELF(T)(T ehdr) { return ehdr.e_ident[EI_MAG0] == ELFMAG0 &&
-+                                    ehdr.e_ident[EI_MAG1] == ELFMAG1 &&
-+                                    ehdr.e_ident[EI_MAG2] == ELFMAG2 &&
-+                                    ehdr.e_ident[EI_MAG3] == ELFMAG3; }
-+}
-+
-+enum ET_NONE =         0;
-+enum ET_REL =          1;
-+enum ET_EXEC =         2;
-+enum ET_DYN =          3;
-+enum ET_CORE =         4;
-+enum ET_LOOS =         0xfe00;
-+enum ET_HIOS =         0xfeff;
-+enum ET_LOPROC =       0xff00;
-+enum ET_HIPROC =       0xffff;
-+
-+enum EM_NONE =          0;
-+enum EM_M32 =           1;
-+enum EM_SPARC =         2;
-+enum EM_386 =           3;
-+enum EM_68K =           4;
-+enum EM_88K =           5;
-+enum EM_860 =           7;
-+enum EM_MIPS =          8;
-+enum EM_S370 =          9;
-+enum EM_MIPS_RS3_LE =  10;
-+enum EM_PARISC =       15;
-+enum EM_VPP500 =       17;
-+enum EM_SPARC32PLUS =  18;
-+enum EM_960 =          19;
-+enum EM_PPC =          20;
-+enum EM_PPC64 =        21;
-+enum EM_S390 =         22;
-+enum EM_V800 =         36;
-+enum EM_FR20 =         37;
-+enum EM_RH32 =         38;
-+enum EM_RCE =          39;
-+enum EM_ARM =          40;
-+enum EM_SH =           42;
-+enum EM_SPARCV9 =      43;
-+enum EM_TRICORE =      44;
-+enum EM_ARC =          45;
-+enum EM_H8_300 =       46;
-+enum EM_H8_300H =      47;
-+enum EM_H8S =          48;
-+enum EM_H8_500 =       49;
-+enum EM_IA_64 =        50;
-+enum EM_MIPS_X =       51;
-+enum EM_COLDFIRE =     52;
-+enum EM_68HC12 =       53;
-+enum EM_MMA =          54;
-+enum EM_PCP =          55;
-+enum EM_NCPU =         56;
-+enum EM_NDR1 =         57;
-+enum EM_STARCORE =     58;
-+enum EM_ME16 =         59;
-+enum EM_ST100 =        60;
-+enum EM_TINYJ =        61;
-+enum EM_X86_64 =       62;
-+enum EM_AMD64 =        62;
-+enum EM_PDSP =         63;
-+enum EM_FX66 =         66;
-+enum EM_ST9PLUS =      67;
-+enum EM_ST7 =          68;
-+enum EM_68HC16 =       69;
-+enum EM_68HC11 =       70;
-+enum EM_68HC08 =       71;
-+enum EM_68HC05 =       72;
-+enum EM_SVX =          73;
-+enum EM_ST19 =         74;
-+enum EM_VAX =          75;
-+enum EM_CRIS =         76;
-+enum EM_JAVELIN =      77;
-+enum EM_FIREPATH =     78;
-+enum EM_ZSP =          79;
-+enum EM_MMIX =         80;
-+enum EM_HUANY =        81;
-+enum EM_PRISM =        82;
-+enum EM_AVR =          83;
-+enum EM_FR30 =         84;
-+enum EM_D10V =         85;
-+enum EM_D30V =         86;
-+enum EM_V850 =         87;
-+enum EM_M32R =         88;
-+enum EM_MN10300 =      89;
-+enum EM_MN10200 =      90;
-+enum EM_PJ =           91;
-+enum EM_OPENRISC =     92;
-+enum EM_ARC_A5 =       93;
-+enum EM_XTENSA =       94;
-+enum EM_VIDEOCORE =    95;
-+enum EM_TMM_GPP =      96;
-+enum EM_NS32K =        97;
-+enum EM_TPC =          98;
-+enum EM_SNP1K =        99;
-+enum EM_ST200 =       100;
-+enum EM_IP2K =        101;
-+enum EM_MAX =         102;
-+enum EM_CR =          103;
-+enum EM_F2MC16 =      104;
-+enum EM_MSP430 =      105;
-+enum EM_BLACKFIN =    106;
-+enum EM_SE_C33 =      107;
-+enum EM_SEP =         108;
-+enum EM_ARCA =        109;
-+enum EM_UNICORE =     110;
-+enum EM_AARCH64 =     183;     /* AArch64 64-bit ARM microprocessor */
-+
-+/* Unofficial machine types follow */
-+enum EM_AVR32  =       6317;    /* used by NetBSD/avr32 */
-+enum EM_ALPHA_EXP  =  36902;   /* used by NetBSD/alpha; obsolete */
-+
-+enum EM_486 =           6;
-+enum EM_MIPS_RS4_BE =  10;
-+enum EM_ALPHA_STD =    41;
-+enum EM_ALPHA =    0x9026;
-+
-+enum SHN_UNDEF =       0;
-+enum SHN_LORESERVE =   0xff00;
-+enum SHN_LOPROC =      0xff00;
-+enum SHN_HIPROC =      0xff1f;
-+enum SHN_LOOS =        0xff20;
-+enum SHN_HIOS =        0xff3f;
-+enum SHN_ABS =         0xfff1;
-+enum SHN_COMMON =      0xfff2;
-+enum SHN_XINDEX =      0xffff;
-+enum SHN_HIRESERVE =   0xffff;
-+
-+enum SHT_NULL =          0;
-+enum SHT_PROGBITS =      1;
-+enum SHT_SYMTAB =        2;
-+enum SHT_STRTAB =        3;
-+enum SHT_RELA =          4;
-+enum SHT_HASH =          5;
-+enum SHT_DYNAMIC =       6;
-+enum SHT_NOTE =          7;
-+enum SHT_NOBITS =        8;
-+enum SHT_REL =           9;
-+enum SHT_SHLIB =         10;
-+enum SHT_DYNSYM =        11;
-+enum SHT_INIT_ARRAY =    14;
-+enum SHT_FINI_ARRAY =    15;
-+enum SHT_PREINIT_ARRAY = 16;
-+enum SHT_GROUP =         17;
-+enum SHT_SYMTAB_SHNDX =  18;
-+enum SHT_LOOS =          0x60000000;
-+enum SHT_LOSUNW =        0x6ffffff4;
-+enum SHT_SUNW_dof =      0x6ffffff4;
-+enum SHT_SUNW_cap =      0x6ffffff5;
-+enum SHT_SUNW_SIGNATURE = 0x6ffffff6;
-+enum SHT_GNU_HASH =      0x6ffffff6;
-+enum SHT_SUNW_ANNOTATE = 0x6ffffff7;
-+enum SHT_SUNW_DEBUGSTR = 0x6ffffff8;
-+enum SHT_SUNW_DEBUG =    0x6ffffff9;
-+enum SHT_SUNW_move =     0x6ffffffa;
-+enum SHT_SUNW_COMDAT =   0x6ffffffb;
-+enum SHT_SUNW_syminfo =  0x6ffffffc;
-+enum SHT_SUNW_verdef =   0x6ffffffd;
-+enum SHT_GNU_verdef =    0x6ffffffd;
-+enum SHT_SUNW_verneed =  0x6ffffffe;
-+enum SHT_GNU_verneed =   0x6ffffffe;
-+enum SHT_SUNW_versym =   0x6fffffff;
-+enum SHT_GNU_versym =    0x6fffffff;
-+enum SHT_HISUNW =        0x6fffffff;
-+enum SHT_HIOS =          0x6fffffff;
-+enum SHT_LOPROC =        0x70000000;
-+enum SHT_AMD64_UNWIND =  0x70000001;
-+enum SHT_ARM_EXIDX =     0x70000001;
-+enum SHT_ARM_PREEMPTMAP = 0x70000002;
-+enum SHT_ARM_ATTRIBUTES = 0x70000003;
-+enum SHT_ARM_DEBUGOVERLAY = 0x70000004;
-+enum SHT_ARM_OVERLAYSECTION = 0x70000005;
-+enum SHT_MIPS_REGINFO =  0x70000006;
-+enum SHT_MIPS_OPTIONS =  0x7000000d;
-+enum SHT_MIPS_DWARF =    0x7000001e;
-+enum SHT_HIPROC =        0x7fffffff;
-+enum SHT_LOUSER =        0x80000000;
-+enum SHT_HIUSER =        0x8fffffff;
-+
-+enum SHF_WRITE =            (1 << 0);
-+enum SHF_ALLOC =            (1 << 1);
-+enum SHF_EXECINSTR =        (1 << 2);
-+enum SHF_MERGE =            (1 << 4);
-+enum SHF_STRINGS =          (1 << 5);
-+enum SHF_INFO_LINK =        (1 << 6);
-+enum SHF_LINK_ORDER =       (1 << 7);
-+enum SHF_OS_NONCONFORMING = (1 << 8);
-+enum SHF_GROUP =            (1 << 9);
-+enum SHF_TLS =              (1 << 10);
-+enum SHF_MASKOS =           0x0ff00000;
-+enum SHF_MASKPROC =         0xf0000000;
-+
-+enum PT_NULL =         0;
-+enum PT_LOAD =         1;
-+enum PT_DYNAMIC =      2;
-+enum PT_INTERP =       3;
-+enum PT_NOTE =         4;
-+enum PT_SHLIB =        5;
-+enum PT_PHDR =         6;
-+enum PT_TLS =          7;
-+enum PT_LOOS =         0x60000000;
-+enum PT_SUNW_UNWIND =  0x6464e550;
-+enum PT_GNU_EH_FRAME = 0x6474e550;
-+enum PT_GNU_STACK =    0x6474e551;
-+enum PT_GNU_RELRO =    0x6474e552;
-+enum PT_LOSUNW =       0x6ffffffa;
-+enum PT_SUNWBSS =      0x6ffffffa;
-+enum PT_SUNWSTACK =    0x6ffffffb;
-+enum PT_SUNWDTRACE =   0x6ffffffc;
-+enum PT_SUNWCAP =      0x6ffffffd;
-+enum PT_HISUNW =       0x6fffffff;
-+enum PT_HIOS =         0x6fffffff;
-+enum PT_LOPROC =       0x70000000;
-+enum PT_HIPROC =       0x7fffffff;
-+
-+enum PF_X =            (1 << 0);
-+enum PF_W =            (1 << 1);
-+enum PF_R =            (1 << 2);
-+enum PF_MASKOS =       0x0ff00000;
-+enum PF_MASKPROC =     0xf0000000;
-+
-+enum PN_XNUM =         0xffff;
-+
-+enum DT_NULL =         0;
-+enum DT_NEEDED =       1;
-+enum DT_PLTRELSZ =     2;
-+enum DT_PLTGOT =       3;
-+enum DT_HASH =         4;
-+enum DT_STRTAB =       5;
-+enum DT_SYMTAB =       6;
-+enum DT_RELA =         7;
-+enum DT_RELASZ =       8;
-+enum DT_RELAENT =      9;
-+enum DT_STRSZ =        10;
-+enum DT_SYMENT =       11;
-+enum DT_INIT =         12;
-+enum DT_FINI =         13;
-+enum DT_SONAME =       14;
-+enum DT_RPATH =        15;
-+enum DT_SYMBOLIC =     16;
-+enum DT_REL =          17;
-+enum DT_RELSZ =        18;
-+enum DT_RELENT =       19;
-+enum DT_PLTREL =       20;
-+enum DT_DEBUG =        21;
-+enum DT_TEXTREL =      22;
-+enum DT_JMPREL =       23;
-+enum DT_BIND_NOW =     24;
-+enum DT_INIT_ARRAY =   25;
-+enum DT_FINI_ARRAY =   26;
-+enum DT_INIT_ARRAYSZ = 27;
-+enum DT_FINI_ARRAYSZ = 28;
-+enum DT_RUNPATH =      29;
-+enum DT_FLAGS =        30;
-+enum DT_ENCODING =     32;
-+enum DT_PREINIT_ARRAY = 32;
-+enum DT_PREINIT_ARRAYSZ = 33;
-+enum DT_MAXPOSTAGS =   34;
-+enum DT_LOOS =         0x6000000d;
-+enum DT_SUNW_AUXILIARY = 0x6000000d;
-+enum DT_SUNW_RTLDINF = 0x6000000e;
-+enum DT_SUNW_FILTER =  0x6000000f;
-+enum DT_SUNW_CAP =     0x60000010;
-+enum DT_HIOS =         0x6ffff000;
-+enum DT_VALRNGLO =     0x6ffffd00;
-+enum DT_CHECKSUM =     0x6ffffdf8;
-+enum DT_PLTPADSZ =     0x6ffffdf9;
-+enum DT_MOVEENT =      0x6ffffdfa;
-+enum DT_MOVESZ =       0x6ffffdfb;
-+enum DT_FEATURE_1 =    0x6ffffdfc;
-+enum DT_POSFLAG_1 =    0x6ffffdfd;
-+enum DT_SYMINSZ =      0x6ffffdfe;
-+enum DT_SYMINENT =     0x6ffffdff;
-+enum DT_VALRNGHI =     0x6ffffdff;
-+enum DT_ADDRRNGLO =    0x6ffffe00;
-+enum DT_GNU_HASH =     0x6ffffef5;
-+enum DT_CONFIG =       0x6ffffefa;
-+enum DT_DEPAUDIT =     0x6ffffefb;
-+enum DT_AUDIT =        0x6ffffefc;
-+enum DT_PLTPAD =       0x6ffffefd;
-+enum DT_MOVETAB =      0x6ffffefe;
-+enum DT_SYMINFO =      0x6ffffeff;
-+enum DT_ADDRRNGHI =    0x6ffffeff;
-+enum DT_VERSYM =       0x6ffffff0;
-+enum DT_RELACOUNT =    0x6ffffff9;
-+enum DT_RELCOUNT =     0x6ffffffa;
-+enum DT_FLAGS_1 =      0x6ffffffb;
-+enum DT_VERDEF =       0x6ffffffc;
-+enum DT_VERDEFNUM =    0x6ffffffd;
-+enum DT_VERNEED =      0x6ffffffe;
-+enum DT_VERNEEDNUM =   0x6fffffff;
-+enum DT_LOPROC =       0x70000000;
-+enum DT_DEPRECATED_SPARC_REGISTER = 0x7000001;
-+enum DT_AUXILIARY =    0x7ffffffd;
-+enum DT_USED =         0x7ffffffe;
-+enum DT_FILTER =       0x7fffffff;
-+enum DT_HIPROC =       0x7fffffff;
-+
-+enum DF_ORIGIN =       0x00000001;
-+enum DF_SYMBOLIC =     0x00000002;
-+enum DF_TEXTREL =      0x00000004;
-+enum DF_BIND_NOW =     0x00000008;
-+enum DF_STATIC_TLS =   0x00000010;
-+
-+enum DF_1_BIND_NOW =   0x00000001;
-+enum DF_1_GLOBAL =     0x00000002;
-+enum DF_1_NODELETE =   0x00000008;
-+enum DF_1_LOADFLTR =   0x00000010;
-+enum DF_1_NOOPEN =     0x00000040;
-+enum DF_1_NODEFLIB =   0x00000800;
-+
-+enum NT_PRSTATUS =     1;
-+enum NT_FPREGSET =     2;
-+enum NT_PRPSINFO =     3;
-+enum NT_THRMISC =      7;
-+enum NT_PROCSTAT_PROC = 8;
-+enum NT_PROCSTAT_FILES = 9;
-+enum NT_PROCSTAT_VMMAP = 10;
-+enum NT_PROCSTAT_GROUPS = 11;
-+enum NT_PROCSTAT_UMASK = 12;
-+enum NT_PROCSTAT_RLIMIT = 13;
-+enum NT_PROCSTAT_OSREL = 14;
-+enum NT_PROCSTAT_PSSTRINGS = 15;
-+enum NT_PROCSTAT_AUXV = 16;
-+
-+enum STB_LOCAL =       0;
-+enum STB_GLOBAL =      1;
-+enum STB_WEAK =        2;
-+enum STB_NUM =         3;
-+enum STB_LOOS =        10;
-+enum STB_HIOS =        12;
-+enum STB_LOPROC =      13;
-+enum STB_HIPROC =      15;
-+
-+enum STT_NOTYPE =      0;
-+enum STT_OBJECT =      1;
-+enum STT_FUNC =        2;
-+enum STT_SECTION =     3;
-+enum STT_FILE =        4;
-+enum STT_COMMON =      5;
-+enum STT_TLS =         6;
-+enum STT_NUM =         7;
-+enum STT_LOOS =        10;
-+enum STT_GNU_IFUNC =   10;
-+enum STT_HIOS =        12;
-+enum STT_LOPROC =      13;
-+enum STT_HIPROC =      15;
-+
-+enum STV_DEFAULT =     0;
-+enum STV_INTERNAL =    1;
-+enum STV_HIDDEN =      2;
-+enum STV_PROTECTED =   3;
-+enum STV_EXPORTED =    4;
-+enum STV_SINGLETON =   5;
-+enum STV_ELIMINATE =   6;
-+
-+enum STN_UNDEF =       0;
-+
-+enum VER_DEF_CURRENT = 1;
-+alias VER_NDX VER_DEF_IDX;
-+
-+enum VER_FLG_BASE =    0x1;
-+enum VER_FLG_WEAK =    0x2;
-+
-+enum VER_NEED_CURRENT = 1;
-+enum VER_NEED_WEAK =    32768;
-+enum VER_NEED_HIDDEN = VER_NDX_HIDDEN;
-+alias VER_NDX VER_NEED_IDX;
-+
-+enum VER_NDX_LOCAL =           0;
-+enum VER_NDX_GLOBAL =          1;
-+enum VER_NDX_GIVEN =           2;
-+
-+enum VER_NDX_HIDDEN =      32768;
-+extern (D)
-+{
-+    auto VER_NDX(V)(V v) { return v & ~(1u << 15); }
-+}
-+
-+enum CA_SUNW_NULL =    0;
-+enum CA_SUNW_HW_1 =    1;
-+enum CA_SUNW_SF_1 =    2;
-+
-+enum SYMINFO_FLG_DIRECT =      0x0001;
-+enum SYMINFO_FLG_PASSTHRU =    0x0002;
-+enum SYMINFO_FLG_COPY =        0x0004;
-+enum SYMINFO_FLG_LAZYLOAD =    0x0008;
-+enum SYMINFO_FLG_DIRECTBIND =  0x0010;
-+enum SYMINFO_FLG_NOEXTDIRECT = 0x0020;
-+enum SYMINFO_FLG_FILTER =      0x0002;
-+enum SYMINFO_FLG_AUXILIARY =   0x0040;
-+
-+enum SYMINFO_BT_SELF =         0xffff;
-+enum SYMINFO_BT_PARENT =       0xfffe;
-+enum SYMINFO_BT_NONE =         0xfffd;
-+enum SYMINFO_BT_EXTERN =       0xfffc;
-+enum SYMINFO_BT_LOWRESERVE =   0xff00;
-+
-+enum SYMINFO_NONE =            0;
-+enum SYMINFO_CURRENT =         1;
-+enum SYMINFO_NUM =             2;
-+
-+enum R_386_NONE =               0;
-+enum R_386_32 =                 1;
-+enum R_386_PC32 =               2;
-+enum R_386_GOT32 =              3;
-+enum R_386_PLT32 =              4;
-+enum R_386_COPY =               5;
-+enum R_386_GLOB_DAT =           6;
-+enum R_386_JMP_SLOT =           7;
-+enum R_386_RELATIVE =           8;
-+enum R_386_GOTOFF =             9;
-+enum R_386_GOTPC =              10;
-+enum R_386_TLS_TPOFF =          14;
-+enum R_386_TLS_IE =             15;
-+enum R_386_TLS_GOTIE =          16;
-+enum R_386_TLS_LE =             17;
-+enum R_386_TLS_GD =             18;
-+enum R_386_TLS_LDM =            19;
-+enum R_386_TLS_GD_32 =          24;
-+enum R_386_TLS_GD_PUSH =        25;
-+enum R_386_TLS_GD_CALL =        26;
-+enum R_386_TLS_GD_POP =         27;
-+enum R_386_TLS_LDM_32 =         28;
-+enum R_386_TLS_LDM_PUSH =       29;
-+enum R_386_TLS_LDM_CALL =       30;
-+enum R_386_TLS_LDM_POP =        31;
-+enum R_386_TLS_LDO_32 =         32;
-+enum R_386_TLS_IE_32 =          33;
-+enum R_386_TLS_LE_32 =          34;
-+enum R_386_TLS_DTPMOD32 =       35;
-+enum R_386_TLS_DTPOFF32 =       36;
-+enum R_386_TLS_TPOFF32 =        37;
-+enum R_386_IRELATIVE =          42;
-+
-+enum R_ARM_NONE =               0;
-+enum R_ARM_PC24 =               1;
-+enum R_ARM_ABS32 =              2;
-+enum R_ARM_REL32 =              3;
-+enum R_ARM_PC13 =               4;
-+enum R_ARM_ABS16 =              5;
-+enum R_ARM_ABS12 =              6;
-+enum R_ARM_THM_ABS5 =           7;
-+enum R_ARM_ABS8 =               8;
-+enum R_ARM_SBREL32 =            9;
-+enum R_ARM_THM_PC22 =           10;
-+enum R_ARM_THM_PC8 =            11;
-+enum R_ARM_AMP_VCALL9 =         12;
-+enum R_ARM_SWI24 =              13;
-+enum R_ARM_THM_SWI8 =           14;
-+enum R_ARM_XPC25 =              15;
-+enum R_ARM_THM_XPC22 =          16;
-+enum R_ARM_TLS_DTPMOD32 =       17;
-+enum R_ARM_TLS_DTPOFF32 =       18;
-+enum R_ARM_TLS_TPOFF32 =        19;
-+enum R_ARM_COPY =               20;
-+enum R_ARM_GLOB_DAT =           21;
-+enum R_ARM_JUMP_SLOT =          22;
-+enum R_ARM_RELATIVE =           23;
-+enum R_ARM_GOTOFF =             24;
-+enum R_ARM_GOTPC =              25;
-+enum R_ARM_GOT32 =              26;
-+enum R_ARM_PLT32 =              27;
-+enum R_ARM_GNU_VTENTRY =        100;
-+enum R_ARM_GNU_VTINHERIT =      101;
-+enum R_ARM_RSBREL32 =           250;
-+enum R_ARM_THM_RPC22 =          251;
-+enum R_ARM_RREL32 =             252;
-+enum R_ARM_RABS32 =             253;
-+enum R_ARM_RPC24 =              254;
-+enum R_ARM_RBASE =              255;
-+
-+enum R_IA_64_NONE =             0;
-+enum R_IA_64_IMM14 =            0x21;
-+enum R_IA_64_IMM22 =            0x22;
-+enum R_IA_64_IMM64 =            0x23;
-+enum R_IA_64_DIR32MSB =         0x24;
-+enum R_IA_64_DIR32LSB =         0x25;
-+enum R_IA_64_DIR64MSB =         0x26;
-+enum R_IA_64_DIR64LSB =         0x27;
-+enum R_IA_64_GPREL22 =          0x2a;
-+enum R_IA_64_GPREL64I =         0x2b;
-+enum R_IA_64_GPREL32MSB =       0x2c;
-+enum R_IA_64_GPREL32LSB =       0x2d;
-+enum R_IA_64_GPREL64MSB =       0x2e;
-+enum R_IA_64_GPREL64LSB =       0x2f;
-+enum R_IA_64_LTOFF22 =          0x32;
-+enum R_IA_64_LTOFF64I =         0x33;
-+enum R_IA_64_PLTOFF22 =         0x3a;
-+enum R_IA_64_PLTOFF64I =        0x3b;
-+enum R_IA_64_PLTOFF64MSB =      0x3e;
-+enum R_IA_64_PLTOFF64LSB =      0x3f;
-+enum R_IA_64_FPTR64I =          0x43;
-+enum R_IA_64_FPTR32MSB =        0x44;
-+enum R_IA_64_FPTR32LSB =        0x45;
-+enum R_IA_64_FPTR64MSB =        0x46;
-+enum R_IA_64_FPTR64LSB =        0x47;
-+enum R_IA_64_PCREL60B =         0x48;
-+enum R_IA_64_PCREL21B =         0x49;
-+enum R_IA_64_PCREL21M =         0x4a;
-+enum R_IA_64_PCREL21F =         0x4b;
-+enum R_IA_64_PCREL32MSB =       0x4c;
-+enum R_IA_64_PCREL32LSB =       0x4d;
-+enum R_IA_64_PCREL64MSB =       0x4e;
-+enum R_IA_64_PCREL64LSB =       0x4f;
-+enum R_IA_64_LTOFF_FPTR22 =     0x52;
-+enum R_IA_64_LTOFF_FPTR64I =    0x53;
-+enum R_IA_64_LTOFF_FPTR32MSB =  0x54;
-+enum R_IA_64_LTOFF_FPTR32LSB =  0x55;
-+enum R_IA_64_LTOFF_FPTR64MSB =  0x56;
-+enum R_IA_64_LTOFF_FPTR64LSB =  0x57;
-+enum R_IA_64_SEGREL32MSB =      0x5c;
-+enum R_IA_64_SEGREL32LSB =      0x5d;
-+enum R_IA_64_SEGREL64MSB =      0x5e;
-+enum R_IA_64_SEGREL64LSB =      0x5f;
-+enum R_IA_64_SECREL32MSB =      0x64;
-+enum R_IA_64_SECREL32LSB =      0x65;
-+enum R_IA_64_SECREL64MSB =      0x66;
-+enum R_IA_64_SECREL64LSB =      0x67;
-+enum R_IA_64_REL32MSB =         0x6c;
-+enum R_IA_64_REL32LSB =         0x6d;
-+enum R_IA_64_REL64MSB =         0x6e;
-+enum R_IA_64_REL64LSB =         0x6f;
-+enum R_IA_64_LTV32MSB =         0x74;
-+enum R_IA_64_LTV32LSB =         0x75;
-+enum R_IA_64_LTV64MSB =         0x76;
-+enum R_IA_64_LTV64LSB =         0x77;
-+enum R_IA_64_PCREL21BI =        0x79;
-+enum R_IA_64_PCREL22 =          0x7a;
-+enum R_IA_64_PCREL64I =         0x7b;
-+enum R_IA_64_IPLTMSB =          0x80;
-+enum R_IA_64_IPLTLSB =          0x81;
-+enum R_IA_64_SUB =              0x85;
-+enum R_IA_64_LTOFF22X =         0x86;
-+enum R_IA_64_LDXMOV =           0x87;
-+enum R_IA_64_TPREL14 =          0x91;
-+enum R_IA_64_TPREL22 =          0x92;
-+enum R_IA_64_TPREL64I =         0x93;
-+enum R_IA_64_TPREL64MSB =       0x96;
-+enum R_IA_64_TPREL64LSB =       0x97;
-+enum R_IA_64_LTOFF_TPREL22 =    0x9a;
-+enum R_IA_64_DTPMOD64MSB =      0xa6;
-+enum R_IA_64_DTPMOD64LSB =      0xa7;
-+enum R_IA_64_LTOFF_DTPMOD22 =   0xaa;
-+enum R_IA_64_DTPREL14 =         0xb1;
-+enum R_IA_64_DTPREL22 =         0xb2;
-+enum R_IA_64_DTPREL64I =        0xb3;
-+enum R_IA_64_DTPREL32MSB =      0xb4;
-+enum R_IA_64_DTPREL32LSB =      0xb5;
-+enum R_IA_64_DTPREL64MSB =      0xb6;
-+enum R_IA_64_DTPREL64LSB =      0xb7;
-+enum R_IA_64_LTOFF_DTPREL22 =   0xba;
-+
-+enum R_MIPS_NONE =              0;
-+enum R_MIPS_16 =                1;
-+enum R_MIPS_32 =                2;
-+enum R_MIPS_REL32 =             3;
-+enum R_MIPS_26 =                4;
-+enum R_MIPS_HI16 =              5;
-+enum R_MIPS_LO16 =              6;
-+enum R_MIPS_GPREL16 =           7;
-+enum R_MIPS_LITERAL =           8;
-+enum R_MIPS_GOT16 =             9;
-+enum R_MIPS_PC16 =              10;
-+enum R_MIPS_CALL16 =            11;
-+enum R_MIPS_GPREL32 =           12;
-+enum R_MIPS_GOTHI16 =           21;
-+enum R_MIPS_GOTLO16 =           22;
-+enum R_MIPS_CALLHI16 =          30;
-+enum R_MIPS_CALLLO16 =          31;
-+
-+enum R_PPC_NONE =               0;
-+enum R_PPC_ADDR32 =             1;
-+enum R_PPC_ADDR24 =             2;
-+enum R_PPC_ADDR16 =             3;
-+enum R_PPC_ADDR16_LO =          4;
-+enum R_PPC_ADDR16_HI =          5;
-+enum R_PPC_ADDR16_HA =          6;
-+enum R_PPC_ADDR14 =             7;
-+enum R_PPC_ADDR14_BRTAKEN =     8;
-+enum R_PPC_ADDR14_BRNTAKEN =    9;
-+enum R_PPC_REL24 =              10;
-+enum R_PPC_REL14 =              11;
-+enum R_PPC_REL14_BRTAKEN =      12;
-+enum R_PPC_REL14_BRNTAKEN =     13;
-+enum R_PPC_GOT16 =              14;
-+enum R_PPC_GOT16_LO =           15;
-+enum R_PPC_GOT16_HI =           16;
-+enum R_PPC_GOT16_HA =           17;
-+enum R_PPC_PLTREL24 =           18;
-+enum R_PPC_COPY =               19;
-+enum R_PPC_GLOB_DAT =           20;
-+enum R_PPC_JMP_SLOT =           21;
-+enum R_PPC_RELATIVE =           22;
-+enum R_PPC_LOCAL24PC =          23;
-+enum R_PPC_UADDR32 =            24;
-+enum R_PPC_UADDR16 =            25;
-+enum R_PPC_REL32 =              26;
-+enum R_PPC_PLT32 =              27;
-+enum R_PPC_PLTREL32 =           28;
-+enum R_PPC_PLT16_LO =           29;
-+enum R_PPC_PLT16_HI =           30;
-+enum R_PPC_PLT16_HA =           31;
-+enum R_PPC_SDAREL16 =           32;
-+enum R_PPC_SECTOFF =            33;
-+enum R_PPC_SECTOFF_LO =         34;
-+enum R_PPC_SECTOFF_HI =         35;
-+enum R_PPC_SECTOFF_HA =         36;
-+
-+enum R_PPC64_ADDR64 =           38;
-+enum R_PPC64_ADDR16_HIGHER =    39;
-+enum R_PPC64_ADDR16_HIGHERA =   40;
-+enum R_PPC64_ADDR16_HIGHEST =   41;
-+enum R_PPC64_ADDR16_HIGHESTA =  42;
-+enum R_PPC64_UADDR64 =          43;
-+enum R_PPC64_REL64 =            44;
-+enum R_PPC64_PLT64 =            45;
-+enum R_PPC64_PLTREL64 =         46;
-+enum R_PPC64_TOC16 =            47;
-+enum R_PPC64_TOC16_LO =         48;
-+enum R_PPC64_TOC16_HI =         49;
-+enum R_PPC64_TOC16_HA =         50;
-+enum R_PPC64_TOC =              51;
-+enum R_PPC64_DTPMOD64 =         68;
-+enum R_PPC64_TPREL64 =          73;
-+enum R_PPC64_DTPREL64 =         78;
-+
-+enum R_PPC_TLS =                67;
-+enum R_PPC_DTPMOD32 =           68;
-+enum R_PPC_TPREL16 =            69;
-+enum R_PPC_TPREL16_LO =         70;
-+enum R_PPC_TPREL16_HI =         71;
-+enum R_PPC_TPREL16_HA =         72;
-+enum R_PPC_TPREL32 =            73;
-+enum R_PPC_DTPREL16 =           74;
-+enum R_PPC_DTPREL16_LO =        75;
-+enum R_PPC_DTPREL16_HI =        76;
-+enum R_PPC_DTPREL16_HA =        77;
-+enum R_PPC_DTPREL32 =           78;
-+enum R_PPC_GOT_TLSGD16 =        79;
-+enum R_PPC_GOT_TLSGD16_LO =     80;
-+enum R_PPC_GOT_TLSGD16_HI =     81;
-+enum R_PPC_GOT_TLSGD16_HA =     82;
-+enum R_PPC_GOT_TLSLD16 =        83;
-+enum R_PPC_GOT_TLSLD16_LO =     84;
-+enum R_PPC_GOT_TLSLD16_HI =     85;
-+enum R_PPC_GOT_TLSLD16_HA =     86;
-+enum R_PPC_GOT_TPREL16 =        87;
-+enum R_PPC_GOT_TPREL16_LO =     88;
-+enum R_PPC_GOT_TPREL16_HI =     89;
-+enum R_PPC_GOT_TPREL16_HA =     90;
-+
-+enum R_PPC_EMB_NADDR32 =        101;
-+enum R_PPC_EMB_NADDR16 =        102;
-+enum R_PPC_EMB_NADDR16_LO =     103;
-+enum R_PPC_EMB_NADDR16_HI =     104;
-+enum R_PPC_EMB_NADDR16_HA =     105;
-+enum R_PPC_EMB_SDAI16 =         106;
-+enum R_PPC_EMB_SDA2I16 =        107;
-+enum R_PPC_EMB_SDA2REL =        108;
-+enum R_PPC_EMB_SDA21 =          109;
-+enum R_PPC_EMB_MRKREF =         110;
-+enum R_PPC_EMB_RELSEC16 =       111;
-+enum R_PPC_EMB_RELST_LO =       112;
-+enum R_PPC_EMB_RELST_HI =       113;
-+enum R_PPC_EMB_RELST_HA =       114;
-+enum R_PPC_EMB_BIT_FLD =        115;
-+enum R_PPC_EMB_RELSDA =         116;
-+
-+enum R_SPARC_NONE =             0;
-+enum R_SPARC_8 =                1;
-+enum R_SPARC_16 =               2;
-+enum R_SPARC_32 =               3;
-+enum R_SPARC_DISP8 =            4;
-+enum R_SPARC_DISP16 =           5;
-+enum R_SPARC_DISP32 =           6;
-+enum R_SPARC_WDISP30 =          7;
-+enum R_SPARC_WDISP22 =          8;
-+enum R_SPARC_HI22 =             9;
-+enum R_SPARC_22 =               10;
-+enum R_SPARC_13 =               11;
-+enum R_SPARC_LO10 =             12;
-+enum R_SPARC_GOT10 =            13;
-+enum R_SPARC_GOT13 =            14;
-+enum R_SPARC_GOT22 =            15;
-+enum R_SPARC_PC10 =             16;
-+enum R_SPARC_PC22 =             17;
-+enum R_SPARC_WPLT30 =           18;
-+enum R_SPARC_COPY =             19;
-+enum R_SPARC_GLOB_DAT =         20;
-+enum R_SPARC_JMP_SLOT =         21;
-+enum R_SPARC_RELATIVE =         22;
-+enum R_SPARC_UA32 =             23;
-+enum R_SPARC_PLT32 =            24;
-+enum R_SPARC_HIPLT22 =          25;
-+enum R_SPARC_LOPLT10 =          26;
-+enum R_SPARC_PCPLT32 =          27;
-+enum R_SPARC_PCPLT22 =          28;
-+enum R_SPARC_PCPLT10 =          29;
-+enum R_SPARC_10 =               30;
-+enum R_SPARC_11 =               31;
-+enum R_SPARC_64 =               32;
-+enum R_SPARC_OLO10 =            33;
-+enum R_SPARC_HH22 =             34;
-+enum R_SPARC_HM10 =             35;
-+enum R_SPARC_LM22 =             36;
-+enum R_SPARC_PC_HH22 =          37;
-+enum R_SPARC_PC_HM10 =          38;
-+enum R_SPARC_PC_LM22 =          39;
-+enum R_SPARC_WDISP16 =          40;
-+enum R_SPARC_WDISP19 =          41;
-+enum R_SPARC_GLOB_JMP =         42;
-+enum R_SPARC_7 =                43;
-+enum R_SPARC_5 =                44;
-+enum R_SPARC_6 =                45;
-+enum R_SPARC_DISP64 =           46;
-+enum R_SPARC_PLT64 =            47;
-+enum R_SPARC_HIX22 =            48;
-+enum R_SPARC_LOX10 =            49;
-+enum R_SPARC_H44 =              50;
-+enum R_SPARC_M44 =              51;
-+enum R_SPARC_L44 =              52;
-+enum R_SPARC_REGISTER =         53;
-+enum R_SPARC_UA64 =             54;
-+enum R_SPARC_UA16 =             55;
-+enum R_SPARC_TLS_GD_HI22 =      56;
-+enum R_SPARC_TLS_GD_LO10 =      57;
-+enum R_SPARC_TLS_GD_ADD =       58;
-+enum R_SPARC_TLS_GD_CALL =      59;
-+enum R_SPARC_TLS_LDM_HI22 =     60;
-+enum R_SPARC_TLS_LDM_LO10 =     61;
-+enum R_SPARC_TLS_LDM_ADD =      62;
-+enum R_SPARC_TLS_LDM_CALL =     63;
-+enum R_SPARC_TLS_LDO_HIX22 =    64;
-+enum R_SPARC_TLS_LDO_LOX10 =    65;
-+enum R_SPARC_TLS_LDO_ADD =      66;
-+enum R_SPARC_TLS_IE_HI22 =      67;
-+enum R_SPARC_TLS_IE_LO10 =      68;
-+enum R_SPARC_TLS_IE_LD =        69;
-+enum R_SPARC_TLS_IE_LDX =       70;
-+enum R_SPARC_TLS_IE_ADD =       71;
-+enum R_SPARC_TLS_LE_HIX22 =     72;
-+enum R_SPARC_TLS_LE_LOX10 =     73;
-+enum R_SPARC_TLS_DTPMOD32 =     74;
-+enum R_SPARC_TLS_DTPMOD64 =     75;
-+enum R_SPARC_TLS_DTPOFF32 =     76;
-+enum R_SPARC_TLS_DTPOFF64 =     77;
-+enum R_SPARC_TLS_TPOFF32 =      78;
-+enum R_SPARC_TLS_TPOFF64 =      79;
-+
-+enum R_X86_64_NONE =            0;
-+enum R_X86_64_64 =              1;
-+enum R_X86_64_PC32 =            2;
-+enum R_X86_64_GOT32 =           3;
-+enum R_X86_64_PLT32 =           4;
-+enum R_X86_64_COPY =            5;
-+enum R_X86_64_GLOB_DAT =        6;
-+enum R_X86_64_JMP_SLOT =        7;
-+enum R_X86_64_RELATIVE =        8;
-+enum R_X86_64_GOTPCREL =        9;
-+enum R_X86_64_32 =              10;
-+enum R_X86_64_32S =             11;
-+enum R_X86_64_16 =              12;
-+enum R_X86_64_PC16 =            13;
-+enum R_X86_64_8 =               14;
-+enum R_X86_64_PC8 =             15;
-+enum R_X86_64_DTPMOD64 =        16;
-+enum R_X86_64_DTPOFF64 =        17;
-+enum R_X86_64_TPOFF64 =         18;
-+enum R_X86_64_TLSGD =           19;
-+enum R_X86_64_TLSLD =           20;
-+enum R_X86_64_DTPOFF32 =        21;
-+enum R_X86_64_GOTTPOFF =        22;
-+enum R_X86_64_TPOFF32 =         23;
-+enum R_X86_64_IRELATIVE =       37;
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_event.d b/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_event.d
deleted file mode 100644
index a1348ad661..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_event.d
+++ /dev/null
@@ -1,115 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/netbsd/sys/event.d.orig	2016-03-02 01:38:47.246440929 +0000
-+++ runtime/druntime/src/core/sys/netbsd/sys/event.d
-@@ -0,0 +1,108 @@
-+/**
-+ * D header file for NetBSD.
-+ *
-+ * Copyright: Copyright Martin Nowak 2012.
-+ * License:   $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
-+ * Authors:   Martin Nowak
-+ */
-+
-+/*          Copyright Martin Nowak 2012.
-+ * Distributed under the Boost Software License, Version 1.0.
-+ *    (See accompanying file LICENSE or copy at
-+ *          http://www.boost.org/LICENSE_1_0.txt)
-+ */
-+module core.sys.netbsd.sys.event;
-+
-+version (NetBSD):
-+extern (C):
-+
-+import core.stdc.stdint;    // intptr_t, uintptr_t
-+import core.sys.posix.time; // timespec
-+
-+enum
-+{
-+    EVFILT_READ     =  0,
-+    EVFILT_WRITE    =  1,
-+    EVFILT_AIO      =  2, /* attached to aio requests */
-+    EVFILT_VNODE    =  3, /* attached to vnodes */
-+    EVFILT_PROC     =  4, /* attached to struct proc */
-+    EVFILT_SIGNAL   =  5, /* attached to struct proc */
-+    EVFILT_TIMER    =  6, /* timers */
-+    EVFILT_SYSCOUNT =  7,
-+}
-+
-+extern(D) void EV_SET(kevent_t* kevp, typeof(kevent_t.tupleof) args)
-+{
-+    *kevp = kevent_t(args);
-+}
-+
-+struct kevent_t
-+{
-+    uintptr_t    ident; /* identifier for this event */
-+    uint        filter; /* filter for event */
-+    uint        flags;
-+    uint        fflags;
-+    ulong       data;
-+    void        *udata; /* opaque user data identifier */
-+}
-+
-+enum
-+{
-+    /* actions */
-+    EV_ADD      = 0x0001, /* add event to kq (implies enable) */
-+    EV_DELETE   = 0x0002, /* delete event from kq */
-+    EV_ENABLE   = 0x0004, /* enable event */
-+    EV_DISABLE  = 0x0008, /* disable event (not reported) */
-+
-+    /* flags */
-+    EV_ONESHOT  = 0x0010, /* only report one occurrence */
-+    EV_CLEAR    = 0x0020, /* clear event state after reporting */
-+    EV_RECEIPT  = 0x0040, /* force EV_ERROR on success, data=0 */
-+    EV_DISPATCH = 0x0080, /* disable event after reporting */
-+
-+    EV_SYSFLAGS = 0xF000, /* reserved by system */
-+    EV_FLAG1    = 0x2000, /* filter-specific flag */
-+
-+    /* returned values */
-+    EV_EOF      = 0x8000, /* EOF detected */
-+    EV_ERROR    = 0x4000, /* error, data contains errno */
-+}
-+
-+enum
-+{
-+    /*
-+     * data/hint flags for EVFILT_{READ|WRITE}, shared with userspace
-+     */
-+    NOTE_LOWAT      = 0x0001,                  /* low water mark */
-+
-+    /*
-+     * data/hint flags for EVFILT_VNODE, shared with userspace
-+     */
-+    NOTE_DELETE     = 0x0001,                  /* vnode was removed */
-+    NOTE_WRITE      = 0x0002,                  /* data contents changed */
-+    NOTE_EXTEND     = 0x0004,                  /* size increased */
-+    NOTE_ATTRIB     = 0x0008,                  /* attributes changed */
-+    NOTE_LINK       = 0x0010,                  /* link count changed */
-+    NOTE_RENAME     = 0x0020,                  /* vnode was renamed */
-+    NOTE_REVOKE     = 0x0040,                  /* vnode access was revoked */
-+
-+    /*
-+     * data/hint flags for EVFILT_PROC, shared with userspace
-+     */
-+    NOTE_EXIT       = 0x80000000,              /* process exited */
-+    NOTE_FORK       = 0x40000000,              /* process forked */
-+    NOTE_EXEC       = 0x20000000,              /* process exec'd */
-+    NOTE_PCTRLMASK  = 0xf0000000,              /* mask for hint bits */
-+    NOTE_PDATAMASK  = 0x000fffff,              /* mask for pid */
-+
-+    /* additional flags for EVFILT_PROC */
-+    NOTE_TRACK      = 0x00000001,              /* follow across forks */
-+    NOTE_TRACKERR   = 0x00000002,              /* could not track child */
-+    NOTE_CHILD      = 0x00000004               /* am a child process */
-+
-+}
-+
-+int kqueue();
-+int kevent(int kq, const kevent_t *changelist, int nchanges,
-+           kevent_t *eventlist, int nevents,
-+           const timespec *timeout);
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_link__elf.d b/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_link__elf.d
deleted file mode 100644
index ca8461bebc..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_link__elf.d
+++ /dev/null
@@ -1,85 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/netbsd/sys/link_elf.d.orig	2016-03-02 01:38:47.248298358 +0000
-+++ runtime/druntime/src/core/sys/netbsd/sys/link_elf.d
-@@ -0,0 +1,78 @@
-+/**
-+ * D header file for NetBSD.
-+ *
-+ * $(LINK2 http://svnweb.freebsd.org/base/head/sys/sys/link_elf.h?view=markup, sys/link_elf.h)
-+ */
-+module core.sys.netbsd.sys.link_elf;
-+
-+version (NetBSD):
-+extern (C):
-+nothrow:
-+
-+import core.stdc.stdint : uint64_t;
-+import core.sys.netbsd.sys.elf;
-+
-+version(D_LP64)
-+    enum __ELF_NATIVE_CLASS = 64;
-+else
-+    enum __ELF_NATIVE_CLASS = 32;
-+
-+template ElfW(string type)
-+{
-+    mixin("alias Elf"~__ELF_NATIVE_CLASS.stringof~"_"~type~" ElfW;");
-+}
-+
-+enum LA_SER_ORIG =      0x01;
-+enum LA_SER_LIBPATH =   0x02;
-+enum LA_SER_RUNPATH =   0x04;
-+enum LA_SER_CONFIG =    0x08;
-+enum LA_SER_DEFAULT =   0x40;
-+enum LA_SER_SECURE =    0x80;
-+
-+struct link_map
-+{
-+    char*           l_addr;
-+
-+    version (MIPS32)
-+        char*       l_offs;
-+    version (MIPS64)
-+        char*       l_offs;
-+
-+    char*           l_name;
-+    void*           l_ld;
-+    link_map*       l_next, l_prev;
-+}
-+alias link_map Link_map;
-+
-+enum
-+{
-+    RT_CONSISTENT,
-+    RT_ADD,
-+    RT_DELETE,
-+}
-+
-+struct r_debug
-+{
-+    int             r_version;
-+    link_map*       r_map;
-+    void function(r_debug*, link_map*) r_brk;
-+};
-+
-+struct dl_phdr_info
-+{
-+    ElfW!"Addr"     dlpi_addr;
-+    char*           dlpi_name;
-+    ElfW!"Phdr"*    dlpi_phdr;
-+    ElfW!"Half"     dlpi_phnum;
-+    uint64_t        dlpi_adds;
-+    uint64_t        dlpi_subs;
-+    size_t          dlpi_tls_modid;
-+    void*           dlpi_tls_data;
-+};
-+
-+
-+private alias extern(C) int function(dl_phdr_info*, size_t, void *) dl_iterate_phdr_cb;
-+private alias extern(C) int function(dl_phdr_info*, size_t, void *) @nogc dl_iterate_phdr_cb_ngc;
-+extern int dl_iterate_phdr(dl_iterate_phdr_cb __callback, void*__data);
-+extern int dl_iterate_phdr(dl_iterate_phdr_cb_ngc __callback, void*__data) @nogc;
-+
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_mman.d b/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_mman.d
deleted file mode 100644
index cc41e2eab0..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_sys_mman.d
+++ /dev/null
@@ -1,153 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/netbsd/sys/mman.d.orig	2016-03-02 01:38:47.249900098 +0000
-+++ runtime/druntime/src/core/sys/netbsd/sys/mman.d
-@@ -0,0 +1,146 @@
-+/**
-+ * D header file for NetBSD
-+ *
-+ * TODO check
-+ * Authors: Martin Nowak
-+ */
-+module core.sys.netbsd.sys.mman;
-+
-+version (NetBSD):
-+extern (C):
-+nothrow:
-+
-+public import core.sys.posix.sys.mman;
-+import core.sys.netbsd.sys.cdefs;
-+import core.sys.posix.sys.types;
-+
-+
-+static if (__BSD_VISIBLE)
-+{
-+    enum INHERIT_SHARE = 0;
-+    enum INHERIT_COPY = 1;
-+    enum INHERIT_NONE = 2;
-+    enum INHERIT_DONATE_COPY = 3;
-+    enum INHERIT_ZERO = 4;
-+}
-+
-+// already in core.sys.posix.sys.mman
-+// enum PROT_NONE = 0x00;
-+// enum PROT_READ = 0x01;
-+// enum PROT_WRITE = 0x02;
-+// enum PROT_EXEC = 0x04;
-+// enum MAP_SHARED = 0x0001;
-+// enum MAP_PRIVATE = 0x0002;
-+static if (__BSD_VISIBLE)
-+    alias MAP_COPY = MAP_PRIVATE;
-+// enum MAP_FIXED = 0x0010;
-+
-+static if (__BSD_VISIBLE)
-+{
-+    enum MAP_RENAME = 0x0020;
-+    enum MAP_NORESERVE = 0x0040;
-+    enum MAP_RESERVED0080 = 0x0080;
-+    enum MAP_RESERVED0100 = 0x0100;
-+    enum MAP_HASSEMAPHORE = 0x0200;
-+    enum MAP_STACK = 0x0400;
-+    enum MAP_NOSYNC = 0x0800;
-+
-+    enum MAP_FILE = 0x0000;
-+
-+    // already in core.sys.posix.sys.mman
-+    // enum MAP_ANON = 0x1000;
-+    //#ifndef _KERNEL
-+    alias MAP_ANONYMOUS = MAP_ANON;
-+    //#endif /* !_KERNEL */
-+
-+    enum MAP_EXCL = 0x00004000;
-+    enum MAP_NOCORE = 0x00020000;
-+    enum MAP_PREFAULT_READ = 0x00040000;
-+    version (LP64)
-+        enum MAP_32BIT = 0x00080000;
-+
-+
-+    extern(D) int MAP_ALIGNED(int n) { return n << MAP_ALIGNMENT_SHIFT; }
-+    enum MAP_ALIGNMENT_SHIFT = 24;
-+    enum MAP_ALIGNMENT_MASK = MAP_ALIGNED(0xff);
-+    enum MAP_ALIGNED_SUPER = MAP_ALIGNED(1);
-+}
-+
-+static if (__POSIX_VISIBLE >= 199309)
-+{
-+    // already in core.sys.posix.sys.mman
-+    // enum MCL_CURRENT = 0x0001;
-+    // enum MCL_FUTURE = 0x0002;
-+}
-+
-+// already in core.sys.posix.sys.mman
-+enum MAP_FAILED = cast(void*)-1;
-+
-+// already in core.sys.posix.sys.mman
-+// enum MS_SYNC = 0x0000;
-+// enum MS_ASYNC = 0x0001;
-+// enum MS_INVALIDATE = 0x0002;
-+
-+enum _MADV_NORMAL = 0;
-+enum _MADV_RANDOM = 1;
-+enum _MADV_SEQUENTIAL = 2;
-+enum _MADV_WILLNEED = 3;
-+enum _MADV_DONTNEED = 4;
-+
-+static if (__BSD_VISIBLE)
-+{
-+    alias MADV_NORMAL = _MADV_NORMAL;
-+    alias MADV_RANDOM = _MADV_RANDOM;
-+    alias MADV_SEQUENTIAL = _MADV_SEQUENTIAL;
-+    alias MADV_WILLNEED = _MADV_WILLNEED;
-+    alias MADV_DONTNEED = _MADV_DONTNEED;
-+    enum MADV_FREE = 5;
-+    enum MADV_NOSYNC = 6;
-+    enum MADV_AUTOSYNC = 7;
-+    enum MADV_NOCORE = 8;
-+    enum MADV_CORE = 9;
-+    enum MADV_PROTECT = 10;
-+
-+    enum MINCORE_INCORE = 0x1;
-+    enum MINCORE_REFERENCED = 0x2;
-+    enum MINCORE_MODIFIED = 0x4;
-+    enum MINCORE_REFERENCED_OTHER = 0x8;
-+    enum MINCORE_MODIFIED_OTHER = 0x10;
-+    enum MINCORE_SUPER = 0x20;
-+
-+    enum SHM_ANON = cast(const(char) *)1;
-+}
-+
-+static if (__POSIX_VISIBLE >= 200112)
-+{
-+    // already in core.sys.posix.sys.mman
-+    // alias POSIX_MADV_NORMAL = _MADV_NORMAL;
-+    // alias POSIX_MADV_RANDOM = _MADV_RANDOM;
-+    // alias POSIX_MADV_SEQUENTIAL = _MADV_SEQUENTIAL;
-+    // alias POSIX_MADV_WILLNEED = _MADV_WILLNEED;
-+    // alias POSIX_MADV_DONTNEED = _MADV_DONTNEED;
-+}
-+
-+static if (__BSD_VISIBLE)
-+{
-+    int getpagesizes(size_t *, int);
-+    int madvise(void *, size_t, int);
-+    int mincore(const(void) *, size_t, char *);
-+    int minherit(void *, size_t, int);
-+}
-+// already in core.sys.posix.sys.mman
-+// int mlock(const void *, size_t);
-+// void *  mmap(void *, size_t, int, int, int, off_t);
-+// int mprotect(const void *, size_t, int);
-+// int msync(void *, size_t, int);
-+// int munlock(const void *, size_t);
-+// int munmap(void *, size_t);
-+static if (__POSIX_VISIBLE >= 200112)
-+    // int posix_madvise(void *, size_t, int);
-+static if (__POSIX_VISIBLE >= 199309)
-+{
-+    // int mlockall(int);
-+    // int munlockall();
-+    // int shm_open(const(char) *, int, mode_t);
-+    // int shm_unlink(const(char) *);
-+}
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_time.d b/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_time.d
deleted file mode 100644
index 369fde41cd..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_netbsd_time.d
+++ /dev/null
@@ -1,26 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/netbsd/time.d.orig	2016-03-02 01:38:47.251518739 +0000
-+++ runtime/druntime/src/core/sys/netbsd/time.d
-@@ -0,0 +1,19 @@
-+//Written in the D programming language
-+
-+/++
-+    D header file for NetBSD's extensions to POSIX's time.h.
-+
-+    Copyright: Copyright 2014
-+    License:   $(WEB www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
-+    Authors:   Jonathan M Davis
-+ +/
-+module core.sys.netbsd.time;
-+
-+public import core.sys.posix.time;
-+
-+version(NetBSD):
-+
-+enum CLOCK_REALTIME          = 0;
-+enum CLOCK_VIRTUAL           = 1;
-+enum CLOCK_PROF              = 2;
-+enum CLOCK_MONOTONIC         = 3;
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_arpa_inet.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_arpa_inet.d
index 98dc4f4f7a..15844c4c96 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_arpa_inet.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_arpa_inet.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/arpa/inet.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/arpa/inet.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/arpa/inet.d
-@@ -124,6 +124,32 @@ else version( FreeBSD )
+@@ -173,6 +173,32 @@ else version( Solaris )
      const(char)*    inet_ntop(int, in void*, char*, socklen_t);
      int             inet_pton(int, in char*, void*);
  }
@@ -37,11 +37,11 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version( Solaris )
  {
      alias uint16_t in_port_t;
-@@ -235,6 +261,10 @@ else version( FreeBSD )
+@@ -264,6 +290,10 @@ else version( DragonFlyBSD )
  {
      enum INET6_ADDRSTRLEN = 46;
  }
-+else version( NetBSD )
++else version ( NetBSD ) 
 +{
 +    enum INET6_ADDRSTRLEN = 46;
 +}
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_dirent.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_dirent.d
index ce326baf84..882acd4441 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_dirent.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_dirent.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/dirent.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/dirent.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/dirent.d
-@@ -142,6 +142,36 @@ else version( FreeBSD )
+@@ -172,6 +172,36 @@ else version( DragonFlyBSD )
  
      dirent* readdir(DIR*);
  }
@@ -41,7 +41,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      struct dirent
-@@ -205,11 +235,20 @@ else
+@@ -243,11 +273,20 @@ else
      static assert(false, "Unsupported platform");
  }
  
@@ -63,7 +63,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  //
  // Thread-Safe Functions (TSF)
  //
-@@ -237,6 +276,12 @@ else version( FreeBSD )
+@@ -279,6 +318,12 @@ else version( DragonFlyBSD )
  {
      int readdir_r(DIR*, dirent*, dirent**);
  }
@@ -76,15 +76,15 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      static if (__USE_LARGEFILE64)
-@@ -276,6 +321,11 @@ else version( FreeBSD )
+@@ -322,6 +367,11 @@ else version( DragonFlyBSD )
+ {
      void   seekdir(DIR*, c_long);
      c_long telldir(DIR*);
- }
++}
 +else version( NetBSD )
 +{
 +    void   seekdir(DIR*, c_long);
 +    c_long telldir(DIR*);
-+}
+ }
  else version (OSX)
  {
- }
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_fcntl.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_fcntl.d
index 1e513a8e6b..898f985f49 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_fcntl.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_fcntl.d
@@ -2,11 +2,11 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/fcntl.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/fcntl.d.orig	2020-05-07 08:52:15.234684078 +0000
 +++ runtime/druntime/src/core/sys/posix/fcntl.d
-@@ -367,6 +367,59 @@ else version( FreeBSD )
-     int creat(in char*, mode_t);
-     int open(in char*, int, ...);
+@@ -462,6 +462,59 @@ else version( DragonFlyBSD )
+     //int fcntl(int, int, ...);  /*defined below*/
+     //int flock(int, int);
  }
 +else version( NetBSD )
 +{
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_grp.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_grp.d
index cc6b68e528..fcac08bc63 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_grp.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_grp.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/grp.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/grp.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/grp.d
-@@ -68,6 +68,16 @@ else version( FreeBSD )
+@@ -78,6 +78,16 @@ else version( DragonFlyBSD )
          char**  gr_mem;
      }
  }
@@ -21,7 +21,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version( Solaris )
  {
      struct group
-@@ -119,6 +129,11 @@ else version( FreeBSD )
+@@ -134,6 +144,11 @@ else version( DragonFlyBSD )
      int getgrnam_r(in char*, group*, char*, size_t, group**);
      int getgrgid_r(gid_t, group*, char*, size_t, group**);
  }
@@ -33,16 +33,16 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version( Solaris )
  {
      int getgrnam_r(in char*, group*, char*, int, group**);
-@@ -159,6 +174,12 @@ else version( FreeBSD )
+@@ -178,6 +193,12 @@ else version( DragonFlyBSD )
+ {
+     group* getgrent();
      @trusted void endgrent();
-     @trusted void setgrent();
- }
++    @trusted void setgrent();
++}
 +else version( NetBSD )
 +{
 +    group* getgrent();
 +    @trusted void endgrent();
-+    @trusted void setgrent();
-+}
+     @trusted void setgrent();
+ }
  else version( Solaris )
- {
-     group* getgrent();
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_netdb.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_netdb.d
index 95b7a81b70..01ef523408 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_netdb.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_netdb.d
@@ -2,11 +2,11 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/netdb.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/netdb.d.orig	2020-05-07 08:52:15.364683708 +0000
 +++ runtime/druntime/src/core/sys/posix/netdb.d
-@@ -387,6 +387,113 @@ else version( FreeBSD )
-     enum EAI_SYSTEM         = 11;
-     enum EAI_OVERFLOW       = 14;
+@@ -488,6 +488,112 @@ else version( DragonFlyBSD )
+     enum NI_NUMERICSCOPE    = 0x40;
+ 
  }
 +else version( NetBSD )
 +{
@@ -36,7 +36,6 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 +    (defined(__sh__) && defined(_LP64) && (_BYTE_ORDER == _LITTLE_ENDIAN))
 +        int             __n_pad0;       /* ABI compatibility */
 +#endif
-+
 ++/
 +    }
 +
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_netinet_in__.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_netinet_in__.d
index 3cc2a10906..7df6287e43 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_netinet_in__.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_netinet_in__.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/netinet/in_.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/netinet/in_.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/netinet/in_.d
-@@ -202,6 +202,42 @@ else version( FreeBSD )
+@@ -245,6 +245,42 @@ else version( DragonFlyBSD )
  
      //enum INET_ADDRSTRLEN       = 16;
  }
@@ -47,7 +47,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version( Solaris )
  {
      struct sockaddr_in
-@@ -712,6 +748,145 @@ else version( FreeBSD )
+@@ -895,6 +931,145 @@ else version( DragonFlyBSD )
                 __IPV6_ADDR_MC_SCOPE(a) == __IPV6_ADDR_SCOPE_GLOBAL;
      }
  }
@@ -193,11 +193,11 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version( Solaris )
  {
      struct in6_addr
-@@ -988,6 +1163,10 @@ else version( FreeBSD )
+@@ -1175,6 +1350,10 @@ else version( DragonFlyBSD )
  {
      enum uint IPPROTO_RAW = 255;
  }
-+else version( NetBSD )
++else version ( NetBSD )
 +{
 +    enum uint IPPROTO_RAW = 255;
 +}
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_poll.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_poll.d
index 9c8b8fe7c9..1c262fa1b4 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_poll.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_poll.d
@@ -1,10 +1,8 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/posix/poll.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/poll.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/poll.d
-@@ -143,6 +143,41 @@ else version( FreeBSD )
+@@ -177,6 +177,41 @@ else version( DragonFlyBSD )
  
      int poll(pollfd*, nfds_t, int);
  }
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_pthread.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_pthread.d
index 36b5c68666..3712a991ec 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_pthread.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_pthread.d
@@ -1,10 +1,8 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/posix/pthread.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/pthread.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/pthread.d
-@@ -209,6 +209,85 @@ else version( FreeBSD )
+@@ -249,6 +249,85 @@ else version( DragonFlyBSD )
      enum PTHREAD_COND_INITIALIZER               = null;
      enum PTHREAD_RWLOCK_INITIALIZER             = null;
  }
@@ -90,41 +88,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      enum
-@@ -362,6 +441,33 @@ else version( FreeBSD )
-     void __pthread_cleanup_push_imp(_pthread_cleanup_routine, void*, _pthread_cleanup_info*);
-     void __pthread_cleanup_pop_imp(int);
- }
-+else version( NetBSD )
-+{
-+    alias void function(void*) _pthread_cleanup_routine;
-+
-+    struct _pthread_cleanup_store
-+    {
-+        void*[4]    pthread_cleanup_pad;
-+    }
-+
-+    struct pthread_cleanup
-+    {
-+        _pthread_cleanup_store __cleanup_info__ = void;
-+
-+        extern (D) void push()( _pthread_cleanup_routine cleanup_routine, void* cleanup_arg )
-+        {
-+            pthread__cleanup_push( cleanup_routine, cleanup_arg, &__cleanup_info__ );
-+        }
-+
-+        extern (D) void pop()( int execute )
-+        {
-+            pthread__cleanup_pop( execute, &__cleanup_info__ );
-+        }
-+    }
-+
-+    void pthread__cleanup_push(_pthread_cleanup_routine, void*, void*);
-+    void pthread__cleanup_pop(int, void *);
-+}
- else version (Solaris)
- {
-     alias void function(void*) _pthread_cleanup_routine;
-@@ -507,6 +613,18 @@ else version( FreeBSD )
+@@ -589,6 +668,18 @@ else version( DragonFlyBSD )
      int pthread_barrierattr_init(pthread_barrierattr_t*);
      int pthread_barrierattr_setpshared(pthread_barrierattr_t*, int);
  }
@@ -143,7 +107,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (OSX)
  {
  }
-@@ -565,6 +683,14 @@ else version( FreeBSD )
+@@ -655,6 +746,14 @@ else version( DragonFlyBSD )
      int pthread_spin_trylock(pthread_spinlock_t*);
      int pthread_spin_unlock(pthread_spinlock_t*);
  }
@@ -158,7 +122,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (OSX)
  {
  }
-@@ -648,6 +774,24 @@ else version( FreeBSD )
+@@ -756,6 +855,24 @@ else version( DragonFlyBSD )
      int pthread_mutexattr_settype(pthread_mutexattr_t*, int) @trusted;
      int pthread_setconcurrency(int);
  }
@@ -183,7 +147,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      enum
-@@ -698,6 +842,10 @@ else version( FreeBSD )
+@@ -810,6 +927,10 @@ else version( DragonFlyBSD )
  {
      int pthread_getcpuclockid(pthread_t, clockid_t*);
  }
@@ -194,7 +158,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (OSX)
  {
  }
-@@ -740,6 +888,12 @@ else version( FreeBSD )
+@@ -858,6 +979,12 @@ else version( DragonFlyBSD )
      int pthread_rwlock_timedrdlock(pthread_rwlock_t*, in timespec*);
      int pthread_rwlock_timedwrlock(pthread_rwlock_t*, in timespec*);
  }
@@ -207,32 +171,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      int pthread_mutex_timedlock(pthread_mutex_t*, in timespec*);
-@@ -876,6 +1030,24 @@ else version( FreeBSD )
-     int pthread_setschedparam(pthread_t, int, sched_param*);
-     // int pthread_setschedprio(pthread_t, int); // not implemented
- }
-+else version( NetBSD )
-+{
-+    enum
-+    {
-+        PTHREAD_SCOPE_PROCESS   = 0,
-+        PTHREAD_SCOPE_SYSTEM    = 0x1
-+    }
-+
-+    int pthread_attr_getinheritsched(in pthread_attr_t*, int*);
-+    int pthread_attr_getschedpolicy(in pthread_attr_t*, int*);
-+    int pthread_attr_getscope(in pthread_attr_t*, int*);
-+    int pthread_attr_setinheritsched(pthread_attr_t*, int);
-+    int pthread_attr_setschedpolicy(pthread_attr_t*, int);
-+    int pthread_attr_setscope(in pthread_attr_t*, int);
-+    int pthread_getschedparam(pthread_t, int*, sched_param*);
-+    int pthread_setschedparam(pthread_t, int, sched_param*);
-+    //int pthread_setschedprio(pthread_t, int);
-+}
- else version (Solaris)
- {
-     enum
-@@ -953,6 +1125,15 @@ else version( FreeBSD )
+@@ -1097,6 +1224,15 @@ else version( DragonFlyBSD )
      int pthread_attr_setstackaddr(pthread_attr_t*, void*);
      int pthread_attr_setstacksize(pthread_attr_t*, size_t);
  }
@@ -248,19 +187,19 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      int pthread_attr_getstack(in pthread_attr_t*, void**, size_t*);
-@@ -1006,6 +1187,15 @@ else version( FreeBSD )
-     int pthread_rwlockattr_getpshared(in pthread_rwlockattr_t*, int*);
-     int pthread_rwlockattr_setpshared(pthread_rwlockattr_t*, int);
- }
-+else version( NetBSD )
-+{
-+    int pthread_condattr_getpshared(in pthread_condattr_t*, int*);
-+    int pthread_condattr_setpshared(pthread_condattr_t*, int);
+@@ -1154,6 +1290,15 @@ else version( DragonFlyBSD )
+ {
+     int pthread_condattr_getpshared(in pthread_condattr_t*, int*);
+     int pthread_condattr_setpshared(pthread_condattr_t*, int);
 +    int pthread_mutexattr_getpshared(in pthread_mutexattr_t*, int*);
 +    int pthread_mutexattr_setpshared(pthread_mutexattr_t*, int);
 +    int pthread_rwlockattr_getpshared(in pthread_rwlockattr_t*, int*);
 +    int pthread_rwlockattr_setpshared(pthread_rwlockattr_t*, int);
 +}
- else version( OSX )
- {
-     int pthread_condattr_getpshared(in pthread_condattr_t*, int*);
++else version( NetBSD )
++{
++    int pthread_condattr_getpshared(in pthread_condattr_t*, int*);
++    int pthread_condattr_setpshared(pthread_condattr_t*, int);
+     int pthread_mutexattr_getpshared(in pthread_mutexattr_t*, int*);
+     int pthread_mutexattr_setpshared(pthread_mutexattr_t*, int);
+     int pthread_rwlockattr_getpshared(in pthread_rwlockattr_t*, int*);
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_pwd.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_pwd.d
index dcab789241..ed8890f43a 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_pwd.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_pwd.d
@@ -2,10 +2,10 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/pwd.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/pwd.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/pwd.d
-@@ -85,6 +85,22 @@ else version( FreeBSD )
-         int pw_fields;      /* internal: fields filled in */
+@@ -102,6 +102,22 @@ else version( DragonFlyBSD )
+         int pw_fields;          /* internal: fields filled in */
      }
  }
 +else version( NetBSD )
@@ -27,7 +27,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      struct passwd
-@@ -143,6 +159,13 @@ else version( FreeBSD )
+@@ -165,6 +181,13 @@ else version( DragonFlyBSD )
      int getpwnam_r(in char*, passwd*, char*, size_t, passwd**);
      int getpwuid_r(uid_t, passwd*, char*, size_t, passwd**);
  }
@@ -41,16 +41,16 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      int getpwnam_r(in char*, passwd*, char*, size_t, passwd**);
-@@ -183,6 +206,12 @@ else version ( FreeBSD )
+@@ -209,6 +232,12 @@ else version ( DragonFlyBSD )
+ {
+     void    endpwent();
      passwd* getpwent();
-     void    setpwent();
- }
++    void    setpwent();
++}
 +else version ( NetBSD )
 +{
 +    void    endpwent();
 +    passwd* getpwent();
-+    void    setpwent();
-+}
+     void    setpwent();
+ }
  else version (Solaris)
- {
-     void endpwent();
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sched.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sched.d
index fdd21fec3d..8ecfb0a97a 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sched.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sched.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/sched.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/sched.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/sched.d
-@@ -86,6 +86,17 @@ else version( FreeBSD )
+@@ -97,6 +97,17 @@ else version( DragonFlyBSD )
      enum SCHED_OTHER    = 2;
      enum SCHED_RR       = 3;
  }
@@ -22,7 +22,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      struct sched_param
-@@ -144,6 +155,10 @@ else version( FreeBSD )
+@@ -159,6 +170,10 @@ else version( DragonFlyBSD )
  {
      int sched_yield();
  }
@@ -33,16 +33,16 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      int sched_yield();
-@@ -184,6 +199,12 @@ else version( FreeBSD )
+@@ -203,6 +218,12 @@ else version( DragonFlyBSD )
+ {
+     int sched_get_priority_min(int);
      int sched_get_priority_max(int);
-     int sched_rr_get_interval(pid_t, timespec*);
- }
++    int sched_rr_get_interval(pid_t, timespec*);
++}
 +else version( NetBSD )
 +{
 +    int sched_get_priority_min(int);
 +    int sched_get_priority_max(int);
-+    int sched_rr_get_interval(pid_t, timespec*);
-+}
+     int sched_rr_get_interval(pid_t, timespec*);
+ }
  else version (Solaris)
- {
-     int sched_get_priority_max(int);
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_semaphore.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_semaphore.d
index fa1b5410fd..5fc858dbba 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_semaphore.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_semaphore.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/semaphore.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/semaphore.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/semaphore.d
-@@ -81,6 +81,12 @@ else version( FreeBSD )
+@@ -96,6 +96,12 @@ else version( DragonFlyBSD )
  
      enum SEM_FAILED = cast(sem_t*) null;
  }
@@ -17,11 +17,11 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      struct sem_t
-@@ -137,6 +143,10 @@ else version( FreeBSD )
+@@ -156,6 +162,10 @@ else version( DragonFlyBSD )
  {
      int sem_timedwait(sem_t*, in timespec*);
  }
-+else version( NetBSD )
++else version ( NetBSD )
 +{
 +    int sem_timedwait(sem_t*, in timespec*);
 +}
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_setjmp.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_setjmp.d
index 72bd5679c1..e55743a5b1 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_setjmp.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_setjmp.d
@@ -1,10 +1,8 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/posix/setjmp.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/setjmp.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/setjmp.d
-@@ -170,6 +170,26 @@ else version( FreeBSD )
+@@ -185,6 +185,26 @@ else version( DragonFlyBSD )
      int  setjmp(ref jmp_buf);
      void longjmp(ref jmp_buf, int);
  }
@@ -31,10 +29,11 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version( CRuntime_Bionic )
  {
      // <machine/setjmp.h>
-@@ -238,6 +258,24 @@ else version( FreeBSD )
+@@ -270,6 +290,24 @@ else version( DragonFlyBSD )
+ 
      int  sigsetjmp(ref sigjmp_buf);
      void siglongjmp(ref sigjmp_buf, int);
- }
++}
 +else version( NetBSD )
 +{
 +    // <machine/setjmp.h>
@@ -52,20 +51,6 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 +
 +    int  sigsetjmp(ref sigjmp_buf);
 +    void siglongjmp(ref sigjmp_buf, int);
-+}
- else version( CRuntime_Bionic )
- {
-     alias c_long[_JBLEN + 1] sigjmp_buf;
-@@ -264,6 +302,12 @@ else version( FreeBSD )
-     int  _setjmp(ref jmp_buf);
-     void _longjmp(ref jmp_buf, int);
  }
-+else version( NetBSD )
-+{
-+    int  _setjmp(ref jmp_buf);
-+    void _longjmp(ref jmp_buf, int);
-+}
-+
  else version( CRuntime_Bionic )
  {
-     int  _setjmp(ref jmp_buf);
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_signal.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_signal.d
index 79acb75892..1dff30814c 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_signal.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_signal.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/signal.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/signal.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/signal.d
-@@ -395,6 +395,31 @@ else version( FreeBSD )
+@@ -423,6 +423,31 @@ else version( DragonFlyBSD )
      enum SIGUSR2    = 31;
      enum SIGURG     = 16;
  }
@@ -36,7 +36,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      enum SIGALRM = 14;
-@@ -453,6 +478,19 @@ else version( FreeBSD )
+@@ -494,6 +519,19 @@ else version( DragonFlyBSD )
          sigset_t sa_mask;
      }
  }
@@ -56,7 +56,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      struct sigaction_t
-@@ -855,6 +893,100 @@ else version( FreeBSD )
+@@ -960,6 +998,100 @@ else version( DragonFlyBSD )
      int sigsuspend(in sigset_t *);
      int sigwait(in sigset_t*, int*);
  }
@@ -157,7 +157,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      enum SIG_HOLD = cast(sigfn_t2)2;
-@@ -1626,6 +1758,130 @@ else version( FreeBSD )
+@@ -1860,6 +1992,130 @@ else version( DragonFlyBSD )
      int sigpause(int);
      int sigrelse(int);
  }
@@ -288,7 +288,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      enum SIGPOLL = 22;
-@@ -1929,6 +2185,14 @@ else version( FreeBSD )
+@@ -2199,6 +2455,14 @@ else version( DragonFlyBSD )
          c_long  tv_nsec;
      }
  }
@@ -303,7 +303,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      struct timespec
-@@ -2024,6 +2288,21 @@ else version( FreeBSD )
+@@ -2321,6 +2585,21 @@ else version( DragonFlyBSD )
      int sigtimedwait(in sigset_t*, siginfo_t*, in timespec*);
      int sigwaitinfo(in sigset_t*, siginfo_t*);
  }
@@ -325,15 +325,15 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (OSX)
  {
  }
-@@ -2097,6 +2376,11 @@ else version( FreeBSD )
+@@ -2398,6 +2677,11 @@ else version( DragonFlyBSD )
+ {
      int pthread_kill(pthread_t, int);
      int pthread_sigmask(int, in sigset_t*, sigset_t*);
- }
++}
 +else version( NetBSD )
 +{
 +    int pthread_kill(pthread_t, int);
 +    int pthread_sigmask(int, in sigset_t*, sigset_t*);
-+}
+ }
  else version (Solaris)
  {
-     int pthread_kill(pthread_t, int);
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_stdlib.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_stdlib.d
index c192478146..0e44b80a45 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_stdlib.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_stdlib.d
@@ -1,10 +1,8 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/posix/stdlib.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/stdlib.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/stdlib.d
-@@ -91,6 +91,10 @@ else version( FreeBSD )
+@@ -95,6 +95,10 @@ else version( DragonFlyBSD )
  {
      int posix_memalign(void**, size_t, size_t);
  }
@@ -15,21 +13,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version( Solaris )
  {
      int posix_memalign(void**, size_t, size_t);
-@@ -125,6 +129,13 @@ else version( FreeBSD )
- 
-     void* valloc(size_t); // LEGACY non-standard
- }
-+else version( NetBSD )
-+{
-+    int setenv(in char*, in char*, int);
-+    int __unsetenv13(in char*);
-+    alias __unsetenv13 unsetenv;
-+    void* valloc(size_t); // LEGACY non-standard
-+}
- else version( Android )
- {
-     int setenv(in char*, in char*, int);
-@@ -159,6 +170,10 @@ else version( FreeBSD )
+@@ -174,6 +178,10 @@ else version( DragonFlyBSD )
  {
      int rand_r(uint*);
  }
@@ -40,14 +24,10 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version( Solaris )
  {
      int rand_r(uint*);
-@@ -342,6 +357,47 @@ else version( FreeBSD )
-     void   srandom(uint);
-     int    unlockpt(int);
- }
-+else version( NetBSD )
-+{
-+    //WNOHANG     (defined in core.sys.posix.sys.wait)
-+    //WUNTRACED   (defined in core.sys.posix.sys.wait)
+@@ -361,6 +369,47 @@ else version( DragonFlyBSD )
+ {
+     //WNOHANG     (defined in core.sys.posix.sys.wait)
+     //WUNTRACED   (defined in core.sys.posix.sys.wait)
 +    //WEXITSTATUS (defined in core.sys.posix.sys.wait)
 +    //WIFEXITED   (defined in core.sys.posix.sys.wait)
 +    //WIFSIGNALED (defined in core.sys.posix.sys.wait)
@@ -85,6 +65,10 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 +    void   srandom(uint);
 +    int    unlockpt(int);
 +}
- else version( CRuntime_Bionic )
- {
-     double  drand48();
++else version( NetBSD )
++{
++    //WNOHANG     (defined in core.sys.posix.sys.wait)
++    //WUNTRACED   (defined in core.sys.posix.sys.wait)
+     //WEXITSTATUS (defined in core.sys.posix.sys.wait)
+     //WIFEXITED   (defined in core.sys.posix.sys.wait)
+     //WIFSIGNALED (defined in core.sys.posix.sys.wait)
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_mman.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_mman.d
index f2fc71a4c8..e5dcbda13d 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_mman.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_mman.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/sys/mman.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/sys/mman.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/sys/mman.d
-@@ -76,6 +76,16 @@ else version( FreeBSD )
+@@ -85,6 +85,16 @@ else version( DragonFlyBSD )
      enum POSIX_MADV_DONTNEED    = 4;
      int posix_madvise(void *addr, size_t len, int advice);
  }
@@ -21,7 +21,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
  }
-@@ -118,6 +128,13 @@ else version( FreeBSD )
+@@ -134,6 +144,13 @@ else version( DragonFlyBSD )
      enum PROT_WRITE     = 0x02;
      enum PROT_EXEC      = 0x04;
  }
@@ -35,7 +35,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      enum PROT_NONE = 0x00;
-@@ -164,6 +181,11 @@ else version( FreeBSD )
+@@ -185,6 +202,11 @@ else version( DragonFlyBSD )
      void* mmap(void*, size_t, int, int, int, off_t);
      int   munmap(void*, size_t);
  }
@@ -47,7 +47,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      void* mmap(void*, size_t, int, int, int, off_t);
-@@ -318,6 +340,21 @@ else version( FreeBSD )
+@@ -354,6 +376,21 @@ else version( DragonFlyBSD )
  
      int msync(void*, size_t, int);
  }
@@ -69,7 +69,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      enum MAP_SHARED = 0x0001;
-@@ -429,6 +466,14 @@ else version( FreeBSD )
+@@ -477,6 +514,14 @@ else version( DragonFlyBSD )
      int mlockall(int);
      int munlockall();
  }
@@ -84,7 +84,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      enum MCL_CURRENT = 0x0001;
-@@ -473,6 +518,11 @@ else version( FreeBSD )
+@@ -526,6 +571,11 @@ else version( DragonFlyBSD )
      int mlock(in void*, size_t);
      int munlock(in void*, size_t);
  }
@@ -96,7 +96,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      int mlock(in void*, size_t);
-@@ -507,6 +557,10 @@ else version( FreeBSD )
+@@ -564,6 +614,10 @@ else version( DragonFlyBSD )
  {
      int mprotect(void*, size_t, int);
  }
@@ -107,15 +107,15 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      int mprotect(void*, size_t, int);
-@@ -543,6 +597,11 @@ else version( FreeBSD )
+@@ -604,6 +658,11 @@ else version( DragonFlyBSD )
+ {
      int shm_open(in char*, int, mode_t);
      int shm_unlink(in char*);
- }
++}
 +else version( NetBSD )
 +{
 +    int shm_open(in char*, int, mode_t);
 +    int shm_unlink(in char*);
-+}
+ }
  else version (Solaris)
  {
-     int shm_open(in char*, int, mode_t);
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_resource.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_resource.d
index 76f22938f4..3e10623004 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_resource.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_resource.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/sys/resource.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/sys/resource.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/sys/resource.d
-@@ -234,6 +234,64 @@ else version (FreeBSD)
+@@ -292,6 +292,64 @@ else version (DragonFlyBSD)
          RLIMIT_AS     = 10,
      }
  }
@@ -69,16 +69,16 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      enum
-@@ -406,6 +464,12 @@ else version (FreeBSD)
+@@ -473,6 +531,12 @@ else version (DragonFlyBSD)
+ {
+     int getrlimit(int, rlimit*);
      int getrusage(int, rusage*);
-     int setrlimit(int, in rlimit*);
- }
++    int setrlimit(int, in rlimit*);
++}
 +else version (NetBSD)
 +{
 +    int getrlimit(int, rlimit*);
 +    int getrusage(int, rusage*);
-+    int setrlimit(int, in rlimit*);
-+}
+     int setrlimit(int, in rlimit*);
+ }
  else version (Solaris)
- {
-     int getrlimit(int, rlimit*);
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_socket.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_socket.d
index 99c29f6636..9cd98b5ba8 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_socket.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_socket.d
@@ -2,11 +2,11 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/sys/socket.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/sys/socket.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/sys/socket.d
-@@ -927,6 +927,205 @@ else version( FreeBSD )
-     int     sockatmark(int);
+@@ -1230,6 +1230,205 @@ else version( DragonFlyBSD )
      int     socketpair(int, int, int, ref int[2]);
+ //  void    pfctlinput(int, struct sockaddr *);
  }
 +else version( NetBSD )
 +{
@@ -210,7 +210,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      alias uint socklen_t;
-@@ -1311,6 +1510,13 @@ else version( FreeBSD )
+@@ -1657,6 +1856,13 @@ else version( DragonFlyBSD )
          AF_INET6    = 28
      }
  }
@@ -224,17 +224,17 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      enum
-@@ -1358,6 +1564,13 @@ else version( FreeBSD )
-         SOCK_RAW    = 3
-     }
- }
+@@ -1708,6 +1914,13 @@ else version( DragonFlyBSD )
+ {
+     enum
+     {
++        SOCK_RAW    = 3
++    }
++}
 +else version( NetBSD )
 +{
 +    enum
 +    {
-+        SOCK_RAW    = 3
-+    }
-+}
- else version (Solaris)
- {
-     enum
+         SOCK_RAW    = 3
+     }
+ }
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_stat.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_stat.d
index 5947b7603b..a7e47946c4 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_stat.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_stat.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/sys/stat.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/sys/stat.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/sys/stat.d
-@@ -777,6 +777,70 @@ else version( FreeBSD )
+@@ -839,6 +839,70 @@ else version( DragonFlyBSD )
      extern (D) bool S_ISLNK( mode_t mode )  { return S_ISTYPE( mode, S_IFLNK );  }
      extern (D) bool S_ISSOCK( mode_t mode ) { return S_ISTYPE( mode, S_IFSOCK ); }
  }
@@ -75,7 +75,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      private enum _ST_FSTYPSZ = 16;
-@@ -1105,6 +1169,15 @@ else version( FreeBSD )
+@@ -1200,6 +1264,15 @@ else version( DragonFlyBSD )
      int   lstat(in char*, stat_t*);
      int   stat(in char*, stat_t*);
  }
@@ -91,14 +91,10 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version( CRuntime_Bionic )
  {
      int   fstat(int, stat_t*) @trusted;
-@@ -1174,6 +1247,19 @@ else version( FreeBSD )
- 
-     int mknod(in char*, mode_t, dev_t);
- }
-+else version( NetBSD )
-+{
-+    enum S_IFMT     = 0xF000; // octal 0170000
-+    enum S_IFBLK    = 0x6000; // octal 0060000
+@@ -1273,6 +1346,19 @@ else version( DragonFlyBSD )
+ {
+     enum S_IFMT     = 0xF000; // octal 0170000
+     enum S_IFBLK    = 0x6000; // octal 0060000
 +    enum S_IFCHR    = 0x2000; // octal 0020000
 +    enum S_IFIFO    = 0x1000; // octal 0010000
 +    enum S_IFREG    = 0x8000; // octal 0100000
@@ -108,6 +104,10 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 +
 +    int mknod(in char*, mode_t, dev_t);
 +}
- else version (Solaris)
- {
-     enum S_IFMT = 0xF000;
++else version( NetBSD )
++{
++    enum S_IFMT     = 0xF000; // octal 0170000
++    enum S_IFBLK    = 0x6000; // octal 0060000
+     enum S_IFCHR    = 0x2000; // octal 0020000
+     enum S_IFIFO    = 0x1000; // octal 0010000
+     enum S_IFREG    = 0x8000; // octal 0100000
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_time.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_time.d
index aed3386169..39b1d13008 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_time.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_time.d
@@ -1,10 +1,8 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/posix/sys/time.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/sys/time.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/sys/time.d
-@@ -123,6 +123,27 @@ else version( FreeBSD )
+@@ -149,6 +149,27 @@ else version( DragonFlyBSD )
      int setitimer(int, in itimerval*, itimerval*);
      int utimes(in char*, ref const(timeval)[2]);
  }
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_types.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_types.d
deleted file mode 100644
index 218e8fe19f..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_types.d
+++ /dev/null
@@ -1,102 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/posix/sys/types.d.orig	2016-02-13 20:02:16.000000000 +0000
-+++ runtime/druntime/src/core/sys/posix/sys/types.d
-@@ -138,6 +138,23 @@ else version( FreeBSD )
-     alias uint      uid_t;
-     alias uint      fflags_t;
- }
-+else version( NetBSD )
-+{
-+    alias long      blkcnt_t;
-+    alias int       blksize_t;
-+    alias ulong     dev_t;
-+    alias uint      gid_t;
-+    alias ulong     ino_t;
-+    alias uint      mode_t;
-+    alias uint      nlink_t;
-+    alias ulong     off_t;
-+    alias int       pid_t;
-+    //size_t (defined in core.stdc.stddef)
-+    alias c_long      ssize_t;
-+    alias c_long      time_t;
-+    alias uint        uid_t;
-+
-+}
- else version (Solaris)
- {
-     alias char* caddr_t;
-@@ -269,6 +286,16 @@ else version( FreeBSD )
-     alias c_long    suseconds_t;
-     alias uint      useconds_t;
- }
-+else version( NetBSD )
-+{
-+    alias ulong     fsblkcnt_t;
-+    alias ulong     fsfilcnt_t;
-+    alias c_long    clock_t;
-+    alias long      id_t;
-+    alias c_long    key_t;
-+    alias c_long    suseconds_t;
-+    alias uint      useconds_t;
-+}
- else version (Solaris)
- {
-     static if (__USE_FILE_OFFSET64)
-@@ -645,6 +672,31 @@ else version( FreeBSD )
-     alias void* pthread_rwlockattr_t;
-     alias void* pthread_t;
- }
-+else version( NetBSD )
-+{
-+    alias int lwpid_t;
-+
-+    struct pthread_attr_t_ {ubyte[16] a;};
-+    struct pthread_cond_t_ {ubyte[40] a;};
-+    struct pthread_condattr_t_ {ubyte[16] a;};
-+    struct pthread_mutex_t_ {ubyte[48] a;};
-+    struct pthread_mutexattr_t_{ubyte[16] a;};
-+    struct pthread_once_t_{ubyte[56] a;};
-+    struct pthread_rwlock_t_{ubyte[64] a;};
-+    struct pthread_rwlockattr_t_{ubyte[16] a;};
-+
-+    alias pthread_attr_t_ pthread_attr_t;
-+    alias pthread_cond_t_ pthread_cond_t;
-+    alias pthread_condattr_t_ pthread_condattr_t;
-+    alias uint pthread_key_t;
-+    alias pthread_mutex_t_ pthread_mutex_t;
-+    alias pthread_mutexattr_t_ pthread_mutexattr_t;
-+    alias pthread_once_t_ pthread_once_t;
-+    alias pthread_rwlock_t_ pthread_rwlock_t;
-+    alias pthread_rwlockattr_t_ pthread_rwlockattr_t;
-+
-+    alias void* pthread_t;
-+}
- else version (Solaris)
- {
-     alias uint pthread_t;
-@@ -809,6 +861,11 @@ else version( FreeBSD )
-     alias void* pthread_barrier_t;
-     alias void* pthread_barrierattr_t;
- }
-+else version( NetBSD )
-+{
-+    alias void* pthread_barrier_t;
-+    alias void* pthread_barrierattr_t;
-+}
- else version( OSX )
- {
- }
-@@ -852,6 +909,10 @@ else version( FreeBSD )
- {
-     alias void* pthread_spinlock_t;
- }
-+else version( NetBSD )
-+{
-+    alias void* pthread_spinlock_t;
-+}
- else version (Solaris)
- {
-     alias pthread_mutex_t pthread_spinlock_t;
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_wait.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_wait.d
index 98124323b0..d0534b2a26 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_wait.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_sys_wait.d
@@ -2,46 +2,16 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/sys/wait.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/sys/wait.d.orig	2020-05-07 08:52:17.154678602 +0000
 +++ runtime/druntime/src/core/sys/posix/sys/wait.d
-@@ -113,6 +113,28 @@ else version( FreeBSD )
-     extern (D) int  WSTOPSIG( int status )     { return status >> 8;                     }
-     extern (D) int  WTERMSIG( int status )     { return _WSTATUS( status );              }
- }
-+else version( NetBSD )
-+{
-+    enum WNOHANG        = 1;
-+    enum WUNTRACED      = 2;
-+
-+    private
-+    {
-+        enum _WSTOPPED = 0x7F; // octal 0177
-+    }
-+
-+    extern (D) int _WSTATUS(int status)         { return (status & 0x7F);           }
-+    extern (D) int  WEXITSTATUS( int status )   { return (status >> 8);             }
-+    extern (D) int  WIFCONTINUED( int status )  { return status == 0x13;            }
-+    extern (D) bool WIFEXITED( int status )     { return _WSTATUS(status) == 0;     }
-+    extern (D) bool WIFSIGNALED( int status )
-+    {
-+        return _WSTATUS( status ) != _WSTOPPED && _WSTATUS( status ) != 0;
-+    }
-+    extern (D) bool WIFSTOPPED( int status )   { return _WSTATUS( status ) == _WSTOPPED; }
-+    extern (D) int  WSTOPSIG( int status )     { return status >> 8;                     }
-+    extern (D) int  WTERMSIG( int status )     { return _WSTATUS( status );              }
-+}
- else version (Solaris)
- {
-     enum WNOHANG        = 64;
-@@ -205,6 +227,12 @@ else version (FreeBSD)
- 
-     // http://www.freebsd.org/projects/c99/
+@@ -255,6 +255,11 @@ else version (DragonFlyBSD)
+     enum WCONTINUED     = 4;
+     enum WNOWAIT        = 8;
  }
 +else version (NetBSD)
 +{
 +    enum WSTOPPED       = WUNTRACED;
-+    //enum WCONTINUED     = 4;
-+    enum WNOWAIT        = 0x00010000;
++    enum WNOWAIT        = 0x0010000;
 +}
  else version (Solaris)
  {
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_termios.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_termios.d
index 57a15eebc3..7c0510188b 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_termios.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_termios.d
@@ -2,125 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/termios.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/termios.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/termios.d
-@@ -459,6 +459,115 @@ else version ( FreeBSD )
-     int     tcsetattr(int, int, in termios*);
- 
- }
-+else version ( NetBSD )
-+{
-+    alias ubyte cc_t;
-+    alias uint  speed_t;
-+    alias uint  tcflag_t;
-+
-+    enum NCCS   = 20;
-+
-+    struct termios
-+    {
-+        tcflag_t   c_iflag;
-+        tcflag_t   c_oflag;
-+        tcflag_t   c_cflag;
-+        tcflag_t   c_lflag;
-+        cc_t[NCCS] c_cc;
-+        speed_t    c_ispeed;
-+        speed_t    c_ospeed;
-+    }
-+
-+    enum VEOF       = 0;
-+    enum VEOL       = 1;
-+    enum VERASE     = 3;
-+    enum VINTR      = 8;
-+    enum VKILL      = 5;
-+    enum VMIN       = 16;
-+    enum VQUIT      = 9;
-+    enum VSTART     = 12;
-+    enum VSTOP      = 13;
-+    enum VSUSP      = 10;
-+    enum VTIME      = 17;
-+
-+    enum BRKINT     = 0x0000002;
-+    enum ICRNL      = 0x0000100;
-+    enum IGNBRK     = 0x0000001;
-+    enum IGNCR      = 0x0000080;
-+    enum IGNPAR     = 0x0000004;
-+    enum INLCR      = 0x0000040;
-+    enum INPCK      = 0x0000010;
-+    enum ISTRIP     = 0x0000020;
-+    enum IXOFF      = 0x0000400;
-+    enum IXON       = 0x0000200;
-+    enum PARMRK     = 0x0000008;
-+
-+    enum OPOST      = 0x0000001;
-+
-+    enum B0         = 0;
-+    enum B50        = 50;
-+    enum B75        = 75;
-+    enum B110       = 110;
-+    enum B134       = 134;
-+    enum B150       = 150;
-+    enum B200       = 200;
-+    enum B300       = 300;
-+    enum B600       = 600;
-+    enum B1200      = 1200;
-+    enum B1800      = 1800;
-+    enum B2400      = 2400;
-+    enum B4800      = 4800;
-+    enum B9600      = 9600;
-+    enum B19200     = 19200;
-+    enum B38400     = 38400;
-+
-+    enum CSIZE      = 0x0000300;
-+    enum   CS5      = 0x0000000;
-+    enum   CS6      = 0x0000100;
-+    enum   CS7      = 0x0000200;
-+    enum   CS8      = 0x0000300;
-+    enum CSTOPB     = 0x0000400;
-+    enum CREAD      = 0x0000800;
-+    enum PARENB     = 0x0001000;
-+    enum PARODD     = 0x0002000;
-+    enum HUPCL      = 0x0004000;
-+    enum CLOCAL     = 0x0008000;
-+
-+    enum ECHO       = 0x00000008;
-+    enum ECHOE      = 0x00000002;
-+    enum ECHOK      = 0x00000004;
-+    enum ECHONL     = 0x00000010;
-+    enum ICANON     = 0x00000100;
-+    enum IEXTEN     = 0x00000400;
-+    enum ISIG       = 0x00000080;
-+    enum NOFLSH     = 0x80000000;
-+    enum TOSTOP     = 0x00400000;
-+
-+    enum TCSANOW    = 0;
-+    enum TCSADRAIN  = 1;
-+    enum TCSAFLUSH  = 2;
-+
-+    enum TCIFLUSH   = 1;
-+    enum TCOFLUSH   = 2;
-+    enum TCIOFLUSH  = 3;
-+
-+    enum TCIOFF     = 3;
-+    enum TCION      = 4;
-+    enum TCOOFF     = 1;
-+    enum TCOON      = 2;
-+
-+    speed_t cfgetispeed(in termios*);
-+    speed_t cfgetospeed(in termios*);
-+    int     cfsetispeed(termios*, speed_t);
-+    int     cfsetospeed(termios*, speed_t);
-+    int     tcdrain(int);
-+    int     tcflow(int, int);
-+    int     tcflush(int, int);
-+    int     tcgetattr(int, termios*);
-+    int     tcsendbreak(int, int);
-+    int     tcsetattr(int, int, in termios*);
-+
-+}
- 
- //
- // XOpen (XSI)
-@@ -601,4 +710,38 @@ else version( FreeBSD )
+@@ -638,6 +638,40 @@ version( CRuntime_Glibc )
  
      pid_t   tcgetsid(int);
  }
@@ -159,3 +43,5 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 +    pid_t   tcgetsid(int);
 +}
  
+ else version (OSX)
+ {
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_time.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_time.d
index 731e11c504..8865ff41b4 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_time.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_time.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/sys/posix/time.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/time.d.orig	2020-05-07 08:52:17.274678259 +0000
 +++ runtime/druntime/src/core/sys/posix/time.d
-@@ -52,6 +52,10 @@ else version( FreeBSD )
+@@ -60,6 +60,10 @@ else version( NetBSD )
  {
      time_t timegm(tm*); // non-standard
  }
@@ -15,73 +15,3 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version (Solaris)
  {
      time_t timegm(tm*); // non-standard
-@@ -115,6 +119,12 @@ else version (FreeBSD)
-     deprecated("Please import it from core.sys.freebsd.time instead.")
-         alias CLOCK_MONOTONIC_FAST = core.sys.freebsd.time.CLOCK_MONOTONIC_FAST;
- }
-+else version (NetBSD)
-+{
-+    // time.h
-+    enum CLOCK_MONOTONIC         = 3;
-+}
-+
- else version (OSX)
- {
-     // No CLOCK_MONOTONIC defined
-@@ -245,6 +255,30 @@ else version( FreeBSD )
-     int timer_getoverrun(timer_t);
-     int timer_settime(timer_t, int, in itimerspec*, itimerspec*);
- }
-+else version( NetBSD )
-+{
-+    struct itimerspec
-+    {
-+        timespec it_interval;
-+        timespec it_value;
-+    }
-+
-+    enum CLOCK_REALTIME      = 0;
-+    enum TIMER_ABSTIME       = 0x01;
-+
-+    alias int clockid_t; // <sys/_types.h>
-+    alias int timer_t;
-+
-+    int clock_getres(clockid_t, timespec*);
-+    int clock_gettime(clockid_t, timespec*);
-+    int clock_settime(clockid_t, in timespec*);
-+    int nanosleep(in timespec*, timespec*);
-+    int timer_create(clockid_t, sigevent*, timer_t*);
-+    int timer_delete(timer_t);
-+    int timer_gettime(timer_t, itimerspec*);
-+    int timer_getoverrun(timer_t);
-+    int timer_settime(timer_t, int, in itimerspec*, itimerspec*);
-+}
- else version (Solaris)
- {
-     enum CLOCK_PROCESS_CPUTIME_ID = 5; // <sys/time_impl.h>
-@@ -338,6 +372,13 @@ else version( FreeBSD )
-     tm*   gmtime_r(in time_t*, tm*);
-     tm*   localtime_r(in time_t*, tm*);
- }
-+else version( NetBSD )
-+{
-+    char* asctime_r(in tm*, char*);
-+    char* ctime_r(in time_t*, char*);
-+    tm*   gmtime_r(in time_t*, tm*);
-+    tm*   localtime_r(in time_t*, tm*);
-+}
- else version (Solaris)
- {
-     char* asctime_r(in tm*, char*);
-@@ -391,6 +432,11 @@ else version( FreeBSD )
-     //tm*   getdate(in char*);
-     char* strptime(in char*, in char*, tm*);
- }
-+else version( NetBSD )
-+{
-+    tm*   getdate(in char*);
-+    char* strptime(in char*, in char*, tm*);
-+}
- else version (Solaris)
- {
-     extern __gshared c_long timezone, altzone;
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_ucontext.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_ucontext.d
index a3a539ddcd..8439192e6a 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_ucontext.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_ucontext.d
@@ -1,10 +1,8 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/posix/ucontext.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/ucontext.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/ucontext.d
-@@ -701,6 +701,62 @@ else version( FreeBSD )
+@@ -766,6 +766,62 @@ else version( DragonFlyBSD )
          int[4]          __spare__;
      }
  }
diff --git a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_unistd.d b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_unistd.d
index 12bf854b9c..0a11df858f 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_sys_posix_unistd.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_sys_posix_unistd.d
@@ -1,10 +1,8 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/sys/posix/unistd.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/sys/posix/unistd.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/sys/posix/unistd.d
-@@ -116,6 +116,11 @@ else version( FreeBSD )
+@@ -121,6 +121,11 @@ else version( DragonFlyBSD )
      off_t lseek(int, off_t, int) @trusted;
      int   ftruncate(int, off_t) @trusted;
  }
@@ -16,7 +14,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version( Solaris )
  {
      version ( D_LP64 )
-@@ -808,6 +813,143 @@ else version( FreeBSD )
+@@ -968,6 +973,143 @@ else version( DragonFlyBSD )
          _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS =  14,
      }
  }
@@ -160,25 +158,10 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else version( CRuntime_Bionic )
  {
      enum F_OK       = 0;
-@@ -1106,6 +1248,10 @@ else version( FreeBSD )
+@@ -1428,6 +1570,31 @@ else version( DragonFlyBSD )
  {
-     int fsync(int) @trusted;
- }
-+else version( NetBSD )
-+{
-+    int fsync(int) @trusted;
-+}
- else version( Android )
- {
-     int fsync(int) @trusted;
-@@ -1260,6 +1406,31 @@ else version( FreeBSD )
-     int        usleep(useconds_t) @trusted;
-     pid_t      vfork();
- }
-+else version( NetBSD )
-+{
-+    char*      crypt(in char*, in char*);
-+    //char*      ctermid(char*);
+     char*      crypt(in char*, in char*);
+     //char*      ctermid(char*);
 +    void       encrypt(ref char[64], int) @trusted;
 +    int        fchdir(int) @trusted;
 +    c_long     gethostid() @trusted;
@@ -200,6 +183,10 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 +    int        usleep(useconds_t) @trusted;
 +    pid_t      vfork();
 +}
- else version( CRuntime_Bionic )
- {
++else version( NetBSD )
++{
++    char*      crypt(in char*, in char*);
++    //char*      ctermid(char*);
+     void       encrypt(ref char[64], int) @trusted;
      int        fchdir(int) @trusted;
+     c_long     gethostid() @trusted;
diff --git a/ldc/patches/patch-runtime_druntime_src_core_thread.d b/ldc/patches/patch-runtime_druntime_src_core_thread.d
index 827e8d6821..a4523a4a59 100644
--- a/ldc/patches/patch-runtime_druntime_src_core_thread.d
+++ b/ldc/patches/patch-runtime_druntime_src_core_thread.d
@@ -2,7 +2,7 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/core/thread.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/core/thread.d.orig	2018-08-23 23:29:55.000000000 +0000
 +++ runtime/druntime/src/core/thread.d
 @@ -588,7 +588,6 @@ class Thread
      // General Actions
@@ -47,15 +47,7 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
          else version( Posix )
          {
              static if(__traits(compiles, pthread_setschedprio))
-@@ -982,6 +995,7 @@ class Thread
-                 // NOTE: pthread_setschedprio is not implemented on OSX or FreeBSD, so use
-                 //       the more complicated get/set sequence below.
-                 int         policy;
-+
-                 sched_param param;
- 
-                 if (auto err = pthread_getschedparam(m_addr, &policy, &param))
-@@ -991,6 +1005,7 @@ class Thread
+@@ -991,6 +1004,7 @@ class Thread
                      throw new ThreadException("Unable to set thread priority");
                  }
                  param.sched_priority = val;
@@ -63,15 +55,15 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
                  if (auto err = pthread_setschedparam(m_addr, policy, &param))
                  {
                      // ignore error if thread is not running => Bugzilla 8960
-@@ -3195,6 +3210,7 @@ extern (C)
- nothrow:
+@@ -3213,6 +3227,7 @@ nothrow:
      version (CRuntime_Glibc) int pthread_getattr_np(pthread_t thread, pthread_attr_t* attr);
      version (FreeBSD) int pthread_attr_get_np(pthread_t thread, pthread_attr_t* attr);
+     version (DragonFlyBSD) int pthread_attr_get_np(pthread_t thread, pthread_attr_t* attr);
 +    version (NetBSD) int pthread_attr_get_np(pthread_t thread, pthread_attr_t* attr);
      version (Solaris) int thr_stksegment(stack_t* stk);
      version (CRuntime_Bionic) int pthread_getattr_np(pthread_t thid, pthread_attr_t* attr);
  }
-@@ -3322,6 +3338,17 @@ private void* getStackBottom() nothrow
+@@ -3351,6 +3366,17 @@ private void* getStackBottom() nothrow
          pthread_attr_destroy(&attr);
          return addr + size;
      }
@@ -89,25 +81,18 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
      else version (Solaris)
      {
          stack_t stk;
-@@ -3905,6 +3932,13 @@ version( LDC )
-         version( X86 ) version = CheckFiberMigration;
-         version( X86_64 ) version = CheckFiberMigration;
+@@ -3940,6 +3966,14 @@ version( LDC )
+         version( ARM ) version = CheckFiberMigration;
+         version( AArch64 ) version = CheckFiberMigration;
      }
-+    version( NetBSD )
++
++    version ( NetBSD )
 +    {
 +        version( ARM ) version = CheckFiberMigration;
 +        version( AArch64 ) version = CheckFiberMigration;
 +        version( X86 ) version = CheckFiberMigration;
-+        version( X86_64 ) version = CheckFiberMigration;
++        version( x86_64 ) version = CHeckFiberMigration;
 +    }
  }
  
  // Fiber support for SjLj style exceptions
-@@ -4663,6 +4697,7 @@ private:
-         {
-             version (Posix) import core.sys.posix.sys.mman; // mmap
-             version (FreeBSD) import core.sys.freebsd.sys.mman : MAP_ANON;
-+            version (NetBSD) import core.sys.netbsd.sys.mman : MAP_ANON;
-             version (CRuntime_Glibc) import core.sys.linux.sys.mman : MAP_ANON;
-             version (OSX) import core.sys.osx.sys.mman : MAP_ANON;
- 
diff --git a/ldc/patches/patch-runtime_druntime_src_core_threadasm.S b/ldc/patches/patch-runtime_druntime_src_core_threadasm.S
deleted file mode 100644
index dfa19881eb..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_core_threadasm.S
+++ /dev/null
@@ -1,15 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/core/threadasm.S.orig	2016-02-13 20:02:16.000000000 +0000
-+++ runtime/druntime/src/core/threadasm.S
-@@ -13,7 +13,7 @@
-  *          http://www.boost.org/LICENSE_1_0.txt)
-  */
- 
--#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__ELF__)
-+#if (defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)) && defined(__ELF__)
- /*
-  * Mark the resulting object file as not requiring execution permissions on
-  * stack memory. The absence of this section would mark the whole resulting
diff --git a/ldc/patches/patch-runtime_druntime_src_gc_os.d b/ldc/patches/patch-runtime_druntime_src_gc_os.d
index e4df31592d..36eeb1a2de 100644
--- a/ldc/patches/patch-runtime_druntime_src_gc_os.d
+++ b/ldc/patches/patch-runtime_druntime_src_gc_os.d
@@ -2,13 +2,13 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/gc/os.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/gc/os.d.orig	2020-05-07 08:52:17.834676660 +0000
 +++ runtime/druntime/src/gc/os.d
-@@ -31,6 +31,7 @@ else version (Posix)
- {
+@@ -32,6 +32,7 @@ else version (Posix)
      import core.sys.posix.sys.mman;
      version (FreeBSD) import core.sys.freebsd.sys.mman : MAP_ANON;
-+    version (NetBSD) import core.sys.netbsd.sys.mman : MAP_ANON;
+     version (DragonFlyBSD) import core.sys.dragonflybsd.sys.mman : MAP_ANON;
++    version (NetBSD) import core.sys.netbsd.sys.mman : MAP_ANON;    
      version (CRuntime_Glibc) import core.sys.linux.sys.mman : MAP_ANON;
      version (OSX) import core.sys.osx.sys.mman : MAP_ANON;
      import core.stdc.stdlib;
diff --git a/ldc/patches/patch-runtime_druntime_src_rt_bss__section.c b/ldc/patches/patch-runtime_druntime_src_rt_bss__section.c
index efcb1f846c..9b67cc9727 100644
--- a/ldc/patches/patch-runtime_druntime_src_rt_bss__section.c
+++ b/ldc/patches/patch-runtime_druntime_src_rt_bss__section.c
@@ -2,14 +2,14 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/rt/bss_section.c.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/rt/bss_section.c.orig	2020-05-07 08:52:17.914676431 +0000
 +++ runtime/druntime/src/rt/bss_section.c
 @@ -10,7 +10,7 @@
  /* These symbols are defined in the linker script and bracket the
   * .bss, .lbss, .lrodata and .ldata sections.
   */
--#if defined(__linux__) || defined(__FreeBSD__)
-+#if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
+-#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__)
++#if defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
  // Need to use weak linkage to workaround a bug in ld.bfd (Bugzilla 13025).
  extern int __attribute__((weak)) __bss_start, _end;
  
diff --git a/ldc/patches/patch-runtime_druntime_src_rt_dmain2.d b/ldc/patches/patch-runtime_druntime_src_rt_dmain2.d
deleted file mode 100644
index 4a4b13891c..0000000000
--- a/ldc/patches/patch-runtime_druntime_src_rt_dmain2.d
+++ /dev/null
@@ -1,50 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
-
---- runtime/druntime/src/rt/dmain2.d.orig	2016-02-13 20:02:16.000000000 +0000
-+++ runtime/druntime/src/rt/dmain2.d
-@@ -36,6 +36,10 @@ version (FreeBSD)
- {
-     import core.stdc.fenv;
- }
-+version (NetBSD)
-+{
-+    import core.stdc.fenv;
-+}
- 
- extern (C) void _d_monitor_staticctor();
- extern (C) void _d_monitor_staticdtor();
-@@ -324,6 +328,21 @@ extern (C) int _d_run_main(int argc, cha
-             fldcw   fpucw;
-         }
-     }
-+    version (NetBSD) version (D_InlineAsm_X86)
-+    {
-+        /*
-+         * NetBSD/i386 sets the FPU precision mode to 53 bit double.
-+         * Make it 64 bit extended.
-+         */
-+        ushort fpucw;
-+        asm
-+        {
-+            fstsw   fpucw;
-+            or      fpucw, 0b11_00_111111; // 11: use 64 bit extended-precision
-+                                           // 111111: mask all FP exceptions
-+            fldcw   fpucw;
-+        }
-+    }
-     version (CRuntime_Microsoft)
-     {
-         init_msvc();
-@@ -468,8 +487,9 @@ extern (C) int _d_run_main(int argc, cha
-     //       thrown during cleanup, however, will abort the cleanup process.
-     void runAll()
-     {
--        if (rt_init() && runModuleUnitTests())
-+        if (rt_init() && runModuleUnitTests()){
-             tryExec({ result = mainFunc(args); });
-+        }
-         else
-             result = EXIT_FAILURE;
- 
diff --git a/ldc/patches/patch-runtime_druntime_src_rt_sections.d b/ldc/patches/patch-runtime_druntime_src_rt_sections.d
index e73774703e..0fd7fd6c12 100644
--- a/ldc/patches/patch-runtime_druntime_src_rt_sections.d
+++ b/ldc/patches/patch-runtime_druntime_src_rt_sections.d
@@ -2,11 +2,11 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/rt/sections.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/rt/sections.d.orig	2020-05-07 08:52:18.074675974 +0000
 +++ runtime/druntime/src/rt/sections.d
-@@ -16,6 +16,8 @@ version (CRuntime_Glibc)
+@@ -18,6 +18,8 @@ else version (FreeBSD)
      public import rt.sections_elf_shared;
- else version (FreeBSD)
+ else version (DragonFlyBSD)
      public import rt.sections_elf_shared;
 +else version (NetBSD)
 +    public import rt.sections_elf_shared;
diff --git a/ldc/patches/patch-runtime_druntime_src_rt_sections__elf__shared.d b/ldc/patches/patch-runtime_druntime_src_rt_sections__elf__shared.d
index 7298c9488b..6ded5cc1fe 100644
--- a/ldc/patches/patch-runtime_druntime_src_rt_sections__elf__shared.d
+++ b/ldc/patches/patch-runtime_druntime_src_rt_sections__elf__shared.d
@@ -2,19 +2,19 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/rt/sections_elf_shared.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/rt/sections_elf_shared.d.orig	2020-05-07 08:52:18.174675688 +0000
 +++ runtime/druntime/src/rt/sections_elf_shared.d
-@@ -12,6 +12,7 @@ module rt.sections_elf_shared;
- 
+@@ -13,6 +13,7 @@ module rt.sections_elf_shared;
  version (CRuntime_Glibc) enum SharedELF = true;
  else version (FreeBSD) enum SharedELF = true;
+ else version (DragonFlyBSD) enum SharedELF = true;
 +else version (NetBSD) enum SharedELF = true;
  else enum SharedELF = false;
  static if (SharedELF):
  
-@@ -32,6 +33,12 @@ else version (FreeBSD)
-     import core.sys.freebsd.sys.elf;
-     import core.sys.freebsd.sys.link_elf;
+@@ -39,6 +40,12 @@ else version (DragonFlyBSD)
+     import core.sys.dragonflybsd.sys.elf;
+     import core.sys.dragonflybsd.sys.link_elf;
  }
 +else version (NetBSD)
 +{
@@ -25,74 +25,42 @@ Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
  else
  {
      static assert(0, "unimplemented");
-@@ -115,6 +122,7 @@ __gshared bool _isRuntimeInitialized;
- 
+@@ -123,6 +130,7 @@ __gshared bool _isRuntimeInitialized;
  
  version (FreeBSD) private __gshared void* dummy_ref;
+ version (DragonFlyBSD) private __gshared void* dummy_ref;
 +version (NetBSD) private __gshared void* dummy_ref;
  
  /****
   * Gets called on program startup just before GC is initialized.
-@@ -124,6 +132,7 @@ void initSections()
-     _isRuntimeInitialized = true;
-     // reference symbol to support weak linkage
-     version (FreeBSD) dummy_ref = &_d_dso_registry;
-+    version (NetBSD) dummy_ref = &_d_dso_registry;
- }
- 
- 
-@@ -243,6 +252,7 @@ private:
- 
+@@ -253,6 +261,7 @@ private:
  // start of linked list for ModuleInfo references
  version (FreeBSD) deprecated extern (C) __gshared void* _Dmodule_ref;
+ version (DragonFlyBSD) deprecated extern (C) __gshared void* _Dmodule_ref;
 +version (NetBSD) deprecated extern (C) __gshared void* _Dmodule_ref;
  
  version (Shared)
  {
-@@ -649,6 +659,8 @@ nothrow:
-                     strtab = cast(const(char)*)dyn.d_un.d_ptr;
-                 else version (FreeBSD)
+@@ -661,6 +670,8 @@ nothrow:
+                     strtab = cast(const(char)*)(info.dlpi_addr + dyn.d_un.d_ptr); // relocate
+                 else version (DragonFlyBSD)
                      strtab = cast(const(char)*)(info.dlpi_addr + dyn.d_un.d_ptr); // relocate
 +                else version (NetBSD)
 +                    strtab = cast(const(char)*)(info.dlpi_addr + dyn.d_un.d_ptr); // relocate
                  else
                      static assert(0, "unimplemented");
                  break;
-@@ -754,6 +766,24 @@ else version (FreeBSD) bool findDSOInfoF
- {
-     return !!_rtld_addr_phdr(addr, result);
- }
-+else version (NetBSD) bool findDSOInfoForAddr(in void* addr, dl_phdr_info* result=null) nothrow @nogc
-+{
-+    static struct DG { const(void)* addr; dl_phdr_info* result; }
-+
-+    extern(C) int callback(dl_phdr_info* info, size_t sz, void* arg) nothrow @nogc
-+    {
-+
-+        auto p = cast(DG*)arg;
-+        if (findSegmentForAddr(*info, p.addr))
-+        {
-+            if (p.result !is null) *p.result = *info;
-+            return 1; // break;
-+        }
-+        return 0; // continue iteration
-+    }
-+    auto dg = DG(addr, result);
-+    return dl_iterate_phdr(&callback, &dg) != 0;
-+}
- 
- /*********************************
-  * Determine if 'addr' lies within shared object 'info'.
-@@ -779,11 +809,13 @@ bool findSegmentForAddr(in ref dl_phdr_i
- version (linux) import core.sys.linux.errno : program_invocation_name;
+@@ -814,12 +825,14 @@ version (linux) import core.sys.linux.er
  // should be in core.sys.freebsd.stdlib
  version (FreeBSD) extern(C) const(char)* getprogname() nothrow @nogc;
+ version (DragonFlyBSD) extern(C) const(char)* getprogname() nothrow @nogc;
 +version (NetBSD) extern(C) const(char)* getprogname() nothrow @nogc;
  
  @property const(char)* progname() nothrow @nogc
  {
      version (linux) return program_invocation_name;
      version (FreeBSD) return getprogname();
+     version (DragonFlyBSD) return getprogname();
 +    version (NetBSD) return getprogname();
  }
  
diff --git a/ldc/patches/patch-runtime_druntime_src_rt_sections__ldc.d b/ldc/patches/patch-runtime_druntime_src_rt_sections__ldc.d
index 61370ba232..46709d51cf 100644
--- a/ldc/patches/patch-runtime_druntime_src_rt_sections__ldc.d
+++ b/ldc/patches/patch-runtime_druntime_src_rt_sections__ldc.d
@@ -2,22 +2,13 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/src/rt/sections_ldc.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/src/rt/sections_ldc.d.orig	2020-05-07 08:52:18.254675459 +0000
 +++ runtime/druntime/src/rt/sections_ldc.d
-@@ -16,7 +16,7 @@
- 
- module rt.sections_ldc;
- 
--version (linux) {} else version (FreeBSD) {} else version(LDC):
-+version (linux) {} else version (FreeBSD) {}else version (NetBSD) {} else version(LDC):
+@@ -19,6 +19,7 @@ module rt.sections_ldc;
+ version (linux) {}
+ else version (FreeBSD) {}
+ else version (DragonFlyBSD) {}
++else version (NetBSD) {}
+ else version(LDC):
  
  import core.stdc.stdlib : alloca;
- import rt.minfo;
-@@ -387,7 +387,6 @@ void initSections()
-     {
-         dl_phdr_info phdr = void;
-         findPhdrForAddr(&globalSectionGroup, &phdr) || assert(0);
--
-         scanSegments(phdr, &globalSectionGroup);
-     }
- }
diff --git a/ldc/patches/patch-runtime_druntime_test_shared_src_load.d b/ldc/patches/patch-runtime_druntime_test_shared_src_load.d
index f474e99728..7b8fa46ee7 100644
--- a/ldc/patches/patch-runtime_druntime_test_shared_src_load.d
+++ b/ldc/patches/patch-runtime_druntime_test_shared_src_load.d
@@ -2,12 +2,12 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/druntime/tree/netbsd
 
---- runtime/druntime/test/shared/src/load.d.orig	2016-02-13 20:02:16.000000000 +0000
+--- runtime/druntime/test/shared/src/load.d.orig	2020-05-07 08:52:18.324675259 +0000
 +++ runtime/druntime/test/shared/src/load.d
-@@ -2,6 +2,7 @@ import core.runtime, core.stdc.stdio, co
- 
+@@ -3,6 +3,7 @@ import core.runtime, core.stdc.stdio, co
  version (linux) import core.sys.linux.dlfcn;
  else version (FreeBSD) import core.sys.freebsd.dlfcn;
+ else version (DragonFlyBSD) import core.sys.dragonflybsd.dlfcn;
 +else version (NetBSD) import core.sys.netbsd.dlfcn;
  else static assert(0, "unimplemented");
  
diff --git a/ldc/patches/patch-runtime_phobos_osmodel.mak b/ldc/patches/patch-runtime_phobos_osmodel.mak
index ffaaad006f..3d93276de5 100644
--- a/ldc/patches/patch-runtime_phobos_osmodel.mak
+++ b/ldc/patches/patch-runtime_phobos_osmodel.mak
@@ -1,8 +1,6 @@
 $NetBSD$
 
-Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
-
---- runtime/phobos/osmodel.mak.orig	2016-02-13 20:04:46.000000000 +0000
+--- runtime/phobos/osmodel.mak.orig	2018-08-23 23:30:04.000000000 +0000
 +++ runtime/phobos/osmodel.mak
 @@ -12,6 +12,9 @@ ifeq (,$(OS))
    ifeq (FreeBSD,$(uname_S))
diff --git a/ldc/patches/patch-runtime_phobos_std_conv.d b/ldc/patches/patch-runtime_phobos_std_conv.d
index 975080374a..69783a21cb 100644
--- a/ldc/patches/patch-runtime_phobos_std_conv.d
+++ b/ldc/patches/patch-runtime_phobos_std_conv.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
 
---- runtime/phobos/std/conv.d.orig	2016-02-13 20:04:46.000000000 +0000
+--- runtime/phobos/std/conv.d.orig	2020-05-07 08:52:18.564674573 +0000
 +++ runtime/phobos/std/conv.d
-@@ -2859,7 +2859,17 @@ unittest
+@@ -2756,7 +2756,17 @@ unittest
  
      // min and max
      real r = to!real(to!string(real.min_normal));
@@ -22,4 +22,4 @@ Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
 +    }
      r = to!real(to!string(real.max));
      assert(to!string(r) == to!string(real.max));
- }
+ 
diff --git a/ldc/patches/patch-runtime_phobos_std_datetime.d b/ldc/patches/patch-runtime_phobos_std_datetime.d
index 99020c8666..9b0221c7db 100644
--- a/ldc/patches/patch-runtime_phobos_std_datetime.d
+++ b/ldc/patches/patch-runtime_phobos_std_datetime.d
@@ -2,63 +2,13 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
 
---- runtime/phobos/std/datetime.d.orig	2016-02-13 20:04:46.000000000 +0000
+--- runtime/phobos/std/datetime.d.orig	2020-05-07 08:52:18.694674201 +0000
 +++ runtime/phobos/std/datetime.d
-@@ -26531,6 +26531,7 @@ auto tz = TimeZone.getTimeZone("America/
-         version(Posix)
+@@ -26532,6 +26532,7 @@ auto tz = TimeZone.getTimeZone("America/
          {
-             version(FreeBSD)      enum utcZone = "Etc/UTC";
-+            else version(NetBSD)  enum utcZone = "UTC";
-             else version(linux)   enum utcZone = "UTC";
-             else version(OSX)     enum utcZone = "UTC";
-             else static assert(0, "The location of the UTC timezone file on this Posix platform must be set.");
-@@ -26965,19 +26966,31 @@ public:
-         {
-             scope(exit) clearTZEnvVar();
- 
--            version(FreeBSD)
-+            version(NetBSD)
-             {
--                // A bug on FreeBSD 9+ makes it so that this test fails.
--                // https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=168862
-+                //According http://mainfacts.com/world-timezones-time-zones/PPT :
-+                //Actual zone of this location is PST now. It can be assigned to PPT too.
-+                setTZEnvVar("America/Los_Angeles");
-+                assert(LocalTime().dstName == "PPT");
-+                setTZEnvVar("America/New_York");
-+                assert(LocalTime().dstName == "EPT");
-             }
-             else
-             {
--                setTZEnvVar("America/Los_Angeles");
--                assert(LocalTime().dstName == "PDT");
--            }
-+                version(FreeBSD)
-+                {
-+                    // A bug on FreeBSD 9+ makes it so that this test fails.
-+                    // https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=168862
-+                }
-+                else
-+                {
-+                    setTZEnvVar("America/Los_Angeles");
-+                    assert(LocalTime().dstName == "PDT");
-+                }
- 
--            setTZEnvVar("America/New_York");
--            assert(LocalTime().dstName == "EDT");
-+                setTZEnvVar("America/New_York");
-+                assert(LocalTime().dstName == "EDT");
-+           }
-         }
-     }
- 
-@@ -28416,7 +28429,8 @@ assert(tz.dstName == "PDT");
- 
-                 if(!tzName.extension().empty ||
-                    !tzName.startsWith(subName) ||
--                   tzName == "+VERSION")
-+                   tzName == "+VERSION" ||
-+                   tzName == "leapseconds" )
-                 {
-                     continue;
-                 }
+             version(FreeBSD)           enum utcZone = "Etc/UTC";
+             else version(DragonFlyBSD) enum utcZone = "UTC";
++            else version(NetBSD)       enum utcZone = "UTC";
+             else version(linux)        enum utcZone = "UTC";
+             else version(OSX)          enum utcZone = "UTC";
+             else version(Solaris)      enum utcZone = "UTC";
diff --git a/ldc/patches/patch-runtime_phobos_std_file.d b/ldc/patches/patch-runtime_phobos_std_file.d
index 0bfbc5f887..0908076d6a 100644
--- a/ldc/patches/patch-runtime_phobos_std_file.d
+++ b/ldc/patches/patch-runtime_phobos_std_file.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
 
---- runtime/phobos/std/file.d.orig	2016-02-13 20:04:46.000000000 +0000
+--- runtime/phobos/std/file.d.orig	2018-08-23 23:30:04.000000000 +0000
 +++ runtime/phobos/std/file.d
-@@ -1816,6 +1816,9 @@ version (OSX)
+@@ -1826,6 +1826,9 @@ version (OSX)
  else version (FreeBSD)
      private extern (C) int sysctl (const int* name, uint namelen, void* oldp,
          size_t* oldlenp, const void* newp, size_t newlen);
@@ -14,9 +14,9 @@ Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
  
  /**
   * Returns the full path of the current executable.
-@@ -1885,6 +1888,10 @@ else version (FreeBSD)
- 
-         return buffer.assumeUnique;
+@@ -1899,6 +1902,10 @@ else version (FreeBSD)
+     {
+         return readLink("/proc/curproc/file");
      }
 +    else version (NetBSD)
 +    {
diff --git a/ldc/patches/patch-runtime_phobos_std_internal_math_gammafunction.d b/ldc/patches/patch-runtime_phobos_std_internal_math_gammafunction.d
deleted file mode 100644
index 96e8c448e5..0000000000
--- a/ldc/patches/patch-runtime_phobos_std_internal_math_gammafunction.d
+++ /dev/null
@@ -1,116 +0,0 @@
-$NetBSD$
-
-Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
-
---- runtime/phobos/std/internal/math/gammafunction.d.orig	2016-02-13 20:04:46.000000000 +0000
-+++ runtime/phobos/std/internal/math/gammafunction.d
-@@ -532,16 +532,16 @@ unittest {
-     ];
-    // TODO: test derivatives as well.
-     for (int i=0; i<testpoints.length; i+=3) {
--        assert( feqrel(logGamma(testpoints[i]), testpoints[i+1]) > real.mant_dig-5);
-+        assert( feqrel(logGamma(testpoints[i]), testpoints[i+1]) > real.mant_dig-15);
-         if (testpoints[i]<MAXGAMMA) {
--            assert( feqrel(log(fabs(gamma(testpoints[i]))), testpoints[i+1]) > real.mant_dig-5);
-+            assert( feqrel(log(fabs(gamma(testpoints[i]))), testpoints[i+1]) > real.mant_dig-15);
-         }
-     }
--    assert(logGamma(-50.2) == log(fabs(gamma(-50.2))));
-+    assert(feqrel(logGamma(-50.2), log(fabs(gamma(-50.2)))) > real.mant_dig-11);
-     assert(logGamma(-0.008) == log(fabs(gamma(-0.008))));
--    assert(feqrel(logGamma(-38.8),log(fabs(gamma(-38.8)))) > real.mant_dig-4);
-+    assert(feqrel(logGamma(-38.8),log(fabs(gamma(-38.8)))) > real.mant_dig-11);
-     static if (real.mant_dig >= 64) // incl. 80-bit reals
--        assert(feqrel(logGamma(1500.0L),log(gamma(1500.0L))) > real.mant_dig-2);
-+        assert(feqrel(logGamma(1500.0L),log(gamma(1500.0L))) > real.mant_dig-10);
-     else static if (real.mant_dig >= 53) // incl. 64-bit reals
-         assert(feqrel(logGamma(150.0L),log(gamma(150.0L))) > real.mant_dig-2);
- }
-@@ -929,10 +929,10 @@ unittest { // also tested by the normal 
-     assert(feqrel(betaIncomplete(8, 10, 0.2), 0.010_934_315_234_099_2L) >=  real.mant_dig - 5);
-     assert(feqrel(betaIncomplete(2, 2.5, 0.9), 0.989_722_597_604_452_767_171_003_59L) >= real.mant_dig - 1);
-     static if (real.mant_dig >= 64) // incl. 80-bit reals
--        assert(feqrel(betaIncomplete(1000, 800, 0.5), 1.179140859734704555102808541457164E-06L) >= real.mant_dig - 13);
-+        assert(feqrel(betaIncomplete(1000, 800, 0.5), 1.179140859734704555102808541457164E-06L) >= real.mant_dig - 24);
-     else
-         assert(feqrel(betaIncomplete(1000, 800, 0.5), 1.179140859734704555102808541457164E-06L) >= real.mant_dig - 14);
--    assert(feqrel(betaIncomplete(0.0001, 10000, 0.0001), 0.999978059362107134278786L) >= real.mant_dig - 18);
-+    assert(feqrel(betaIncomplete(0.0001, 10000, 0.0001), 0.999978059362107134278786L) >= real.mant_dig - 28);
-     assert(betaIncomplete(0.01, 327726.7, 0.545113) == 1.0);
-     assert(feqrel(betaIncompleteInv(8, 10, 0.010_934_315_234_099_2L), 0.2L) >= real.mant_dig - 2);
-     assert(feqrel(betaIncomplete(0.01, 498.437, 0.0121433), 0.99999664562033077636065L) >= real.mant_dig - 1);
-@@ -958,7 +958,12 @@ unittest { // also tested by the normal 
-         assert(feqrel(betaIncompleteInv(0x1.ff1275ae5b939bcap-41, 4.6713e18, 0.0813601),
-             0x1.f97749d90c7adba8p-63L) >= real.mant_dig - 39);
-         real a1 = 3.40483;
--        assert(betaIncompleteInv(a1, 4.0640301659679627772e19L, 0.545113) == 0x1.ba8c08108aaf5d14p-109);
-+        version(NetBSD)
-+        {
-+            //skip: NetBSD result: 8.37796e-20 != 2.66348e-33
-+        } else {
-+            assert(betaIncompleteInv(a1, 4.0640301659679627772e19L, 0.545113) == 0x1.ba8c08108aaf5d14p-109);
-+        }
-         real b1 = 2.82847e-25;
-         assert(feqrel(betaIncompleteInv(0.01, b1, 9e-26), 0x1.549696104490aa9p-830L) >= real.mant_dig-10);
- 
-@@ -969,7 +974,7 @@ unittest { // also tested by the normal 
-         // Mathematica states: "(cannot be determined by current methods)"
-         assert(betaIncomplete(1.16251e20, 2.18e39, 5.45e-20) == -real.infinity);
-         // WolframAlpha gives no result for this, though indicates that it approximately 1.0 - 1.3e-9
--        assert(1 - betaIncomplete(0.01, 328222, 4.0375e-5) == 0x1.5f62926b4p-30);
-+        assert(feqrel(1 - betaIncomplete(0.01, 328222, 4.0375e-5), 0x1.5f62926b4p-30) >= real.mant_dig-32);
-     }
- }
- 
-@@ -1453,7 +1458,7 @@ assert(gammaIncompleteComplInv(3, 0)==re
- // x was larger than a, but not by much, and both were large:
- // The value is from WolframAlpha (Gamma[100000, 100001, inf] / Gamma[100000])
- static if (real.mant_dig >= 64) // incl. 80-bit reals
--    assert(fabs(gammaIncompleteCompl(100000, 100001) - 0.49831792109) < 0.000000000005);
-+    assert(fabs(gammaIncompleteCompl(100000, 100001) - 0.49831792109) < 0.000000005);
- else
-     assert(fabs(gammaIncompleteCompl(100000, 100001) - 0.49831792109) < 0.00000005);
- }
-@@ -1547,10 +1552,10 @@ done:
- unittest {
-     // Exact values
-     assert(digamma(1.0)== -EULERGAMMA);
--    assert(feqrel(digamma(0.25), -PI/2 - 3* LN2 - EULERGAMMA) >= real.mant_dig-7);
--    assert(feqrel(digamma(1.0L/6), -PI/2 *sqrt(3.0L) - 2* LN2 -1.5*log(3.0L) - EULERGAMMA) >= real.mant_dig-7);
-+    assert(feqrel(digamma(0.25), -PI/2 - 3* LN2 - EULERGAMMA) >= real.mant_dig-8);
-+    assert(feqrel(digamma(1.0L/6), -PI/2 *sqrt(3.0L) - 2* LN2 -1.5*log(3.0L) - EULERGAMMA) >= real.mant_dig-10);
-     assert(digamma(-5.0).isNaN());
--    assert(feqrel(digamma(2.5), -EULERGAMMA - 2*LN2 + 2.0 + 2.0L/3) >= real.mant_dig-9);
-+    assert(feqrel(digamma(2.5), -EULERGAMMA - 2*LN2 + 2.0 + 2.0L/3) >= real.mant_dig-11);
-     assert(isIdentical(digamma(NaN(0xABC)), NaN(0xABC)));
- 
-     for (int k=1; k<40; ++k) {
-@@ -1558,7 +1563,7 @@ unittest {
-         for (int u=k; u>=1; --u) {
-             y += 1.0L/u;
-         }
--        assert(feqrel(digamma(k+1.0), -EULERGAMMA + y) >= real.mant_dig-2);
-+        assert(feqrel(digamma(k+1.0), -EULERGAMMA + y) >= real.mant_dig-10);
-     }
- }
- 
-@@ -1623,8 +1628,17 @@ unittest {
- real logmdigammaInverse(real y)
- {
-     import std.numeric: findRoot;
--    enum maxY = logmdigamma(real.min_normal);
--    static assert(maxY > 0 && maxY <= real.max);
-+    version(NetBSD)
-+    {
-+        //CTFE uses direct call logl from libmath. NetBSD has broken logl. it is not support real, only double
-+        auto maxY = logmdigamma(real.min_normal);
-+        assert(maxY > 0 && maxY <= real.max);
-+    }
-+    else
-+    {
-+        enum maxY = logmdigamma(real.min_normal);
-+        static assert(maxY > 0 && maxY <= real.max);
-+    }
- 
-     if (y >= maxY)
-     {
diff --git a/ldc/patches/patch-runtime_phobos_std_math.d b/ldc/patches/patch-runtime_phobos_std_math.d
index 29188c1d2b..15ec4940b4 100644
--- a/ldc/patches/patch-runtime_phobos_std_math.d
+++ b/ldc/patches/patch-runtime_phobos_std_math.d
@@ -2,9 +2,9 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
 
---- runtime/phobos/std/math.d.orig	2016-02-13 20:04:46.000000000 +0000
+--- runtime/phobos/std/math.d.orig	2018-08-23 23:30:04.000000000 +0000
 +++ runtime/phobos/std/math.d
-@@ -750,7 +750,8 @@ ireal sin(ireal y) @safe pure nothrow @n
+@@ -752,7 +752,8 @@ ireal sin(ireal y) @safe pure nothrow @n
  @safe pure nothrow @nogc unittest
  {
    assert(sin(0.0+0.0i) == 0.0);
@@ -14,7 +14,7 @@ Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
  }
  
  /***********************************
-@@ -775,7 +776,8 @@ real cos(ireal y) @safe pure nothrow @no
+@@ -777,7 +778,8 @@ real cos(ireal y) @safe pure nothrow @no
  @safe pure nothrow @nogc unittest
  {
      assert(cos(0.0+0.0i)==1.0);
@@ -24,7 +24,7 @@ Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
      assert(cos(5.2Li)== cosh(5.2L));
  }
  
-@@ -1001,7 +1003,7 @@ Lret: {}
+@@ -1032,7 +1034,7 @@ Lret: {}
  
  unittest
  {
@@ -33,19 +33,17 @@ Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
  }
  
  /***************
-@@ -2420,8 +2422,9 @@ creal expi(real y) @trusted pure nothrow
- 
+@@ -2579,7 +2581,8 @@ creal expi(real y) @trusted pure nothrow
  ///
  @safe pure nothrow @nogc unittest
--{
+ {
 -    assert(expi(1.3e5L) == cos(1.3e5L) + sin(1.3e5L) * 1i);
-+{
 +    assert(feqrel(expi(1.3e5L).re, (cos(1.3e5L) + sin(1.3e5L) * 1i).re)> real.mant_dig-15);
 +    assert(feqrel(expi(1.3e5L).im, (cos(1.3e5L) + sin(1.3e5L) * 1i).im)> real.mant_dig-15);
      assert(expi(0.0L) == 1L + 0.0Li);
  }
  
-@@ -3541,8 +3544,8 @@ real log2(real x) @safe pure nothrow @no
+@@ -3694,8 +3697,8 @@ real log2(real x) @safe pure nothrow @no
  ///
  unittest
  {
@@ -56,14 +54,10 @@ Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
  }
  
  /*****************************************
-@@ -7415,6 +7418,34 @@ private real polyImpl(real x, in real[] 
-                 ;
-             }
-         }
-+        else version (NetBSD)
-+        {
-+            asm pure nothrow @nogc // assembler by W. Bright
-+            {
+@@ -7639,6 +7642,34 @@ private real polyImpl(real x, in real[]
+         {
+             asm pure nothrow @nogc // assembler by W. Bright
+             {
 +                // EDX = (A.length - 1) * real.sizeof
 +                mov     ECX,A[EBP]              ; // ECX = A.length
 +                dec     ECX                     ;
@@ -88,6 +82,10 @@ Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
 +                ;
 +            }
 +        }
-         else
-         {
-             static assert(0);
++        else version (NetBSD)
++        {
++            asm pure nothrow @nogc // assembler by W. Bright
++            {
+                 // EDX = (A.length - 1) * real.sizeof
+                 mov     ECX,A[EBP]              ; // ECX = A.length
+                 dec     ECX                     ;
diff --git a/ldc/patches/patch-runtime_phobos_std_system.d b/ldc/patches/patch-runtime_phobos_std_system.d
index 3de3b90776..51930f99ff 100644
--- a/ldc/patches/patch-runtime_phobos_std_system.d
+++ b/ldc/patches/patch-runtime_phobos_std_system.d
@@ -2,20 +2,20 @@ $NetBSD$
 
 Stolen from https://github.com/nrTQgc/phobos/tree/netbsd
 
---- runtime/phobos/std/system.d.orig	2016-02-13 20:04:46.000000000 +0000
+--- runtime/phobos/std/system.d.orig	2020-05-07 08:52:19.304672455 +0000
 +++ runtime/phobos/std/system.d
-@@ -34,6 +34,7 @@ immutable
-         linux,     /// All Linux Systems
-         osx,       /// Mac OS X
-         freeBSD,   /// FreeBSD
-+        netBSD,    /// NetBSD
-         solaris,   /// Solaris
-         android,   /// Android
-         otherPosix /// Other Posix Systems
-@@ -46,6 +47,7 @@ immutable
-     else version(linux)   OS os = OS.linux;
+@@ -35,6 +35,7 @@ immutable
+         osx,          /// Mac OS X
+         freeBSD,      /// FreeBSD
+         dragonFlyBSD, /// DragonFlyBSD
++        netBSD,       /// NetBSD
+         solaris,      /// Solaris
+         android,      /// Android
+         otherPosix    /// Other Posix Systems
+@@ -48,6 +49,7 @@ immutable
      else version(OSX)     OS os = OS.osx;
      else version(FreeBSD) OS os = OS.freeBSD;
+     else version(DragonFlyBSD) OS os = OS.dragonFlyBSD;
 +    else version(NetBSD) OS os = OS.netBSD;
      else version(Posix)   OS os = OS.otherPosix;
      else static assert(0, "Unknown OS.");
diff --git a/libLLVM38/buildlink3.mk b/libLLVM38/buildlink3.mk
index 52725b00bd..a2ef86369f 100644
--- a/libLLVM38/buildlink3.mk
+++ b/libLLVM38/buildlink3.mk
@@ -7,6 +7,8 @@ LIBLLVM38_BUILDLINK3_MK:=
 
 BUILDLINK_API_DEPENDS.libLLVM38+=	libLLVM38>=3.8.0
 BUILDLINK_PKGSRCDIR.libLLVM38?=		../../wip/libLLVM38
+BUILDLINK_INCDIRS.libLLVM38?=		include/libLLVM38
+BUILDLINK_LIBDIRS.libLLVM38?=		lib/libLLVM38
 
 LLVM_CONFIG_PATH?=		${BUILDLINK_PREFIX.libLLVM38}/libexec/libLLVM38/llvm-config
 


Home | Main Index | Thread Index | Old Index