From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 1B39A3850846 for ; Fri, 21 Oct 2022 15:59:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1B39A3850846 Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-607-isJAF4o6OvO1b3A5y_9PZg-1; Fri, 21 Oct 2022 11:59:02 -0400 X-MC-Unique: isJAF4o6OvO1b3A5y_9PZg-1 Received: by mail-qv1-f72.google.com with SMTP id h3-20020a0ceec3000000b004b17a25f8bcso2577897qvs.23 for ; Fri, 21 Oct 2022 08:59:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0Ak68NmTWxnUcGDMHX6mT8pP4A4/pEYO6E5wvJxMXH4=; b=GqZvUyMvdneMaXvJf09kNu91kUR6MEhIqaNdndY7Hwbm6YBkT/Tcf7Fqk9jZW9Pmx7 ykqCGdFK0cnMSImgoqxzO3dQNf4cGxujezlnZda8zzJFTpzqGI9Rmg2dRrcQTIwNotHH YuELClxcKFyg5aGeoDkeetbTy3p0CjOdpQ36++9wN2rcPGVXmQJJzynsChkmkyMj4GSD sgfUz3R/S67T4ZhlOjDAKISqoyRIMBYdee6LrxyMeZxup/sLR1hTJNFxE6p+oQ2FjtsC zKLxDnC9+DJAZCaUNlgqV1P14bHkVm50mBuGWoSUS29wIbMT038GmarqZCz3XLFSalyd zAGQ== X-Gm-Message-State: ACrzQf3oFPht2p1Iqi6fAB/ZOID/2NoVYZuhvD1TFp8cFdiVgSdP99jF Tmal8zS1jfzcvGBlW4DeVmp02LuNkFMOYC9gMWzP8+CAZtEGk2FkCoGbKA6au6hbNg18VnLiFlB 6fHNkIyp2elijFB1mELTo1w== X-Received: by 2002:ac8:5a02:0:b0:39e:209e:7177 with SMTP id n2-20020ac85a02000000b0039e209e7177mr3182992qta.409.1666367942205; Fri, 21 Oct 2022 08:59:02 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7Ba7QSr4kX1edBFohXJAQbT3dnag8FPteYpo9p5b8Nr4CEb7V/SJNtLQX8gUm/zBkYZ57JXQ== X-Received: by 2002:ac8:5a02:0:b0:39e:209e:7177 with SMTP id n2-20020ac85a02000000b0039e209e7177mr3182976qta.409.1666367941944; Fri, 21 Oct 2022 08:59:01 -0700 (PDT) Received: from localhost ([31.111.84.238]) by smtp.gmail.com with ESMTPSA id fe5-20020a05622a4d4500b00342f8984348sm8244528qtb.87.2022.10.21.08.59.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 08:59:01 -0700 (PDT) From: Andrew Burgess To: Tsukasa OI , gdb-patches@sourceware.org Subject: Re: [PATCH 10/10] sim/cris/m32c/sh: disable use of -Werror In-Reply-To: <22060850-e52e-afd7-5828-84b9cc061e31@irq.a4lg.com> References: <42c09bcd56bb7bf0a84d58ffad71894f284b5401.1666192979.git.aburgess@redhat.com> <22060850-e52e-afd7-5828-84b9cc061e31@irq.a4lg.com> Date: Fri, 21 Oct 2022 16:58:59 +0100 Message-ID: <87h6zx9ni4.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2022 15:59:08 -0000 Tsukasa OI 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. > > 2. > > 3. > > 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. > > > 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: > > > 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