I'm still iffy about the build goop for this. I started mostly cargo-culting the stuff from libcxx, but couldn't get that to work. What's in the patch seems to work for the standalone build, but does not work for in tree builds (and I have no idea why).
Comments / corrections / feedback would be much appreciated.
NetBSD amd64 Clang, GCC confirmed