diff options
author | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2013-09-01 16:46:32 +0300 |
---|---|---|
committer | Jussi Kivilinna <jussi.kivilinna@iki.fi> | 2013-09-01 16:46:32 +0300 |
commit | fd6721c235a5bdcb332c8eb708fbd4f96e52e824 (patch) | |
tree | ce8d1d2ebb61cbc6ad962ebcda40793777298477 /random | |
parent | 99d15543b8d94a8f1ef66c6ccb862b0ce82c514d (diff) | |
download | libgcrypt-fd6721c235a5bdcb332c8eb708fbd4f96e52e824.tar.gz |
Fix building for x32 target
* mpi/amd64/mpi-asm-defs.h: New file.
* random/rndhw.c (poll_padlock) [__x86_64__]: Also check if __LP64__ is
defined.
[USE_DRNG, __x86_64__]: Also check if __LP64__ is defined.
--
In short, x32 is new x86-64 ABI with 32-bit pointers. Adding support is
straightforward, small fix for mpi and fixes for random/rndhw.c. AMD64 assembly
functions appear to work fine with x32 and 'make check' passes.
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Diffstat (limited to 'random')
-rw-r--r-- | random/rndhw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/random/rndhw.c b/random/rndhw.c index ca99c5f8..e625512d 100644 --- a/random/rndhw.c +++ b/random/rndhw.c @@ -69,7 +69,7 @@ poll_padlock (void (*add)(const void*, size_t, enum random_origins), nbytes = 0; while (nbytes < 64) { -#ifdef __x86_64__ +#if defined(__x86_64__) && defined(__LP64__) asm volatile ("movq %1, %%rdi\n\t" /* Set buffer. */ "xorq %%rdx, %%rdx\n\t" /* Request up to 8 bytes. */ @@ -123,7 +123,7 @@ poll_padlock (void (*add)(const void*, size_t, enum random_origins), #ifdef USE_DRNG # define RDRAND_RETRY_LOOPS 10 # define RDRAND_INT ".byte 0x0f,0xc7,0xf0" -# ifdef __x86_64__ +# if defined(__x86_64__) && defined(__LP64__) # define RDRAND_LONG ".byte 0x48,0x0f,0xc7,0xf0" # else # define RDRAND_LONG RDRAND_INT |