util/build_id: Include <dlfcn.h>
authorChad Versace <chadversary@chromium.org>
Wed, 13 Sep 2017 18:51:04 +0000 (11:51 -0700)
committerChad Versace <chadversary@chromium.org>
Wed, 13 Sep 2017 19:43:42 +0000 (12:43 -0700)
Fix the build for Android Nougat.

The dladdr(3) manpage says that <dlfcn.h> is required. On Linux, the
build succeeded without it because build_id.c includes <link.h> which
includes <dlfcn.h>. On Android, we must include <dlfcn.h> directly.

Fixes: 5c98d382 "util: Query build-id by symbol address, not library name"
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/util/build_id.c

index 6280b4a54e363fe95aa79051d0dd6fe439cce401..536c74360ea83962503f7e02f1d4ba45b856cffc 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #ifdef HAVE_DL_ITERATE_PHDR
+#include <dlfcn.h>
 #include <link.h>
 #include <stddef.h>
 #include <string.h>