From 99a5645a0edbafac8eb667e0f341a73bebb5f34d Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck Date: Mon, 23 May 2022 10:55:03 +0200 Subject: handle clang's option "-meabi gnu" Clang has an option "-meabi " 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 Signed-off-by: Luc Van Oostenryck --- options.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 + // 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 { -- cgit 1.2.3-korg