packages/net/haproxy/patches/000-OPENWRT-BUILD-make-dladdr1-depend-on-glibc-version-and-not-__USE_GNU.patch
Christian Lachner 169a431273 haproxy: Update HAProxy to v2.1.5
- Update haproxy download URL and hash
- This version introduces backtrace-support via backtrace(), however, it must be disabled because neither MUSL nor UCLIBC support it (build fails because of missing execinfo.h)
- Our previous UCLIBC patch is now obsolete and has been removed. We now only disable libcrypt support.
- A new patch was backported from the haproxy dev-branch which fixes an IFDEF which should only allow GLIBC to use dladdr1 and make builds fall back to dladdr when using other c-libs. The previous logic was bogus and broke the build on UCLIBC.

Signed-off-by: Christian Lachner <gladiac@gmail.com>
2020-05-31 20:32:24 +02:00

23 lines
879 B
Diff

commit 62af9c83f9ed2b25e0061798e29e3cccfce5fbdc
Author: Willy Tarreau <w@1wt.eu>
Date: Tue Mar 10 07:51:48 2020 +0100
BUILD: make dladdr1 depend on glibc version and not __USE_GNU
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.
diff --git a/src/standard.c b/src/standard.c
index e0ea8328e..d16eebfea 100644
--- a/src/standard.c
+++ b/src/standard.c
@@ -4350,7 +4350,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);