From 3005306a7143f065f99b0231ed1f350b7226e898 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 20 Aug 2020 16:39:14 +0200 Subject: [PATCH] BUILD: tools: include auxv a bit later As reported in https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24745, haproxy fails to build with TARGET=generic and without extra options due to auxv.h not being included, since the __GLIBC__ macro is not yet defined. Let's include it after other libc headers so that the __GLIBC__ definition is known. Thanks to David and Tim for the diag. This should be backported to 2.2. --- src/tools.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/tools.c b/src/tools.c index f148f356c..b5cc30e68 100644 --- a/src/tools.c +++ b/src/tools.c @@ -16,10 +16,6 @@ #include #endif -#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) -#include -#endif - #include #include #include @@ -36,6 +32,10 @@ #include #include +#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16)) +#include +#endif + #include #include