From: Tsukasa OI <research_trasio@irq.a4lg.com>
To: Tsukasa OI <research_trasio@irq.a4lg.com>,
Nick Clifton <nickc@redhat.com>, Jan Beulich <jbeulich@suse.com>
Cc: binutils@sourceware.org
Subject: [PATCH 0/1] bfd: Stop using -Wstack-usage=262144 when built with Clang
Date: Tue, 13 Sep 2022 12:59:35 +0000 [thread overview]
Message-ID: <cover.1663073944.git.research_trasio@irq.a4lg.com> (raw)
Hello,
[Common Background: Building GNU Binutils / GDB with Clang 15.0.0]
I'm now testing to build GNU Binutils / GDB with latest Clang (15.0.0) and
found some errors by default (when Binutils / GDB is not configured with
"--disable-werror").
While the best compiler to build GNU Binutils / GDB is GNU GCC, testing
other compilers are helpful to discover underlying problems and modernize
Binutils / GDB, even if building entire Binutils / GDB with the latest Clang
is unrealistic. To be sure, I'm not going to finish "porting for Clang".
I will take low-hanging fruits and...
1. make building with Clang easier and/or
2. fix code issues (or non-issues) discovered as Clang warnings.
I made four patchsets in which, applying them all makes it possible to
build GNU Binutils / GDB with Clang (without help of --disable-werrors) for
many (but not all) targets including i386 and RISC-V with Ubuntu 22.04 LTS
(x86_64) host. At least, I think they fix all (at minimum, most of) arch-
independent parts which prevents building with the latest version of Clang.
This is the one of them.
[About this Patchset]
Some components of GNU Binutils will pass "-Wstack-usage=262144" when
"GCC >= 5.0" is detected. However, Clang does not support "-Wstack-usage",
despite that related configuration part in bfd/warning.m4 handles the latest
Clang as "GCC >= 5.0".
The option "-Wstack-usage" was ignored when the first version of Clang is
released but even this "ignoring" behavior is removed before Clang 4.0.0.
So, if we give Clang "-Wstack-usage=262144", it generates a warning, making
the build failure.
With this patchset, GNU Binutils no longer appends "-Wstack-usage=262144"
if the compiler is identified as Clang (when __clang__ is defined).
I also regenerated related "configure" scripts with maintainer mode.
Thanks,
Tsukasa
Tsukasa OI (1):
bfd: Stop using -Wstack-usage=262144 when built with Clang
bfd/configure | 18 ++++++++++++++++++
bfd/warning.m4 | 6 ++++--
binutils/configure | 18 ++++++++++++++++++
gas/configure | 18 ++++++++++++++++++
gold/configure | 18 ++++++++++++++++++
gprof/configure | 18 ++++++++++++++++++
ld/configure | 18 ++++++++++++++++++
opcodes/configure | 18 ++++++++++++++++++
8 files changed, 130 insertions(+), 2 deletions(-)
base-commit: 8fa9bc6a030c9a41eb8cf6f0f66043e02005b291
--
2.34.1
next reply other threads:[~2022-09-13 12:59 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-13 12:59 Tsukasa OI [this message]
2022-09-13 12:59 ` [PATCH 1/1] " Tsukasa OI
2022-09-13 13:44 ` Jan Beulich
2022-09-13 15:29 ` Tsukasa OI
2022-09-14 5:17 ` Alan Modra
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=cover.1663073944.git.research_trasio@irq.a4lg.com \
--to=research_trasio@irq.a4lg.com \
--cc=binutils@sourceware.org \
--cc=jbeulich@suse.com \
--cc=nickc@redhat.com \
/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).