From: "Dmitry V. Levin" <ldv@altlinux.org>
To: elfutils-devel@sourceware.org
Subject: [PATCH] src: add -Wno-error=stack-usage= to AM_LDFLAGS
Date: Mon, 6 Sep 2021 03:59:05 +0300 [thread overview]
Message-ID: <20210906005904.GA6598@altlinux.org> (raw)
While -Wstack-usage= is already excluded from AM_CFLAGS for various
tools in src using *_no_Wstack_usage variables, this obviously does not
help when LTO is enabled, so add -Wno-error=stack-usage= to AM_LDFLAGS
for linking tools in src.
References: https://sourceware.org/bugzilla/show_bug.cgi?id=24498
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
config/ChangeLog | 4 ++++
config/eu.am | 2 ++
src/ChangeLog | 4 ++++
src/Makefile.am | 2 +-
4 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/config/ChangeLog b/config/ChangeLog
index 70a1e923..b2c0af8a 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2021-09-05 Dmitry V. Levin <ldv@altlinux.org>
+
+ * eu.am (STACK_USAGE_NO_ERROR): New variable.
+
2021-07-06 Alice Zhang <alizhang@redhat.com>
* debuginfod.sysconfig: Introduce default retry limit.
diff --git a/config/eu.am b/config/eu.am
index 2c3e4571..58cd3c4f 100644
--- a/config/eu.am
+++ b/config/eu.am
@@ -39,8 +39,10 @@ ARFLAGS = cr
# Warn about stack usage of more than 256K = 262144 bytes.
if ADD_STACK_USAGE_WARNING
STACK_USAGE_WARNING=-Wstack-usage=262144
+STACK_USAGE_NO_ERROR=-Wno-error=stack-usage=
else
STACK_USAGE_WARNING=
+STACK_USAGE_NO_ERROR=
endif
if SANE_LOGICAL_OP_WARNING
diff --git a/src/ChangeLog b/src/ChangeLog
index b729eaa4..e83e0a5e 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2021-09-05 Dmitry V. Levin <ldv@altlinux.org>
+
+ * Makefile.am (AM_LDFLAGS): Add $(STACK_USAGE_NO_ERROR).
+
2021-08-20 Saleem Abdulrasool <abdulras@google.com>
* elfclassify.c: Remove error.h include.
diff --git a/src/Makefile.am b/src/Makefile.am
index 88d0ac8f..86d5bcf8 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,7 +23,7 @@ AM_CPPFLAGS += -I$(srcdir)/../libelf -I$(srcdir)/../libebl \
-I$(srcdir)/../libdw -I$(srcdir)/../libdwelf \
-I$(srcdir)/../libdwfl -I$(srcdir)/../libasm
-AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw
+AM_LDFLAGS = -Wl,-rpath-link,../libelf:../libdw $(STACK_USAGE_NO_ERROR)
bin_PROGRAMS = readelf nm size strip elflint findtextrel addr2line \
elfcmp objdump ranlib strings ar unstrip stack elfcompress \
--
ldv
next reply other threads:[~2021-09-06 0:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-06 0:59 Dmitry V. Levin [this message]
2021-09-08 21:59 ` Mark Wielaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210906005904.GA6598@altlinux.org \
--to=ldv@altlinux.org \
--cc=elfutils-devel@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).