From 52ed9ad728bf03cc996feff6b3874c1c5a3d0a1f Mon Sep 17 00:00:00 2001 From: Tong Shen Date: Fri, 5 Sep 2014 11:58:09 -0700 Subject: ART: Fix host test failure (assembler_thumb_test). Check if "bin/{as,objcopy,objdump}" exists in the tools dir we found in "prebuilts/gcc/linux-x86/arm/". Now there's an empty tree in platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.9, causing assembler_thumb_test to fail. Change-Id: If6ba4f778b79f95239aa85e54816ab168e7d8940 --- compiler/utils/assembler_thumb_test.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'compiler/utils/assembler_thumb_test.cc') diff --git a/compiler/utils/assembler_thumb_test.cc b/compiler/utils/assembler_thumb_test.cc index 891a287666..e3a9580737 100644 --- a/compiler/utils/assembler_thumb_test.cc +++ b/compiler/utils/assembler_thumb_test.cc @@ -116,6 +116,19 @@ std::string GetAndroidToolsDir() { std::string subdir = toolsdir + std::string("/") + std::string(entry->d_name); size_t eabi = subdir.find(TOOL_PREFIX); if (eabi != std::string::npos) { + // Check if "bin/{as,objcopy,objdump}" exist under this folder. + struct stat exec_st; + std::string exec_path; + exec_path = subdir + "/bin/" + TOOL_PREFIX + "as"; + if (stat(exec_path.c_str(), &exec_st) != 0) + continue; + exec_path = subdir + "/bin/" + TOOL_PREFIX + "objcopy"; + if (stat(exec_path.c_str(), &exec_st) != 0) + continue; + exec_path = subdir + "/bin/" + TOOL_PREFIX + "objdump"; + if (stat(exec_path.c_str(), &exec_st) != 0) + continue; + std::string suffix = subdir.substr(eabi + strlen(TOOL_PREFIX)); double version = strtod(suffix.c_str(), nullptr); if (version > maxversion) { -- cgit v1.2.3-59-g8ed1b