From 03e6ef8c01209d8b518daa45ded3164666c992a8 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Fri, 18 Jan 2019 00:41:16 -1000 Subject: [PATCH] Avoid including on targets we already know about. 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. --- crypto/crypto.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crypto/crypto.c b/crypto/crypto.c index 9c30693df9..6456dffefb 100644 --- a/crypto/crypto.c +++ b/crypto/crypto.c @@ -18,10 +18,6 @@ #include -#if defined(__linux__) -#include -#endif - #if defined(OPENSSL_WINDOWS) #if defined(_MSC_VER) @@ -81,10 +77,14 @@ HIDDEN uint32_t GFp_armcap_P = 0; #elif defined(OPENSSL_X86_64) #define SYS_getrandom 318 #else +#include +#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