]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
config: Add -Wstack-usage=262144 (256K) warning check.
authorMark Wielaard <mjw@redhat.com>
Sat, 23 May 2015 15:50:09 +0000 (17:50 +0200)
committerMark Wielaard <mjw@redhat.com>
Wed, 27 May 2015 21:04:31 +0000 (23:04 +0200)
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 <mjw@redhat.com>
config/ChangeLog
config/eu.am
src/ChangeLog
src/Makefile.am

index bff3b6dd1107ab423d9d53cd23291416b34996c4..74379d4f8bf0050abce1656d9d20bfcaa1820fe6 100644 (file)
@@ -1,3 +1,7 @@
+2015-05-23  Mark Wielaard  <mjw@redhat.com>
+
+       * eu.am (AM_CFLAGS): Add -Wstack-usage=262144.
+
 2015-04-23  Max Filippov  <jcmvbkbc@gmail.com>
 
        * eu.am (DEFS.os): New variable.
index 6103a3ef6cd2d37a813f95abb2b45a9d4e638ecf..e935335a7100ea3b3a42db6af78f61e1bf98e72e 100644 (file)
 
 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))
index ee180076412f66006c35af94bccdbbe23dfbe0df..3161aa84ce3bcb43cc480afdd4cb51bfd3575843 100644 (file)
@@ -1,3 +1,8 @@
+2015-05-23  Mark Wielaard  <mjw@redhat.com>
+
+       * Makefile.am: Define ldgeneric, readelf, nm, size, strip, elflint,
+       findtextrel, elfcmp objdump, ranlib, ar and unstrip no_Wstack_usage.
+
 2015-05-21  Mark Wielaard  <mjw@redhat.com>
 
        * addr2line.c (handle_address): Set scopes to NULL after free.
index 58cbe76400ee0d84282c4c19085595439c2d3815..cd2755b03db6f50756a322bab59d3590bd828edf 100644 (file)
@@ -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 \