BUILD: tools: fix build with static only toolchains
authorBaruch Siach <baruch@tkos.co.il>
Fri, 24 Jul 2020 04:52:20 +0000 (07:52 +0300)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Jul 2020 07:49:20 +0000 (09:49 +0200)
commitf281501e19a5c114e5daf3a51f903d03137b79a8
treeb73cbb38f502de2c403706ca12ac73ac22381be5
parent01bb09d71601285b0f79b1b7ee79be9b14e2a6a0
BUILD: tools: fix build with static only toolchains

uClibc toolchains built with no dynamic library support don't provide
the dlfcn.h header. That leads to build failure:

CC src/tools.o
src/tools.c:15:10: fatal error: dlfcn.h: No such file or directory
 #include <dlfcn.h>
          ^~~~~~~~~
Enable dladdr on Linux platforms only when USE_DL is defined.

This should be backported wherever 109201fc5 ("BUILD: tools: rely on
__ELF__ not USE_DL to enable use of dladdr()") is backported (currently
only 2.2 and 2.1).

(cherry picked from commit e1651b2970a699c517e185115e8f866dd5a04c92)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit c28833ecacd3cc315527003dca5b1ee7ac06a1c3)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/standard.c