OSDN Git Service

ART: Fix Mac build
authorAndreas Gampe <agampe@google.com>
Wed, 2 Dec 2015 19:53:26 +0000 (11:53 -0800)
committerAndreas Gampe <agampe@google.com>
Wed, 2 Dec 2015 19:53:26 +0000 (11:53 -0800)
dl_iterate_context code should only be done when we're not on the
Mac. #ifdef out DlOpenOatFile::PreSetup code.

Change-Id: I11e8f95e397a327f2aa0b749ecbf6f03bdb76f24

runtime/oat_file.cc

index 5fbede5..83e594b 100644 (file)
@@ -585,6 +585,11 @@ bool DlOpenOatFile::Dlopen(const std::string& elf_filename,
 }
 
 void DlOpenOatFile::PreSetup(const std::string& elf_filename) {
+#ifdef __APPLE__
+  UNUSED(elf_filename);
+  LOG(FATAL) << "Should not reach here.";
+  UNREACHABLE();
+#else
   struct dl_iterate_context {
     static int callback(struct dl_phdr_info *info, size_t /* size */, void *data) {
       auto* context = reinterpret_cast<dl_iterate_context*>(data);
@@ -624,6 +629,7 @@ void DlOpenOatFile::PreSetup(const std::string& elf_filename) {
     PrintFileToLog("/proc/self/maps", LogSeverity::WARNING);
     LOG(ERROR) << "File " << elf_filename << " loaded with dlopen but can not find its mmaps.";
   }
+#endif
 }
 
 ////////////////////////////////////////////////