Commit Graph

15 Commits

Author SHA1 Message Date
Brian Behlendorf 7fa6f8b93a Restrict usage of -fstack-check option
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
2010-07-23 10:38:07 -07:00
Brian Behlendorf 6f1eda0629 Add configure check for -Wframe-larger-than=<size>
It turns out the gcc option -Wframe-larger-than=<size> which I recently
added to the build system is not supported in older versions of gcc.
Since this is just a flag to ensure I keep stack usage under control
I've added a configure check to detect if gcc supports it.  If it's
available we use it in the proper places, if it's not we don't.
2010-06-29 16:53:02 -07:00
Brian Behlendorf 9af7aa53eb Set stack frame limit
For all module/library functions ensure so stack frame exceeds 1024
bytes.  Ideally this should be set lower to say 512 bytes but there
are still numerous functions which exceed even this limit.  For now
this is set to 1024 to ensure we catch the worst offenders.

Additionally, set the limit for ztest to 1024 bytes since the idea
here is to catch stack issues in user space before we find them by
overrunning a kernel stack.  This should also be reduced to 512
bytes as soon as all the trouble makes are fixed.

Finally, add -fstack-check to gcc build options when --enable-debug
is specified at configure time.  This ensures that each page on the
stack will be touched and we will generate a segfault on stack
overflow.

Over time we can gradually fix the following functions:

536 zfs:dsl_deadlist_regenerate
536 zfs:dsl_load_sets
536 zfs:zil_parse
544 zfs:zfs_ioc_recv
552 zfs:dsl_deadlist_insert_bpobj
552 zfs:vdev_dtl_sync
584 zfs:copy_create_perms
608 zfs:ddt_class_contains
608 zfs:ddt_prefetch
608 zfs:__dprintf
616 zfs:ddt_lookup
648 zfs:dsl_scan_ddt
696 zfs:dsl_deadlist_merge
736 zfs:ddt_zap_walk
744 zfs:dsl_prop_get_all_impl
872 zfs:dnode_evict_dbufs
2010-06-29 10:08:48 -07:00
Brian Behlendorf a09d33e929 Update build system for libblkid integration 2009-10-15 16:25:18 -07:00
Brian Behlendorf 09a8c99097 Additional build system update for libefi library.
This include updating all the Makefile.am to have the correct
include paths and libraries.  In addition, the zlib m4 macro was
updated to more correctly integrate with the Makefiles.  And I
added two new macros libblkid and libuuid which will be needed by
subsequent commits for blkid and uuid support respectively.  The
blkid support is optional, the uuid support is mandatory for libefi.
2009-10-14 15:47:41 -07:00
Brian Behlendorf 70407622a7 Move `make check` ztest under ./scripts where the module stack is loaded. 2009-03-18 14:19:04 -07:00
Brian Behlendorf 9c22d76019 Minor 'make check' updates 2009-01-14 15:38:56 -08:00
Brian Behlendorf ce7115b807 Add unicode makefile references and support 2009-01-05 12:33:09 -08:00
Brian Behlendorf 3a76148338 Add a needed lib 2008-12-22 16:52:26 -08:00
Brian Behlendorf 419cff0fd3 Add more more missing headers 2008-12-22 16:02:08 -08:00
Brian Behlendorf b58e34e0d8 Update makefiles 2008-12-22 09:22:39 -08:00
Brian Behlendorf 6481bdc3e7 Add -lm linker flag 2008-12-17 16:16:22 -08:00
Brian Behlendorf 1dfec71003 Add -pthreads 2008-12-17 13:51:11 -08:00
Brian Behlendorf a7b063d224 Add DEFAULT_INCLUDE to rules, adjust = to += accordingly 2008-12-16 08:58:41 -08:00
Brian Behlendorf d4ae03c700 Add initial stub makefile, details need filling in 2008-12-12 08:50:07 -08:00