summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Allison <dallison@google.com>2014-06-05 13:58:56 -0700
committerDave Allison <dallison@google.com>2014-06-05 13:58:56 -0700
commitc819e0d9485f23a8dcfc94419292dcd053053eb9 (patch)
tree0f5815bd47c472d6bab53d281d771a632486d636
parent0eb3e752b65ef908e3790d81fae57cd85a41006b (diff)
downloadart-c819e0d9485f23a8dcfc94419292dcd053053eb9.zip
art-c819e0d9485f23a8dcfc94419292dcd053053eb9.tar.gz
art-c819e0d9485f23a8dcfc94419292dcd053053eb9.tar.bz2
Fix assembler test to use path if it can't find tools.
This fixes build breakage. Change-Id: I8074d47f1c1470cf886d517e9e68a6a6b4330485
-rw-r--r--compiler/utils/assembler_thumb_test.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/utils/assembler_thumb_test.cc b/compiler/utils/assembler_thumb_test.cc
index b1eaba7..f46e872 100644
--- a/compiler/utils/assembler_thumb_test.cc
+++ b/compiler/utils/assembler_thumb_test.cc
@@ -69,12 +69,12 @@ std::string GetAndroidToolsDir() {
}
bool statok = stat(toolsdir.c_str(), &st) == 0;
if (!statok) {
- LOG(FATAL) << "Cannot find ARM tools directory";
+ return ""; // Use path.
}
DIR* dir = opendir(toolsdir.c_str());
if (dir == nullptr) {
- LOG(FATAL) << "Unable to open ARM tools directory";
+ return ""; // Use path.
}
struct dirent* entry;
@@ -98,10 +98,10 @@ std::string GetAndroidToolsDir() {
closedir(dir);
bool found = founddir != "";
if (!found) {
- LOG(FATAL) << "Cannot find arm-eabi tools";
+ return ""; // Use path.
}
- return founddir + "/bin";
+ return founddir + "/bin/";
}
void dump(std::vector<uint8_t>& code, const char* testname) {
@@ -145,18 +145,18 @@ void dump(std::vector<uint8_t>& code, const char* testname) {
char cmd[256];
// Assemble the .S
- snprintf(cmd, sizeof(cmd), "%s/arm-eabi-as %s -o %s.o", toolsdir.c_str(), filename, filename);
+ snprintf(cmd, sizeof(cmd), "%sarm-eabi-as %s -o %s.o", toolsdir.c_str(), filename, filename);
system(cmd);
// Remove the $d symbols to prevent the disassembler dumping the instructions
// as .word
- snprintf(cmd, sizeof(cmd), "%s/arm-eabi-objcopy -N '$d' %s.o %s.oo", toolsdir.c_str(),
+ snprintf(cmd, sizeof(cmd), "%sarm-eabi-objcopy -N '$d' %s.o %s.oo", toolsdir.c_str(),
filename, filename);
system(cmd);
// Disassemble.
- snprintf(cmd, sizeof(cmd), "%s/arm-eabi-objdump -d %s.oo | grep '^ *[0-9a-f][0-9a-f]*:'",
+ snprintf(cmd, sizeof(cmd), "%sarm-eabi-objdump -d %s.oo | grep '^ *[0-9a-f][0-9a-f]*:'",
toolsdir.c_str(), filename);
if (kPrintResults) {
// Print the results only, don't check. This is used to generate new output for inserting