From 1af0c4ff8b79ad44a4e12d7271a66d4e775ba224 Mon Sep 17 00:00:00 2001 From: Julien Duraj Date: Wed, 16 Nov 2016 14:05:48 +0000 Subject: [PATCH] Fix the target Linux builds of ART When ART_TARGET_LINUX was set it would hit some pieces of dead code that were using old defines i.e. `__ANDROID__` Test: export ART_TARGET_LINUX=true Test: source build/envsetup.sh Test: lunch Test: cd art && mma Change-Id: I80102750192928606e0884d2b723a87ccb7d7e19 --- runtime/base/logging.cc | 2 +- runtime/oat_file.cc | 2 +- runtime/runtime.cc | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/base/logging.cc b/runtime/base/logging.cc index 6b21a566e..1dca4286d 100644 --- a/runtime/base/logging.cc +++ b/runtime/base/logging.cc @@ -80,7 +80,7 @@ void InitLogging(char* argv[], AbortFunction& abort_function) { gCmdLine.reset(new std::string("")); } -#ifdef __ANDROID__ +#ifdef ART_TARGET_ANDROID #define INIT_LOGGING_DEFAULT_LOGGER android::base::LogdLogger() #else #define INIT_LOGGING_DEFAULT_LOGGER android::base::StderrLogger diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc index 404e5ce1c..bdf8b0e65 100644 --- a/runtime/oat_file.cc +++ b/runtime/oat_file.cc @@ -719,7 +719,7 @@ bool DlOpenOatFile::Dlopen(const std::string& elf_filename, dlopen_handle_ = android_dlopen_ext(absolute_path.get(), RTLD_NOW, &extinfo); #else UNUSED(oat_file_begin); - static_assert(!kIsTargetBuild, "host_dlopen_handles_ will leak handles"); + static_assert(!kIsTargetBuild || kIsTargetLinux, "host_dlopen_handles_ will leak handles"); MutexLock mu(Thread::Current(), *Locks::host_dlopen_handles_lock_); dlopen_handle_ = dlopen(absolute_path.get(), RTLD_NOW); if (dlopen_handle_ != nullptr) { diff --git a/runtime/runtime.cc b/runtime/runtime.cc index 8a3bac77b..ee4d669fe 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -2183,7 +2183,7 @@ void Runtime::RemoveSystemWeakHolder(gc::AbstractSystemWeakHolder* holder) { NO_RETURN void Runtime::Aborter(const char* abort_message) { -#ifdef __ANDROID__ +#ifdef ART_TARGET_ANDROID android_set_abort_message(abort_message); #endif Runtime::Abort(abort_message); -- 2.11.0