From: Willy Tarreau Date: Thu, 20 Aug 2020 14:39:14 +0000 (+0200) Subject: BUILD: tools: include auxv a bit later X-Git-Tag: v2.3-dev4~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3005306a7143f065f99b0231ed1f350b7226e898;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/tools.c b/src/tools.c index f148f356c3..b5cc30e68d 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