Thanks Andy, very helpful.
The multi/dmulti was because I did not understand the PERLASM_SCHEME
options differed for mips from what I had previously done for intel cpus.
So I changed the "elf" to "n32" in the (new) config line and now dmulti
(and other "d" calls are used).
The config line i added is now:
"BSD-mips","gcc:-DTERMIOS -O3 -fomit-frame-pointer -msoft-float
-Wall::${BSDthreads}:::BN_LLONG RC2_CHAR RC4_INDEX DES_INT
DES_UNROLL:${mips64_asm}:n32:dlfcn:bsd-gcc-shared:-fPIC::.so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
Maybe I should add SIXTY_FOUR_BIT? Others?
I will make sure -Bsymbolic is used when linking up libcrypto.so.
Modified mips.pl as you suggested and the warning is eliminated. Do you
know if such a change will still qualify for a Change Letter validation?
Kevin
On Sun, Jan 20, 2013 at 12:59 PM, Andy Polyakov <[email protected]> wrote:
> I'm cross-compiling the FIPS Module v2.0.2 for a NetBSD/MIPS target. All
>> seems well except for the following warning when compiling bn-mips.s (gcc
>> version 4.1.3):
>>
>> /usr/local/bin/perl ../../util/fipsas.pl <http://fipsas.pl> ../..
>> bn-mips.s mips64--netbsd-gcc -I.. -I../.. -I../modes -I../asn1 -I../evp
>> -I../../include -DOPENSSL_FIPSCANISTER -fPIC -DOPENSSL_PIC
>> -DOPENSSL_THREADS -pthread -D_THREAD_SAFE -D_REENTRANT -DDSO_DLFCN
>> -DHAVE_DLFCN_H -Wa,--noexecstack -DTERMIOS -O3 -fomit-frame-pointer
>> -msoft-float -Wall -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM
>> -DSHA512_ASM -DAES_ASM -c -o bn-mips.o bn-mips.s
>>
>> bn-mips.s: Assembler messages:
>> bn-mips.s:585: Warning: Pretending global symbol used as branch target is
>> local.
>>
>> The code causing the warning is below:
>>
>> .align 5
>> .ent bn_div_3_words_internal
>> bn_div_3_words_internal:
>> .set reorder
>> move $11,$31
>> bal fips_bn_div_words <-----------
>> move $31,$11
>> multu $10,$2
>> lw $14,-2*4($7)
>> ...
>>
>
> Here is something strange. Compiler is called mips64-*, there is
> -DSHA512_ASM, both indicate that we are talking about MIPS64 build (maybe
> in N32 ABI context, but MIPS64 nevertheless)... But then how come it's
> multu and not dmultu two lines below <-----? We don't have config line for
> NetBSD/MIPS, so it must be yours, private one. And provided above it's
> likely to be inconsistent. I don't know if it will pass the test. But even
> if it will, bn will perform sub-optimally, as dmultu gives at least 3x
> improvement over multu.
>
>
> Is this something I can ignore?
>>
>
> Most likely. "Most likely" means that I can't imagine that it would be a
> problem, but can't be sure without hands-on experience. At all occasions,
> -Bsymbolic should help to avoid eventual problems.
>
>
> Is there a compiler option I'm missing that would eliminate the warning?
>>
>
> I can't know. But can you test/verify following? Open crypto/bn/asm/
> mips.pl in text editor, locate the line that reads "bal\tbn_div_words"
> and replace it bn_div_words with bn_div_words_internal. I can confirm that
> it produces correct result (in supported configs!-), but I can't tell if it
> fixes the warning.
>
> ______________________________**______________________________**__________
> OpenSSL Project http://www.openssl.org
> Development Mailing List [email protected]
> Automated List Manager [email protected]
>