public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: Tsukasa OI <research_trasio@irq.a4lg.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 10/10] sim/cris/m32c/sh: disable use of -Werror
Date: Fri, 21 Oct 2022 16:58:59 +0100	[thread overview]
Message-ID: <87h6zx9ni4.fsf@redhat.com> (raw)
In-Reply-To: <22060850-e52e-afd7-5828-84b9cc061e31@irq.a4lg.com>

Tsukasa OI <research_trasio@irq.a4lg.com> writes:

> Hi Andrew,
>
> It's surprising for me that you are working on that!

While I was reviewing your previous clang patches I tried to build the
sim/ tree with clang, but even with your patches I was hitting a bunch
of warnings/errors.

I created a set of changes as a fixup so that I could test your patches.
That is, this started as the set of extra fixes I needed on top of your
work to get the sim/ tree building with clang (for me).

Once your work was merged I decided, having done this work, I might as
well split the fixes into separate patches and get them merged.  I may
have expanded slightly by looking at any warnings emitted by gcc as well
as any other non-fatal warnings from clang, and fixing anything that
looked easy.

>
> Based on your branch, I applied one patch (from my upcoming patchset)
> each time I met an error (until I see no errors) and here's some results
> (including simple patches to CGEN-generated files):
>
> Required additional patches (from my patchset) to Andrew tree:
>     1.  With PATCH 10/10 - Clang 15.0.3 : 16 (+2 for cpu/cris)
>     2.  With PATCH 10/10 - Clang 15.0.0 : 19 (+2 for cpu/cris)
>     3.  W/O  PATCH 10/10 - Clang 15.0.3 : 20 (+2 for cpu/cris)
>     4.  W/O  PATCH 10/10 - Clang 15.0.0 : 23 (+2 for cpu/cris)

Yeah, my version of clang is somewhat older than that (9.x !)

> c.f.
> 1.
> <https://github.com/a4lg/binutils-gdb/tree/a4lg/snapshots/2022-10-20/andrew-tree-plus-config-1>
> 2.
> <https://github.com/a4lg/binutils-gdb/tree/a4lg/snapshots/2022-10-20/andrew-tree-plus-config-2>
> 3.
> <https://github.com/a4lg/binutils-gdb/tree/a4lg/snapshots/2022-10-20/andrew-tree-plus-config-3>
> 4.
> <https://github.com/a4lg/binutils-gdb/tree/a4lg/snapshots/2022-10-20/andrew-tree-plus-config-4>
>
> Environment:
> -   Ubuntu 22.04.1 LTS
> -   LLVM + Clang 15.0.0 (built from git source; primary)
> -   LLVM + Clang 15.0.3 (built from git source; secondary)
>
> And... my tree (alone with my changes) failed on Clang 15.0.0 but
> succeeded on Clang 15.0.1.  That is because
> -Wimplicit-function-declaration was default-error on 15.0.0 but
> downgraded to default-warning on 15.0.1.  All error messages generated
> by Clang 15.0.0 makes sense so I'll continue using Clang 15.0.0 as a
> reference.
>
> c.f.
> <https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213>
>
> Thanks to your PATCH 09/10, I could build my working tree with Clang
> except M32R simulator with Clang 15.0.0.  Not only that, I could figure
> out how to make M32R simulator (sort of) work.  For CRIS and SuperH, I
> can provide cleaner solution without disabling -Werror (at least on my
> environment).

Yes please.  The disable -Werror isn't a final resting place, its more
just a stopping point so we can have something that builds - though I
think what you're saying above is that with later versions of clang
things still don't build, which is a shame.

>
> My Current Tree (to be submitted as a RFC PATCH) is available at:
> <https://github.com/a4lg/binutils-gdb/tree/clang-nowarn-1>
>
> My initial plan was to split it to smaller patchsets and submit each
> ones periodically but... it seems submitting all at once seems syncing /
> reviewing my and your work easier.  I'll submit a RFC patchset
> consisting of 40 or 41 patches in total.

It's not clear to me if any of my patches above conflict significantly
with patches you have.

If there are any of the above that are a problem, then just let me know
and I wont merge them.

I don't have any plans to do anything more on this in the immediate
future, like I said, with the tools I have to hand right now the sim
tree now builds fine.

I have added revisiting cris/m32c/sh to my todo list, but I doubt that
will get looked at before 2023, and it sounds like you might have a
solution before then - which would be nice :)

Ideally, I'd like to push any of the above patches that don't actively
make your life harder, I'll drop anything that is a problem for you.
And then look forward to your incoming fixes.

Let me know,

Thanks,
Andrew

