]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: make dladdr1 depend on glibc version and not __USE_GNU
authorWilly Tarreau <w@1wt.eu>
Tue, 10 Mar 2020 06:51:48 +0000 (07:51 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 10 Mar 2020 06:53:10 +0000 (07:53 +0100)
Technically speaking the call was implemented in glibc 2.3 so we must
rely on this and not on __USE_GNU which is an internal define of glibc
to track use of GNU_SOURCE.

src/standard.c

index e0ea8328efd04ca6c8a51f5773fca0492ad92a1d..d16eebfea83248dbc8478d5de2d6f7611f161c69 100644 (file)
@@ -4342,7 +4342,7 @@ void debug_hexdump(FILE *out, const char *pfx, const char *buf,
 static int dladdr_and_size(const void *addr, Dl_info *dli, size_t *size)
 {
        int ret;
-#ifdef __USE_GNU // most detailed one
+#if (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 3)) // most detailed one
        const ElfW(Sym) *sym;
 
        ret = dladdr1(addr, dli, (void **)&sym, RTLD_DL_SYMENT);