In OpenWrt we have a build error in the openssl sha256 code on MIPS I.

/usr/bin/perl asm/sha1-mips.pl o32 sha1-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 sha1-mips.o sha1-mips.S
/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
make[5]: Leaving directory
`/builds/openwrt/slave/cobalt/build/build_dir/target-mipsel_uClibc-0.9.33.2/openssl-1.0.1e/crypto/sha'
make[4]: *** [subdirs] Error 1
make[4]: Leaving directory
`/builds/openwrt/slave/cobalt/build/build_dir/target-mipsel_uClibc-0.9.33.2/openssl-1.0.1e/crypto'
make[3]: *** [build_crypto] Error 1
make[3]: Leaving directory
`/builds/openwrt/slave/cobalt/build/build_dir/target-mipsel_uClibc-0.9.33.2/openssl-1.0.1e'
make[2]: ***
[/builds/openwrt/slave/cobalt/build/build_dir/target-mipsel_uClibc-0.9.33.2/openssl-1.0.1e/.built]
Error 2
make[2]: Leaving directory
`/builds/openwrt/slave/cobalt/build/package/libs/openssl'

The full log is here:
http://buildbot.openwrt.org:8010/broken_packages/cobalt/openssl/compile.txt

The MIPS documentation says:

Software is strongly encouraged to avoid the use of the Branch Likely
instructions, as they will be removed from a future revision of the MIPS
Architecture.
Some implementations always predict the branch will be taken, so there
is a significant penalty if the branch is not taken. Software should
only use this instruction when there is a very high probability (98% or
more) that the branch will be taken. If the branch is not likely to be
taken or if the probability of a taken branch is unknown, software is
encouraged to use the BNE instruction instead.

Historical Information:
In the MIPS I architecture, this instruction signaled a Reserved
Instruction Exception.

http://personal.denison.edu/~bressoud/cs281-s10/Supplements/ISA_Vol_2.pdf

I am not a MIPS ASM expert, but I would suggest to use BNE here instead.

Hauke
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       openssl-dev@openssl.org
Automated List Manager                           majord...@openssl.org

Reply via email to