In OpenWrt we have a build error in the openssl sha256 code on MIPS I.
For reference, I've never tested MIPS modules on pre-III, and therefore
feedback for earlier generations is appreciated. It was tested to
compile for MIPS II though, for IRIX account.

/usr/bin/perl asm/sha512-mips.pl o32 sha256-mips.S
mipsel-openwrt-linux-uclibc-gcc -O2 -pipe -mtune=r5000 -fno-caller-saves
-fhonour-copts -Wno-error=unused-but-set-variable -msoft-float -fpic -c
  -c -o sha256-mips.o sha256-mips.S
sha256-mips.S: Assembler messages:
sha256-mips.S:1960: Error: opcode not supported on this processor: mips1
(mips1) `bnel $5,$23,.Loop'
make[5]: *** [sha256-mips.o] Error 1
Well, if you -mtune=r5000 you probably are not actually targeting MIPS
I, and could therefore specify even -mips3 on compiler command line.
But, yes, as you point out it's appears to be declared obsolete in the
latest specification, so that switching to bne is appropriate. But just
replacing it with bne is not necessarily appropriate because instruction
is delay slot to b*l is executed conditionally. Also note that there are
more b*l instructions, in crypto/bn/asm. I'll see what is appropriate to
do, meanwhile specify at least -mips2 on command line.

http://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff;h=68dd8512b7cb7e71bb951efe7863dbecb34e6611

While it was appropriate to simply switch from bnel to bne in sha512-mips.pl, other modules required extra work.

On side note, last update to MIPS modules (in 1.0.2 and forward) added
support for latest MIPS[32|64]R2 and SmartMIPS extensions. If you happen
to have such CPUs, it would pay off to specify matching command-line
option(s).

I do not have this hardware, I just saw that some automatic builds are
failing and wanted to inform the author of that code, the build was done
by cross compiling. The Mips devices I have here are all MIPS32 R1 and
R2. Doing some buildtests with these compiler optimizations that are
causing problems here is no problem for me.

There seem to be some misunderstanding/confusion. If you have MIPS32 R2, then it will pay off to specify -mips32r2 on compiler command line (for OpenSSL 1.0.2 and forward). Of course you might prefer to have single binary for multiple processors, in which case it would of course be inappropriate.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to