gcc8,gcc9: fix ctypes on NetBSD

This patch was applied to gcc7 in aab8c7ba437 ("netbsd: add cross target"),
but it hasn't been brought forward to newer compilers that have the
same problem.

GCC 6 and (probably) GCC 4.9 also have the issue, but the patch
doesn't apply cleanly to them so I'm leaving them alone for now.

GCC 10, our current default, appears to have finally fixed this.

+2
+1
pkgs/development/compilers/gcc/8/default.nix
··· 55 55 56 56 patches = 57 57 optional (targetPlatform != hostPlatform) ../libstdc++-target.patch 58 + ++ optional targetPlatform.isNetBSD ../libstdc++-netbsd-ctypes.patch 58 59 ++ optional noSysDirs ../no-sys-dirs.patch 59 60 /* ++ optional (hostPlatform != buildPlatform) (fetchpatch { # XXX: Refine when this should be applied 60 61 url = "https://git.busybox.net/buildroot/plain/package/gcc/${version}/0900-remove-selftests.patch?id=11271540bfe6adafbc133caf6b5b902a816f5f02";
+1
pkgs/development/compilers/gcc/9/default.nix
··· 70 70 # This patch can most likely be removed by a post 9.3.0-release. 71 71 [ ./avoid-cycling-subreg-reloads.patch ] 72 72 ++ optional (targetPlatform != hostPlatform) ../libstdc++-target.patch 73 + ++ optional targetPlatform.isNetBSD ../libstdc++-netbsd-ctypes.patch 73 74 ++ optional noSysDirs ../no-sys-dirs.patch 74 75 /* ++ optional (hostPlatform != buildPlatform) (fetchpatch { # XXX: Refine when this should be applied 75 76 url = "https://git.busybox.net/buildroot/plain/package/gcc/${version}/0900-remove-selftests.patch?id=11271540bfe6adafbc133caf6b5b902a816f5f02";