blob: db1722a869233c7f7b0c1b0a27499d4f2b177460 [file] [log] [blame]
From eed8238837232a0e58ede4cfeca177eb6f53c28d Mon Sep 17 00:00:00 2001
From: Andrew Hsieh <andrewhsieh@google.com>
Date: Thu, 28 Feb 2013 12:48:48 +0800
Subject: [PATCH] Temp fix to transate GNU linker emulator to triple
Change-Id: I847f571422d72fe6607a54f482a5e772e8f585bc
---
tools/llvm-mcld/llvm-mcld.cpp | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/tools/llvm-mcld/llvm-mcld.cpp b/tools/llvm-mcld/llvm-mcld.cpp
index 088ba07..4a407be 100644
--- a/tools/llvm-mcld/llvm-mcld.cpp
+++ b/tools/llvm-mcld/llvm-mcld.cpp
@@ -1281,6 +1281,19 @@ int main(int argc, char* argv[])
}
Module &mod = *M.get();
+ if (TargetTriple.empty()) {
+ if (!ArgEmulation.empty()) {
+ if (ArgEmulation.find("arm") != std::string::npos)
+ TargetTriple = "arm-linux-androideabi";
+ else if (ArgEmulation.find("i386") != std::string::npos)
+ TargetTriple = "i686-linux-android";
+ else if (ArgEmulation.find("ltsmip") != std::string::npos)
+ TargetTriple = "mipsel-linux-android";
+ else
+ errs() << "** Unknown -m option " << ArgEmulation << " **\n";
+ }
+ }
+
// If we are supposed to override the target triple, do so now.
Triple TheTriple;
if (!TargetTriple.empty()) {
--
1.7.7.3