On Fri, Jul 24, 2020 at 07:40:01AM +0200, Willy Tarreau wrote:
> On Fri, Jul 24, 2020 at 07:52:20AM +0300, Baruch Siach wrote:
> > 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 only when USE_DL is defined.
> 
> Oh thank you, I've encountered it as well a few days ago while working
> on something else and forgot to note it on my todo list! However, I'm
> looking at the original commit which introduced this and it's almost a
> revert. We used to rely on USE_DL and turned it into __ELF__ because
> some platforms don't need USE_DL.
> 
> I wanted to turn to sets of WANT/NEED/HAVE instead of the generic USE,
> and I think this one will be one of the first benefiting from this. I'll
> have a look at this.

In order to make something less intrusive that may be backported to 2.2
and 2.1, what do you think about this:

-#ifdef __ELF__
+#if (defined(__ELF__) && !defined(__linux__)) || defined(USE_DL)

=> __ELF__ is enough on all non-linux platforms
   USE_DL is required on linux

This would not change much from your patch and limit the scope of changes
for stable versions. If you can confirm that it works for you, I can adapt
your patch to do that and commit it (unless you prefer to send a v2, of
course).

Thanks,
Willy

Reply via email to