Skip to content

Commit

Permalink
Avoid including <sys/syscall.h> on targets we already know about.
Browse files Browse the repository at this point in the history
When cross-compiling to i686-unknown-linux-gnu from
x86_64-unknown-linux-gnu I found that this header wasn't found and the
build broken. Avoid that happening by only including this header when
we don't already know what it will tell us.
  • Loading branch information
briansmith committed Feb 3, 2019
1 parent 32cf372 commit 03e6ef8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crypto/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@

#include <GFp/cpu.h>

#if defined(__linux__)
#include <sys/syscall.h>
#endif

#if defined(OPENSSL_WINDOWS)

#if defined(_MSC_VER)
Expand Down Expand Up @@ -81,10 +77,14 @@ HIDDEN uint32_t GFp_armcap_P = 0;
#elif defined(OPENSSL_X86_64)
#define SYS_getrandom 318
#else
#include <sys/syscall.h>
#if !defined(SYS_getrandom)
#error "Error: Kernel headers are too old; SYS_getrandom not defined."
#endif
#endif

#endif

const long GFp_SYS_GETRANDOM = SYS_getrandom;
#endif

Expand Down

0 comments on commit 03e6ef8

Please sign in to comment.