From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============6911498430298093389==" MIME-Version: 1.0 From: Mark Wielaard To: elfutils-devel@lists.fedorahosted.org Subject: [PATCH 17/17] config: Add -Wstack-usage=262144 (256K) warning check. Date: Sat, 23 May 2015 23:10:30 +0200 Message-ID: <1432415430-13488-18-git-send-email-mjw@redhat.com> In-Reply-To: 1432415430-13488-1-git-send-email-mjw@redhat.com --===============6911498430298093389== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 --- config/ChangeLog | 4 ++++ config/eu.am | 3 +++ src/ChangeLog | 5 +++++ src/Makefile.am | 14 ++++++++++++++ 4 files changed, 26 insertions(+) diff --git a/config/ChangeLog b/config/ChangeLog index bff3b6d..74379d4 100644 --- a/config/ChangeLog +++ b/config/ChangeLog @@ -1,3 +1,7 @@ +2015-05-23 Mark Wielaard + + * eu.am (AM_CFLAGS): Add -Wstack-usage=3D262144. + 2015-04-23 Max Filippov = * eu.am (DEFS.os): New variable. diff --git a/config/eu.am b/config/eu.am index 6103a3e..e935335 100644 --- a/config/eu.am +++ b/config/eu.am @@ -31,9 +31,12 @@ = DEFS =3D -D_GNU_SOURCE -DHAVE_CONFIG_H -DLOCALEDIR=3D'"${localedir}"' AM_CPPFLAGS =3D -I. -I$(srcdir) -I$(top_srcdir)/lib -I.. + +# Warn about stack usage of more than 256K =3D 262144 bytes. AM_CFLAGS =3D -std=3Dgnu99 -Wall -Wshadow -Wformat=3D2 \ $(if $($(*F)_no_Werror),,-Werror) \ $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \ + $(if $($(*F)_no_Wstack_usage),,-Wstack-usage=3D262144) \ $($(*F)_CFLAGS) = COMPILE.os =3D $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE)) diff --git a/src/ChangeLog b/src/ChangeLog index 02f6584..56fc803 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-12 Mark Wielaard = * strip.c (debug_fd): New static variable. diff --git a/src/Makefile.am b/src/Makefile.am index ab5364f..cd11470 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 =3D yes +ldgeneric_no_Wstack_usage =3D yes + +# Bad, bad stack usage... +readelf_no_Wstack_usage =3D yes +nm_no_Wstack_usage =3D yes +size_no_Wstack_usage =3D yes +strip_no_Wstack_usage =3D yes +elflint_no_Wstack_usage =3D yes +findtextrel_no_Wstack_usage =3D yes +elfcmp_no_Wstack_usage =3D yes +objdump_no_Wstack_usage =3D yes +ranlib_no_Wstack_usage =3D yes +ar_no_Wstack_usage =3D yes +unstrip_no_Wstack_usage =3D yes = readelf_LDADD =3D $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl nm_LDADD =3D $(libdw) $(libebl) $(libelf) $(libeu) $(argp_LDADD) -ldl \ -- = 1.8.3.1 --===============6911498430298093389==--