Some buggy NPTL threading implementations include the guard area within
the stack size allocations. In this case we need to allocate an extra
page to account for the guard area since we only have two pages of usable
stack on Linux. Added an autoconf test that detects such implementations
by running a test program designed to segfault if the bug is present.
Set a flag NPTL_GUARD_WITHIN_STACK that is tested to decide if extra
stack space must be allocated for the guard area.
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
See commit f16dec7e67fe86f3c3556a67865ee715a2964d70 for full
details of this change. But in summary -fstack-check is being
restricted in usage only to locations which must already have
small stack frames.
The stack check implementation in older versions of gcc has
a fairly low default limit on STACK_CHECK_MAX_FRAME_SIZE of
roughly 4096. This results in numerous warning when it is
used with code which was designed to run in user space and
thus may be relatively stack heavy. The avoid these warnings,
which are fatal with -Werror, this patch targets the use of
-fstack-check to libraries which are compiled in both user
space and kernel space. The only utility which uses this
flag is ztest which is designed to simulate running in the
kernel and must meet the -fstack-check requirements. All
other user space utilities do not use -fstack-check.
warning: frame size too large for reliable stack checking
warning: try reducing the number of local variables
To use the -fstack-check gcc option each stack frame must be
keep reasonably small. In this case the path local is moved
from the stack to the heap to keep us under the limit.
warning: frame size too large for reliable stack checking
warning: try reducing the number of local variables
The ZFS update to onnv_141 brought with it support for a
security label attribute called mlslabel. This feature
depends on zones to work correctly and thus I am disabling
it under Linux. Equivilant functionality could be added
at some point in the future.
The ZFS update to onnv_141 brought with it support for a
security label attribute called mlslabel. This feature
depends on zones to work correctly and while I originally
added minimal support for this in libspl that was a mistake.
Supporting this under Linux is not required and this is
just additional troublesome code to support. Long term
something like this could be supported under Linux but it
will need to be clearly thought through them an implemented.
For some reason which remains mysterious to me the shared library
which calls pthread_create() must be linked with -pthread. If this
is not done on 32-bit system the default ulimit stack size is used.
Surprisingly, on a 64-bit system the stack limit specified by the
pthread_attr is honored even when -pthread is not passed when linking
the shared library.
The following files were being left out the tarball which
is used by the 'make rpm' target. This results in a build
failure when building packages which use the tarball.
lib/libspl/include/sys/tsol/*.h
lib/libspl/include/util/*.h