>
> Note that:
>
> 1.  There are three cpu/* changes (must be reviewed on Binutils side)
> 2.  There are some optional changes (suppresses non-error warnings)
> 3.  PATCH 01 is a duplicate of another patchset (1 patch in total)
> 4.  PATCH 16 is entirely authored by Andrew (PATCH 09/10) and
> 5.  There are other patches that are pretty much the same as Andrew's.
>     They are coincidence because I and Andrew are trying
>     to fix the same issue.
>
> Thanks,
> Tsukasa
>
> On 2022/10/20 0:24, Andrew Burgess via Gdb-patches wrote:
>> When building the cris, m32c, and sh simulators with Clang I am seeing
>> build warnings from a few objects.  These three simulators currently
>> build with -Werror, and so these warnings cause the build to fail.
>> 
>> When built with gcc I don't see any warnings from these targets, so
>> the -Werror is fine.
>> 
>> As the warnings are not new, in this commit, I propose that we disable
>> the use of -Werror for these three simulators.  With this done it is
>> now possible to build the complete simulator tree using clang.
>> ---
>>  sim/cris/Makefile.in | 3 +++
>>  sim/m32c/Makefile.in | 3 +++
>>  sim/sh/Makefile.in   | 3 +++
>>  3 files changed, 9 insertions(+)
>> 
>> diff --git a/sim/cris/Makefile.in b/sim/cris/Makefile.in
>> index d58aeee9363..53e485dca02 100644
>> --- a/sim/cris/Makefile.in
>> +++ b/sim/cris/Makefile.in
>> @@ -41,6 +41,9 @@ SIM_EXTRA_DEPS = \
>>  
>>  SIM_EXTRA_CLEAN = cris-clean
>>  
>> +# Some modules don't build cleanly yet.
>> +mloopv10f.o mloopv32f.o: SIM_WERROR_CFLAGS =
>> +
>>  ## COMMON_POST_CONFIG_FRAG
>>  
>>  arch = cris
>> diff --git a/sim/m32c/Makefile.in b/sim/m32c/Makefile.in
>> index 2436eb940f4..dd9b3aaf175 100644
>> --- a/sim/m32c/Makefile.in
>> +++ b/sim/m32c/Makefile.in
>> @@ -40,4 +40,7 @@ SIM_OBJS = \
>>  	trace.o \
>>  	$(ENDLIST)
>>  
>> +# Some modules don't build cleanly yet.
>> +mem.o: SIM_WERROR_CFLAGS =
>> +
>>  ## COMMON_POST_CONFIG_FRAG
>> diff --git a/sim/sh/Makefile.in b/sim/sh/Makefile.in
>> index fc794f30687..a496095e767 100644
>> --- a/sim/sh/Makefile.in
>> +++ b/sim/sh/Makefile.in
>> @@ -24,4 +24,7 @@ SIM_OBJS = \
>>  SIM_EXTRA_LIBS = -lm
>>  SIM_EXTRA_DEPS = table.c code.c ppi.c
>>  
>> +# Some modules don't build cleanly yet.
>> +interp.o: SIM_WERROR_CFLAGS =
>> +
>>  ## COMMON_POST_CONFIG_FRAG


  reply	other threads:[~2022-10-21 15:59 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 15:24 [PATCH 00/10] Building the sim/ tree with clang Andrew Burgess
2022-10-19 15:24 ` [PATCH 01/10] sim/sh: use fabs instead of abs Andrew Burgess
2022-10-23 13:53   ` Mike Frysinger
2022-10-24 16:05     ` Andrew Burgess
2022-10-19 15:24 ` [PATCH 02/10] sim/ppc: don't try to print an uninitialized variable Andrew Burgess
2022-10-23 13:51   ` Mike Frysinger
2022-10-24 16:05     ` Andrew Burgess
2022-10-19 15:24 ` [PATCH 03/10] sim/ppc: initialize a memory buffer in all cases Andrew Burgess
2022-10-23 13:50   ` Mike Frysinger
2022-10-24 16:25     ` Andrew Burgess
2022-10-19 15:24 ` [PATCH 04/10] sim/ppc: don't pass uninitialized value to semctl for GETVAL calls Andrew Burgess
2022-10-23 14:01   ` Mike Frysinger
2022-10-19 15:24 ` [PATCH 05/10] sim/ppc: fix for operator precedence warning from clang Andrew Burgess
2022-10-23 13:55   ` Mike Frysinger
2022-10-24 16:26     ` Andrew Burgess
2022-10-19 15:24 ` [PATCH 06/10] sim/aarch64: remove two unused functions Andrew Burgess
2022-10-23 13:55   ` Mike Frysinger
2022-10-24 16:26     ` Andrew Burgess
2022-10-19 15:24 ` [PATCH 07/10] sim/rx: delete an unused function Andrew Burgess
2022-10-23 13:54   ` Mike Frysinger
2022-10-19 15:24 ` [PATCH 08/10] sim/h8300: avoid self assignment Andrew Burgess
2022-10-23 13:52   ` Mike Frysinger
2022-10-24 16:26     ` Andrew Burgess
2022-10-19 15:24 ` [PATCH 09/10] sim/lm32: fix some missing function declaration warnings Andrew Burgess
2022-10-23 14:13   ` Mike Frysinger
2022-10-24 16:27     ` Andrew Burgess
2022-10-19 15:24 ` [PATCH 10/10] sim/cris/m32c/sh: disable use of -Werror Andrew Burgess
2022-10-20  3:53   ` Tsukasa OI
2022-10-21 15:58     ` Andrew Burgess [this message]
2022-10-24  8:58       ` Tsukasa OI
2022-10-24 16:23         ` Andrew Burgess
2022-10-20 18:36   ` Tom Tromey
2022-10-23 14:17   ` Mike Frysinger
2022-10-20 18:36 ` [PATCH 00/10] Building the sim/ tree with clang Tom Tromey

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=87h6zx9ni4.fsf@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=research_trasio@irq.a4lg.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).