Skip to content

Commit

Permalink
src/symbolize.cc: fix build without dlfcn.h
Browse files Browse the repository at this point in the history
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  • Loading branch information
ffontaine committed Oct 29, 2019
1 parent 4cc89c9 commit 10498b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/symbolize.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,9 @@ _END_GOOGLE_NAMESPACE_

#if defined(__ELF__)

#if defined(HAVE_DLFCN_H)
#include <dlfcn.h>
#endif
#if defined(OS_OPENBSD)
#include <sys/exec_elf.h>
#else
Expand Down Expand Up @@ -832,7 +834,7 @@ static ATTRIBUTE_NOINLINE bool SymbolizeAndDemangle(void *pc, char *out,

_END_GOOGLE_NAMESPACE_

#elif defined(OS_MACOSX) && defined(HAVE_DLADDR)
#elif defined(OS_MACOSX) && defined(HAVE_DLADDR) && defined(HAVE_DLFCN_H)

#include <dlfcn.h>
#include <string.h>
Expand Down

2 comments on commit 10498b4

@Yannic
Copy link

@Yannic Yannic commented on 10498b4 Nov 1, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ffontaine
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with this platform but I'll do my best to fix it. I saw that you have two build systems: cmake and autotools. If macOS uses autotools then it could explain the issue as the HAVE_DLFCN_H check is only present in the CMakeLists.txt so I can fix this first issue.

However if macOS also uses cmake, there is probably another issue. I can always remove the && defined(HAVE_DLFCN_H) from the macOS branch.

Please sign in to comment.