[openssl-dev] 32 bit compilation of armv8 assembly support(openssl-1.0.2a)

Andy Polyakov appro at openssl.org
Thu Jun 18 10:52:24 UTC 2015


>> I am compiling using the linaro aarch64 compiler for ILP32 ABI.
>> *linux-armv4 *compilation
>> with option -march =armv8_a  giving lots of compilation errors as
>> compiler does not
>> supports mnemonics.

This is because toolchain referred to in one of previous messages is
only capable of generating/compiling AArch64 code. linux-armv4 is
equipped with AArch32 assembly and toolchain in question is indeed not
capable of compiling it. But it doesn't mean that if you compile
linux-armv4 target with right compiler you won't be able to run
resulting binary code on AArch64 system. This actually works and worked
from day one. Unlike abi=ilp32 that is (which is not actually
upstream-ed yet according https://wiki.linaro.org/Platform/arm64-ilp32).
Well, as for "works from day one", you are likely to have to add 32-bit
libc, but on Debian [or derivative] it's straightforward dpkg
--add-architecture. Well, there also might be *processors* that don't
support AArch32 (ARM specification allows it), but all those readily
available now are all perfectly capable of executing linux-armv4
targets. And when it comes to ARMv8 crypto extensions, they would
deliver same performance as 64-bit code, so you don't loose anything.
(Not to mention that binary can be "universal" and make best of any
particular processor it executed on.)

>> So I have tried to compile with new configuration
>> for ilp32
>> with "aarch64_asm".
>>
>> "linux-armilp32","gcc: -O3 -mabi=ilp32 -Wall::-D_REENTRANT::-ldl:
>> SIXTY_FOUR_BIT RC4_CHAR RC4_CHUNK  DES_INT DES_UNROLL BF_PTR:
>> ${aarch64_asm}::dlfcn:linux-shared:-fPIC:-mabi=ilp32:
>> .so.\$(SHLIB_MAJOR).\$(SHLIB_MINOR)",
>>
>> In compilation with this configuration getting error* "cannot represent 
>> BFD_RELOC_64 relocation in this object file format" *in sha1-armv8.s.  
> 
> Obviously it would require some adjustments, because mabi=ilp32 was not
> considered when it was written. It might be sufficient to replace .quad
> with .long, but there is no way for me to tell for reasons discussed in
> the beginning. So that if there is some serious interest, then you have
> to explain yourself better than providing reference to releases.linaro.org.

After having a look at available documentation, attached patch is likely
to be sufficient to compile with -mabi=ilp32. But once again, I have no
way to actually verify it and therefore no promises can be provided.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: armv8-ilp32.diff
Type: text/x-diff
Size: 1503 bytes
Desc: not available
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20150618/674e5a7e/attachment.diff>


More information about the openssl-dev mailing list