[openssl-dev] 64 bit compilacion seems to fail with some PERL versions

Jesus Cea jcea at jcea.es
Thu Mar 19 22:51:02 UTC 2015

When compiling a 64 bit OpenSSL 1.0.2a with a 32 bit PERL interpreter I
get this error:

./config zlib-dynamic shared
/usr/local/bin/perl asm/ghash-x86_64.pl elf > ghash-x86_64.s
Integer overflow in hexadecimal number at
asm/../../perlasm/x86_64-xlate.pl line 201, <> line 890.
gcc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include  -fPIC
-DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -O3 -Wall -DL_ENDIAN
-DECP_NISTZ256_ASM -c  -o ghash-x86_64.o ghash-x86_64.s
ghash-x86_64.s: Assembler messages:
ghash-x86_64.s:890: Error: junk `.15473355479995e+19' after expression
<builtin>: recipe for target 'ghash-x86_64.o' failed
make[2]: *** [ghash-x86_64.o] Error 1

In line 890 I have this:

        subq    $48,%rcx
        movq    $1.15473355479995e+19,%rax  <<<<<<<<<<<<<<<<<<
        movdqu  48(%rsi),%xmm14
        movdqu  64(%rsi),%xmm15

Comparing that line in other machines where compilation is done
correctly, I see this:

         movq    $11547335547999543296,%rax

Notice that "11547335547999543296" is approximately 1.15473355479995e+19
in scientific notation.

When doing "perl -e 'print(11547335547999543296)' I get:


in one machine (64 bits), but


in the other machine (32 bits).

The number is being promoted to scientific notation and compilation will

Yes, in Solaris I can mix 32 and 64 bit binaries in the same running
system. It is standard practice and the reason I am compiling OpenSSL
both in 32 and in 64 bits.

Replacing the scientific notation value with "11547335547999543296" the
code compiles correctly and the tests complete 100% OK.

In the 64 bit PERL version "11547335547999543296" is printed correctly
as an integer but "21547335547999543296" (first digit changed) is
printed as 2.15473355479995e+19. I think that depending of
implementation details (the value when an integer is "promoted" to
floating point) of the PERL interpreter is bad practice and should be
avoided. Maybe using literal string, of splitting the number in two halfs.

Jesús Cea Avión                         _/_/      _/_/_/        _/_/_/
jcea at jcea.es - http://www.jcea.es/     _/_/    _/_/  _/_/    _/_/  _/_/
Twitter: @jcea                        _/_/    _/_/          _/_/_/_/_/
jabber / xmpp:jcea at jabber.org  _/_/  _/_/    _/_/          _/_/  _/_/
"Things are not so easy"      _/_/  _/_/    _/_/  _/_/    _/_/  _/_/
"My name is Dump, Core Dump"   _/_/_/        _/_/_/      _/_/  _/_/
"El amor es poner tu felicidad en la felicidad de otro" - Leibniz

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20150319/a2c3e06a/attachment.sig>

More information about the openssl-dev mailing list