aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2008-01-30 19:19:31 +0000
committerDevang Patel <dpatel@apple.com>2008-01-30 19:19:31 +0000
commiteb9964cfb26428758ed23e2ff2ed2ba49d0dfa17 (patch)
treeab5611a237d612a65740c49c074a9fb19898685a /tools
parent3bb9df92ebe73f06efa266779f92cb2b799f6991 (diff)
downloadexternal_llvm-eb9964cfb26428758ed23e2ff2ed2ba49d0dfa17.zip
external_llvm-eb9964cfb26428758ed23e2ff2ed2ba49d0dfa17.tar.gz
external_llvm-eb9964cfb26428758ed23e2ff2ed2ba49d0dfa17.tar.bz2
Supply appropriate arch info to darwin assembler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46567 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/lto/lto.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/lto/lto.cpp b/tools/lto/lto.cpp
index 963c67e..c7a3637 100644
--- a/tools/lto/lto.cpp
+++ b/tools/lto/lto.cpp
@@ -489,6 +489,22 @@ LTO::optimizeModules(const std::string &OutputFilename,
std::vector<const char*> args;
args.push_back(gcc.c_str());
+ if (strncmp(targetTriple.c_str(), "i686-apple-", 11) == 0) {
+ args.push_back("-arch");
+ args.push_back("i386");
+ }
+ if (strncmp(targetTriple.c_str(), "x86_64-apple-", 13) == 0) {
+ args.push_back("-arch");
+ args.push_back("x86_64");
+ }
+ if (strncmp(targetTriple.c_str(), "powerpc-apple-", 14) == 0) {
+ args.push_back("-arch");
+ args.push_back("ppc");
+ }
+ if (strncmp(targetTriple.c_str(), "powerpc64-apple-", 16) == 0) {
+ args.push_back("-arch");
+ args.push_back("ppc64");
+ }
args.push_back("-c");
args.push_back("-x");
args.push_back("assembler");