From: Mark Wielaard Date: Sat, 23 May 2015 15:50:09 +0000 (+0200) Subject: config: Add -Wstack-usage=262144 (256K) warning check. X-Git-Tag: elfutils-0.162~32 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=712f3c8930a372345b94270ede67233f94a7263b;p=thirdparty%2Felfutils.git config: Add -Wstack-usage=262144 (256K) warning check. All library code now builds with this warning and -Werror enabled. Add exceptions for most of the src tools (ldgeneric, readelf, nm, size, strip, elflint, findtextrel, elfcmp objdump, ranlib, ar and unstrip). Signed-off-by: Mark Wielaard --- diff --git a/config/ChangeLog b/config/ChangeLog index bff3b6dd1..74379d4f8 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2015-05-23 Mark Wielaard + + * eu.am (AM_CFLAGS): Add -Wstack-usage=262144. + 2015-04-23 Max Filippov * eu.am (DEFS.os): New variable. diff --git a/config/eu.am b/config/eu.am index 6103a3ef6..e935335a7 100644 --- a/config/eu.am +++ b/config/eu.am @@ -31,9 +31,12 @@ DEFS = -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR='"${localedir}"' AM_CPPFLAGS = -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. + +# Warn about stack usage of more than 256K = 262144 bytes. AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \ $(if $($(*F)_no_Werror),,-Werror) \ $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wstack_usage),,-Wstack-usage=262144) \ $($(*F)_CFLAGS) COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE)) diff --git a/src/ChangeLog b/src/ChangeLog index ee1800764..3161aa84c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-05-23 Mark Wielaard + + * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint, + findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage. + 2015-05-21 Mark Wielaard * addr2line.c (handle_address): Set scopes to NULL after free. diff --git a/src/Makefile.am b/src/Makefile.am index 58cbe7640..cd2755b03 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -88,6 +88,20 @@ endif # XXX While the file is not finished, don't warn about this ldgeneric_no_Wunused = yes +ldgeneric_no_Wstack_usage = yes + +# Bad, bad stack usage... +readelf_no_Wstack_usage = yes +nm_no_Wstack_usage = yes +size_no_Wstack_usage = yes +strip_no_Wstack_usage = yes +elflint_no_Wstack_usage = yes +findtextrel_no_Wstack_usage = yes +elfcmp_no_Wstack_usage = yes +objdump_no_Wstack_usage = yes +ranlib_no_Wstack_usage = yes +ar_no_Wstack_usage = yes +unstrip_no_Wstack_usage = yes readelf_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl nm_LDADD = $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \