... This is some progress towards the previous patch being viable, however I'll have to patch libstdc++ and a bunch of other things, too.
---- Move the big "if _NETBSD_SOURCE" chunk to the "Implementation defined" section. Makes "at_quick_exit" and others visible for strict C/C++. Index: stdlib.h =================================================================== RCS file: /cvsroot/src/include/stdlib.h,v retrieving revision 1.122 diff -u -r1.122 stdlib.h --- stdlib.h 26 May 2020 21:49:29 -0000 1.122 +++ stdlib.h 30 Aug 2020 11:48:26 -0000 @@ -136,9 +136,6 @@ int mbtowc(wchar_t * __restrict, const char * __restrict, size_t); size_t wcstombs(char * __restrict, const wchar_t * __restrict, size_t); -#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \ - defined(_NETBSD_SOURCE) - /* * IEEE Std 1003.1c-95, also adopted by X/Open CAE Spec Issue 5 Version 2 @@ -258,7 +255,8 @@ /* * Implementation-defined extensions */ -#if defined(_NETBSD_SOURCE) +#if defined(_POSIX_C_SOURCE) || defined(_XOPEN_SOURCE) || \ + defined(_NETBSD_SOURCE) #if defined(alloca) && (alloca == __builtin_alloca) && \ defined(__GNUC__) && (__GNUC__ < 2) void *alloca(int); /* built-in for gcc */ @@ -345,7 +343,6 @@ size_t shquotev(int, char * const *, char *, size_t); int reallocarr(void *, size_t, size_t); -#endif /* _NETBSD_SOURCE */ #endif /* _POSIX_C_SOURCE || _XOPEN_SOURCE || _NETBSD_SOURCE */ #if defined(_NETBSD_SOURCE)