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.
This commit is contained in:
Willy Tarreau 2020-08-20 16:39:14 +02:00
parent 6d59993cb8
commit 3005306a71

View File

@ -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>