Fix compiling error for mips32r6 and mips64r6
authorHua Zhang <hua.zhang1974@hotmail.com>
Wed, 13 Mar 2019 06:28:44 +0000 (14:28 +0800)
committerRichard Levitte <levitte@openssl.org>
Tue, 19 Mar 2019 06:37:45 +0000 (07:37 +0100)
There are some compiling errors for mips32r6 and mips64r6:

crypto/bn/bn-mips.S:56: Error: opcode not supported on this processor: mips2 (mips2) `mulu $1,$12,$7'
crypto/mips_arch.h: Assembler messages:
crypto/mips_arch.h:15: Error: junk at end of line, first unrecognized character is `&'

Signed-off-by: Hua Zhang <hua.zhang1974@hotmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/8464)

(cherry picked from commit 1b9c5f2e2f283a3b12d02a89c11b8e8d97bc6312)

crypto/bn/asm/mips.pl
crypto/mips_arch.h

index 3875132bd25d484947dc83a2c3f80b147e07a306..8574e57b403ed8ca940adfef72129f3cb0f23cf4 100644 (file)
@@ -89,7 +89,7 @@ if ($flavour =~ /64|n32/i) {
        $SZREG=4;
        $REG_S="sw";
        $REG_L="lw";
-       $code=".set     mips2\n";
+       $code="#if !(defined (__mips_isa_rev) && (__mips_isa_rev >= 6))\n.set     mips2\n#endif\n";
 }
 
 # Below is N32/64 register layout used in the original module.
index 75043e79d337dfce8ebc068c5830ffbc01745f74..6145f4dc46db2bbbc85a994709a4f9652984270c 100644 (file)
@@ -11,7 +11,7 @@
 # define __MIPS_ARCH_H__
 
 # if (defined(__mips_smartmips) || defined(_MIPS_ARCH_MIPS32R3) || \
-      defined(_MIPS_ARCH_MIPS32R5) || defined(_MIPS_ARCH_MIPS32R6))
+      defined(_MIPS_ARCH_MIPS32R5) || defined(_MIPS_ARCH_MIPS32R6)) \
       && !defined(_MIPS_ARCH_MIPS32R2)
 #  define _MIPS_ARCH_MIPS32R2
 # endif