> I'd be a little uncomfortable going through dlopen/dlsym/dlclose for all created threads. This would mean that all native task spawns would take these hits.

I suppose it would be possible to cache the result somewhere though that could blow up if someone gets creative with unloading libpthread.so, then loading it again..

> I'm not entirely sure, but is there a difference between PTHREAD_STACK_MIN and __pthread_get_minstack?

The return value of __pthread_get_minstack() is PTHREAD_STACK_MIN plus whatever glibc needs for thread-local storage (which is not per se a fixed quantity.)

> That being said, I would be very comfortable merging this without fixing #6233 just yet, but I would imagine that a solution to #6233 would likely involve using dlsym to figure out if you can actually call it.

I think so.  You can't rely on __pthread_get_minstack() being there, it was added in glibc 2.15.  Most distros ship older versions.