Bug 1428182 - 7. Include <link.h> in LUL for Android; r=jseward
Modern NDK headers all have <link.h>, so we should always include it,
and still provide shims for anything we need that's not defined in
<link.h>.
MozReview-Commit-ID: GNBDIe73RFm
--- a/tools/profiler/lul/LulElfInt.h
+++ b/tools/profiler/lul/LulElfInt.h
@@ -49,16 +49,17 @@
#include "mozilla/Assertions.h"
#include "PlatformMacros.h"
// (derived from)
// elfutils.h: Utilities for dealing with ELF files.
//
+#include <link.h>
#if defined(GP_OS_android)
// From toolkit/crashreporter/google-breakpad/src/common/android/include/elf.h
// The Android headers don't always define this constant.
#ifndef EM_X86_64
#define EM_X86_64 62
#endif
@@ -70,27 +71,22 @@
#ifndef EM_S390
#define EM_S390 22
#endif
#ifndef NT_GNU_BUILD_ID
#define NT_GNU_BUILD_ID 3
#endif
+#ifndef ElfW
#define ElfW(type) _ElfW (Elf, ELFSIZE, type)
#define _ElfW(e,w,t) _ElfW_1 (e, w, _##t)
#define _ElfW_1(e,w,t) e##w##t
+#endif
-//FIXME
-extern "C" {
- extern char* basename(const char* path);
-};
-#else
-
-# include <link.h>
#endif
namespace lul {
// Traits classes so consumers can write templatized code to deal
// with specific ELF bits.
struct ElfClass32 {