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 f148f35..b5cc30e 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -16,10 +16,6 @@
#include <link.h>
#endif
-#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16))
-#include <sys/auxv.h>
-#endif
-
#include <ctype.h>
#include <errno.h>
#include <netdb.h>
@@ -36,6 +32,10 @@
#include <netinet/in.h>
#include <arpa/inet.h>
+#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 16))
+#include <sys/auxv.h>
+#endif
+
#include <import/eb32sctree.h>
#include <import/eb32tree.h>