diff options
author | Rich Felker <dalias@aerifal.cx> | 2018-09-18 23:54:18 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018-09-18 23:54:18 -0400 |
commit | 7b3348a98c139b4b4238384e52d4b0eb237e4833 (patch) | |
tree | 8cfb46f4009824bc36b4cf258efefc65cec196ef /src/sched | |
parent | c0058ab465e950c2c3302d2b62e21cc0b494224b (diff) | |
download | musl-7b3348a98c139b4b4238384e52d4b0eb237e4833.tar.gz musl-7b3348a98c139b4b4238384e52d4b0eb237e4833.tar.xz musl-7b3348a98c139b4b4238384e52d4b0eb237e4833.zip |
support setting of default thread stack size via PT_GNU_STACK header
this facilitates building software that assumes a large default stack size without any patching to call pthread_setattr_default_np or pthread_attr_setstacksize at each thread creation site, using just LDFLAGS. normally the PT_GNU_STACK header is used only to reflect whether executable stack is desired, but with GNU ld at least, passing -Wl,-z,stack-size=N will set a size on the program header. with this patch, that size will be incorporated into the default stack size (subject to increase-only rule and DEFAULT_STACK_MAX limit). both static and dynamic linking honor the program header. for dynamic linking, all libraries loaded at program start, including preloaded ones, are considered. dlopened libraries are not considered, for several reasons. extra logic would be needed to defer processing until the load of the new library is commited, synchronization woud be needed since other threads may be running concurrently, and the effectiveness woud be limited since the larger size would not apply to threads that already existed at the time of dlopen. programs that will dlopen code expecting a large stack need to declare the requirement themselves, or pthread_setattr_default_np can be used.
Diffstat (limited to 'src/sched')
0 files changed, 0 insertions, 0 deletions