Bug 1428182 - 7. Include <link.h> in LUL for Android; r=jseward draft
authorJim Chen <nchen@mozilla.com>
Tue, 30 Jan 2018 14:08:23 -0500
changeset 748994 c17d030e0066286364f575671d5802b383af68a9
parent 748993 a3ecd37922d1719a6b5b2ec30e393bb3604e39c5
child 748995 fbdfd41f323f6438830ceb54b9b98e00f6d6e300
push id97287
push userbmo:nchen@mozilla.com
push dateTue, 30 Jan 2018 19:09:20 +0000
reviewersjseward
bugs1428182
milestone60.0a1
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
tools/profiler/lul/LulElfInt.h
--- 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 {