aarch64: Enable building the aarch64 cipher assembly for windows
authorMartin Storsjö <martin@martin.st>
Thu, 22 Mar 2018 21:32:40 +0000 (23:32 +0200)
committerJussi Kivilinna <jussi.kivilinna@iki.fi>
Wed, 28 Mar 2018 17:37:54 +0000 (20:37 +0300)
commit0de2191a07d69ef1fa34ca4c5d5fc4985ff7b4c4
tree6bf7cbde10cc048996520a00264f84856b54b3ca
parent4e1b628f492643d4e9b830bcdab7b49daaec5854
aarch64: Enable building the aarch64 cipher assembly for windows

* cipher/asm-common-aarch64.h: New.
* cipher/camellia-aarch64.S: Use ELF macro, use x19 instead of x18.
* cipher/chacha20-aarch64.S: Use ELF macro, don't use GOT on windows.
* cipher/cipher-gcm-armv8-aarch64-ce.S: Use ELF macro.
* cipher/rijndael-aarch64.S: Use ELF macro.
* cipher/rijndael-armv8-aarch64-ce.S: Use ELF macro.
* cipher/sha1-armv8-aarch64-ce.S: Use ELF macro.
* cipher/sha256-armv8-aarch64-ce.S: Use ELF macro.
* cipher/twofish-aarch64.S: Use ELF macro.
* configure.ac: Don't require .size and .type in aarch64 assembly check.
--
Don't require .type and .size in configure; we can make
them optional via a preprocessor macro.

This is mostly a mechanical change, wrapping the .type and .size
directives in an ELF() macro, with two actual manual changes:
(when targeting windows):
- Don't load global symbols via a GOT (in chacha20)
- Don't use the x18 register (in camellia); back up and restore x19
  in the prologue/epilogue and use that instead.

x18 is a platform specific register; on linux, it's free to be used
by user code, while it's reserved for platform use on windows and
darwin. Always use x19 instead of x18 for consistency.

Signed-off-by: Martin Storsjö <martin@martin.st>
cipher/asm-common-aarch64.h [new file with mode: 0644]
cipher/camellia-aarch64.S
cipher/chacha20-aarch64.S
cipher/cipher-gcm-armv8-aarch64-ce.S
cipher/rijndael-aarch64.S
cipher/rijndael-armv8-aarch64-ce.S
cipher/sha1-armv8-aarch64-ce.S
cipher/sha256-armv8-aarch64-ce.S
cipher/twofish-aarch64.S
configure.ac