From: Linus Torvalds <torvalds@linux-foundation.org>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Aurelien Jarno <aurelien@aurel32.net>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
stable <stable@vger.kernel.org>,
Kito Cheng <kito.cheng@gmail.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
"open list:RISC-V ARCHITECTURE" <linux-riscv@lists.infradead.org>,
Sparse Mailing-list <linux-sparse@vger.kernel.org>,
ukl@pengutronix.de,
Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Subject: Re: [PATCH] riscv: fix build with binutils 2.38
Date: Thu, 31 Mar 2022 11:16:53 -0700 [thread overview]
Message-ID: <CAHk-=wjnuMD091mNbY=fRm-qFyhMjbtfiwkAFKyFehyR8bPB5A@mail.gmail.com> (raw)
In-Reply-To: <20220331105112.7t3qgtilhortkiq4@pengutronix.de>
[-- Attachment #1: Type: text/plain, Size: 550 bytes --]
On Thu, Mar 31, 2022 at 3:51 AM Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>
> Cc += linux-sparse, Uwe, Luc Van Oostenryck
>
> tl;dr:
>
> A recent change in the kernel regarding the riscv -march handling breaks
> current sparse.
Gaah. Normally sparse doesn't even look at the -march flag, but for
riscv it does, because it's meaningful for the predefined macros.
Maybe that 'die()' shouldn't be so fatal. And maybe add a few more
extensions (but ignore them) to the parsing.
Something ENTIRELY UNTESTED like the attached.
Linus
[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch, Size: 1074 bytes --]
target-riscv.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/target-riscv.c b/target-riscv.c
index 6d9113c1..201ac375 100644
--- a/target-riscv.c
+++ b/target-riscv.c
@@ -3,6 +3,7 @@
#include "target.h"
#include "machine.h"
#include <string.h>
+#include <stdio.h>
#define RISCV_32BIT (1 << 0)
#define RISCV_64BIT (1 << 1)
@@ -47,6 +48,12 @@ static void parse_march_riscv(const char *arg)
{ "n", 0 },
{ "h", 0 },
{ "s", 0 },
+ { "i", 0 },
+ { "e", 0 },
+ { "_", 0 },
+ { "Counters", 0 },
+ { "Zicsr", 0 },
+ { "Zifencei", 0 },
};
int i;
@@ -60,7 +67,10 @@ static void parse_march_riscv(const char *arg)
goto ext;
}
}
- die("invalid argument to '-march': '%s'\n", arg);
+
+unknown:
+ fprintf(stderr, "WARNING: invalid argument to '-march': '%s'\n", arg);
+ return;
ext:
for (i = 0; i < ARRAY_SIZE(extensions); i++) {
@@ -73,7 +83,7 @@ ext:
}
}
if (arg[0])
- die("invalid argument to '-march': '%s'\n", arg);
+ goto unknown;
}
static void init_riscv(const struct target *self)
next prev parent reply other threads:[~2022-03-31 18:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-26 17:14 [PATCH] riscv: fix build with binutils 2.38 Aurelien Jarno
2022-01-28 10:05 ` Alexandre Ghiti
2022-02-10 17:40 ` Palmer Dabbelt
2022-02-10 17:56 ` Greg KH
2022-03-31 10:32 ` Marc Kleine-Budde
2022-03-31 10:39 ` Marc Kleine-Budde
2022-03-31 10:51 ` Marc Kleine-Budde
2022-03-31 17:05 ` Aurelien Jarno
2022-03-31 18:16 ` Linus Torvalds [this message]
2022-03-31 19:42 ` Palmer Dabbelt
2022-04-01 6:53 ` Marc Kleine-Budde
2022-04-01 17:14 ` Linus Torvalds
2022-04-01 17:55 ` Palmer Dabbelt
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='CAHk-=wjnuMD091mNbY=fRm-qFyhMjbtfiwkAFKyFehyR8bPB5A@mail.gmail.com' \
--to=torvalds@linux-foundation.org \
--cc=aou@eecs.berkeley.edu \
--cc=aurelien@aurel32.net \
--cc=kito.cheng@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-sparse@vger.kernel.org \
--cc=luc.vanoostenryck@gmail.com \
--cc=mkl@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=stable@vger.kernel.org \
--cc=ukl@pengutronix.de \
/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 NNTP newsgroup(s).