ART: Fix Mac build
dl_iterate_context code should only be done when we're not on the
Mac. #ifdef out DlOpenOatFile::PreSetup code.
(cherry picked from commit fd5c59939dff010432eb97b3e1ab0ad96abf79a6)
Change-Id: I11e8f95e397a327f2aa0b749ecbf6f03bdb76f24
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index 5fbede5..83e594b 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -585,6 +585,11 @@
}
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 @@
PrintFileToLog("/proc/self/maps", LogSeverity::WARNING);
LOG(ERROR) << "File " << elf_filename << " loaded with dlopen but can not find its mmaps.";
}
+#endif
}
////////////////////////////////////////////////