aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2022-05-23 10:55:03 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2022-05-22 11:39:27 +0200
commit99a5645a0edbafac8eb667e0f341a73bebb5f34d (patch)
tree1cfde6d757adff168125ae4b7023ca6a90a6a966
parentb3d7fb1bac881a714fed871db33e98e67b9bf1b6 (diff)
downloadsparse-99a5645a0edbafac8eb667e0f341a73bebb5f34d.tar.gz
handle clang's option "-meabi gnu"
Clang has an option "-meabi <arg>" which is used by the kernel for ARMv7. This kind of option, taking a argument without a separating '=', can't be ignored like most other options and must this be special-cased. So, add the special case for this option and consume the argument if it's one of the valid one. Link: https://lore.kernel.org/r/20220331110118.vr4miyyytqlssjoi@pengutronix.de Reported-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--options.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/options.c b/options.c
index 6704fc8d..187dacd3 100644
--- a/options.c
+++ b/options.c
@@ -685,6 +685,19 @@ static const struct flag mflags[] = {
static char **handle_switch_m(char *arg, char **next)
{
+ if (!strcmp(arg, "meabi") && next[1] && next[1][0] != '-') {
+ // clang has such an option with syntax: -meabi <arg>
+ // It's used by the kernel for armv7.
+ // GCC has the same option but with no argument.
+ // Parse it here to consume the possible argument.
+ static const char *valid[] = { "gnu", "4", "5", "default", NULL };
+ int i;
+ for (i = 0; valid[i]; i++) {
+ if (!strcmp(next[1], valid[i]))
+ return ++next;
+ }
+ }
+
if (!strcmp(arg, "multiarch-dir")) {
return handle_multiarch_dir(arg, next);
} else {