Fixes for gtests in eng-prod
Bug: 147817558
Test: art/art-host-gtest on forrest
Change-Id: I0ecfbc81fe6998d4c8c69ce6fbeb35bdd5908b55
diff --git a/runtime/arch/arm/instruction_set_features_arm.cc b/runtime/arch/arm/instruction_set_features_arm.cc
index fdf4dbd..b01f519 100644
--- a/runtime/arch/arm/instruction_set_features_arm.cc
+++ b/runtime/arch/arm/instruction_set_features_arm.cc
@@ -257,7 +257,7 @@
// Use compile time features to "detect" LPAE support.
// TODO: write an assembly LPAE support test.
-#if defined(__ARM_FEATURE_LPAE)
+#if defined (__ARM_ARCH_8A__) || defined(__ARM_FEATURE_LPAE)
const bool has_atomic_ldrd_strd = true;
#else
const bool has_atomic_ldrd_strd = false;
diff --git a/runtime/hidden_api_test.cc b/runtime/hidden_api_test.cc
index 16df6d7..e933c01 100644
--- a/runtime/hidden_api_test.cc
+++ b/runtime/hidden_api_test.cc
@@ -633,6 +633,7 @@
TEST_F(HiddenApiTest, DexDomain_SystemFrameworkDir) {
// Load file from a system/framework directory and check that it is flagged as a framework dex.
+ std::filesystem::create_directory(GetAndroidRoot() + "/framework");
std::string system_framework_location_path = GetAndroidRoot() + "/framework/foo.jar";
ASSERT_TRUE(LocationIsOnSystemFramework(system_framework_location_path.c_str()));
diff --git a/runtime/native_stack_dump.cc b/runtime/native_stack_dump.cc
index 74d9033..4b2409b 100644
--- a/runtime/native_stack_dump.cc
+++ b/runtime/native_stack_dump.cc
@@ -69,14 +69,12 @@
static constexpr bool kUseAddr2line = !kIsTargetBuild;
std::string FindAddr2line() {
- if (!kIsTargetBuild) {
- constexpr const char* kAddr2linePrebuiltPath =
- "/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.17-4.8/bin/x86_64-linux-addr2line";
- const char* env_value = getenv("ANDROID_BUILD_TOP");
- if (env_value != nullptr) {
- return std::string(env_value) + kAddr2linePrebuiltPath;
- }
+#ifndef ART_TARGET_ANDROID
+ const char* env_value = getenv("ANDROID_BUILD_TOP");
+ if (env_value != nullptr) {
+ return std::string(env_value) + "/" + ART_CLANG_PATH + "/bin/llvm-addr2line";
}
+#endif
return std::string("/usr/bin/addr2line");
}
@@ -274,7 +272,7 @@
}
// Send the offset.
- const std::string hex_offset = StringPrintf("%zx\n", offset);
+ const std::string hex_offset = StringPrintf("0x%zx\n", offset);
if (!pipe_ptr->out.WriteFully(hex_offset.data(), hex_offset.length())) {
// Error. :-(
diff --git a/runtime/prebuilt_tools_test.cc b/runtime/prebuilt_tools_test.cc
index 17c0d42..e05a8e4 100644
--- a/runtime/prebuilt_tools_test.cc
+++ b/runtime/prebuilt_tools_test.cc
@@ -28,7 +28,7 @@
class PrebuiltToolsTest : public CommonRuntimeTest {
public:
static void CheckToolsExist(InstructionSet isa) {
- const char* tools[] = { "clang", "llvm-objdump" };
+ const char* tools[] = { "clang", "llvm-addr2line", "llvm-dwarfdump", "llvm-objdump" };
for (const char* tool : tools) {
std::string path = GetAndroidTool(tool, isa);
ASSERT_TRUE(OS::FileExists(path.c_str())) << path;