Fix Configure test for -mips in CFLAGS
authorMike Gilbert <floppym@gentoo.org>
Sun, 12 Feb 2023 22:56:58 +0000 (17:56 -0500)
committerPauli <pauli@openssl.org>
Sun, 19 Mar 2023 22:28:22 +0000 (09:28 +1100)
We want to add -mips2 or -mips3 only if the user hasn't already
specified a mips version in CFLAGS. The existing test was a
double-negative.

CLA: trivial

Fixes: https://github.com/openssl/openssl/issues/20214
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20273)

Configure

index 6ef882f5a3fb4d302e2f7628ba6c836a7e794424..4e4681ae8f1c26fa874c3ca4fe8de655fcdbc345 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -1478,7 +1478,7 @@ if ($target =~ /^mingw/ && `$config{CC} --target-help 2>&1` =~ m/-mno-cygwin/m)
         }
 
 if ($target =~ /linux.*-mips/ && !$disabled{asm}
-        && !grep { $_ !~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) {
+        && !grep { $_ =~ /-m(ips|arch=)/ } (@{$config{CFLAGS}})) {
         # minimally required architecture flags for assembly modules
         my $value;
         $value = '-mips2' if ($target =~ /mips32/);