Skip to content

Commit

Permalink
sbin/make.cross: fix cflags test for older GCCs
Browse files Browse the repository at this point in the history
GCC 9 has "unrecognized command line option" message instead of
"unrecognized command-line option" (note the space instead of the
hyphen), which makes it pass all the cflags tests and append
unsupported flags to KCFLAGS.
Use '.' pattern when grepping the output to match both ' ' and '-'.

Fixes: 5ee4b22 ("sbin/make.cross: append extra kcflags when feasible")
Signed-off-by: Alexander Lobakin <[email protected]>
Signed-off-by: Philip Li <[email protected]>
  • Loading branch information
alobakin authored and rli9 committed Nov 8, 2023
1 parent fc48edb commit 0cb1dc1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sbin/make.cross
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ is_supported_compiler_option()
# $ clang-15 -Winvalid-option -xc /dev/null
# warning: unknown warning option '-Winvalid-option' [-Wunknown-warning-option]

$compiler $option -xc /dev/null 2>&1 | grep -q -e "unrecognized command-line option" -e "unknown warning option" && return 1
$compiler $option -xc /dev/null 2>&1 | grep -q -e "unrecognized command.line option" -e "unknown warning option" && return 1

return 0
}
Expand Down

0 comments on commit 0cb1dc1

Please sign in to comment.