Updates for LLVM merge to r171906 on 20130108.

Change-Id: I096cb90103b19e3110ea562d60e5eb8ad48d9b67
diff --git a/lib/AndroidBitcode/ABCCompiler.cpp b/lib/AndroidBitcode/ABCCompiler.cpp
index 8393d48..2a6a601 100644
--- a/lib/AndroidBitcode/ABCCompiler.cpp
+++ b/lib/AndroidBitcode/ABCCompiler.cpp
@@ -16,9 +16,9 @@
 
 #include "bcc/AndroidBitcode/ABCCompiler.h"
 
-#include <llvm/Module.h>
+#include <llvm/IR/Module.h>
 #include <llvm/PassManager.h>
-#include <llvm/Target/TargetData.h>
+#include <llvm/IR/DataLayout.h>
 #include <llvm/Target/TargetMachine.h>
 
 #include "bcc/AndroidBitcode/ABCCompilerDriver.h"
@@ -34,14 +34,14 @@
   llvm::PassManager pm;
   llvm::Module &module = pScript.getSource().getModule();
   const llvm::TargetMachine &tm = getTargetMachine();
-  llvm::TargetData *target_data =
-    new (std::nothrow) llvm::TargetData(*(tm.getTargetData()));
+  llvm::DataLayout *data_layout =
+    new (std::nothrow) llvm::DataLayout(*(tm.getDataLayout()));
 
-  if (target_data == NULL) {
+  if (data_layout == NULL) {
     return false;
   }
 
-  pm.add(target_data);
+  pm.add(data_layout);
   pm.add(mDriver.createExpandVAArgPass());
   pm.run(module);
 
diff --git a/lib/AndroidBitcode/ABCCompilerDriver.cpp b/lib/AndroidBitcode/ABCCompilerDriver.cpp
index 1e5e906..8139630 100644
--- a/lib/AndroidBitcode/ABCCompilerDriver.cpp
+++ b/lib/AndroidBitcode/ABCCompilerDriver.cpp
@@ -16,7 +16,7 @@
 
 #include "bcc/AndroidBitcode/ABCCompilerDriver.h"
 
-#include <llvm/Module.h>
+#include <llvm/IR/Module.h>
 #include <llvm/Pass.h>
 #include <llvm/Support/MemoryBuffer.h>
 #include <llvm/Support/raw_ostream.h>
@@ -195,14 +195,6 @@
   mLinker.addObject(const_cast<char *>(input_relocatable.data()),
                     input_relocatable.size());
 
-  // Read dependent library list.
-  const Source &source = pScript.getSource();
-  for (llvm::Module::lib_iterator lib_iter = source.getModule().lib_begin(),
-          lib_end = source.getModule().lib_end(); lib_iter != lib_end;
-       ++lib_iter) {
-    mLinker.addNameSpec(*lib_iter);
-  }
-
   // TODO: Refactor libbcc/runtime/ to libcompilerRT.so and use it.
   mLinker.addNameSpec("bcc");
 
diff --git a/lib/AndroidBitcode/ABCExpandVAArgPass.cpp b/lib/AndroidBitcode/ABCExpandVAArgPass.cpp
index 1f0debf..29e3f2c 100644
--- a/lib/AndroidBitcode/ABCExpandVAArgPass.cpp
+++ b/lib/AndroidBitcode/ABCExpandVAArgPass.cpp
@@ -20,7 +20,7 @@
 #include "bcc/AndroidBitcode/ABCExpandVAArgPass.h"
 
 #include <llvm/ADT/STLExtras.h>
-#include <llvm/Instructions.h>
+#include <llvm/IR/Instructions.h>
 #include <llvm/Support/InstIterator.h>
 
 namespace bcc {
diff --git a/lib/AndroidBitcode/ARM/ARMABCExpandVAArg.cpp b/lib/AndroidBitcode/ARM/ARMABCExpandVAArg.cpp
index 7f154af..2f6a2eb 100644
--- a/lib/AndroidBitcode/ARM/ARMABCExpandVAArg.cpp
+++ b/lib/AndroidBitcode/ARM/ARMABCExpandVAArg.cpp
@@ -15,14 +15,14 @@
  */
 
 #include <llvm/ADT/Triple.h>
-#include <llvm/DerivedTypes.h>
-#include <llvm/Function.h>
-#include <llvm/Instructions.h>
-#include <llvm/IRBuilder.h>
-#include <llvm/Module.h>
+#include <llvm/IR/DerivedTypes.h>
+#include <llvm/IR/Function.h>
+#include <llvm/IR/Instructions.h>
+#include <llvm/IR/IRBuilder.h>
+#include <llvm/IR/Module.h>
 #include <llvm/Pass.h>
-#include <llvm/Type.h>
-#include <llvm/Target/TargetData.h>
+#include <llvm/IR/Type.h>
+#include <llvm/IR/DataLayout.h>
 
 #include "bcc/AndroidBitcode/ABCExpandVAArgPass.h"
 
@@ -43,7 +43,7 @@
     llvm::Type *ty = pty->getContainedType(0);
     llvm::Value *va_list_addr = pInst->getOperand(0);
     llvm::IRBuilder<> builder(pInst);
-    const llvm::TargetData *td = getAnalysisIfAvailable<llvm::TargetData>();
+    const llvm::DataLayout *dl = getAnalysisIfAvailable<llvm::DataLayout>();
 
     llvm::Type *bp = llvm::Type::getInt8PtrTy(*mContext);
     llvm::Type *bpp = bp->getPointerTo(0);
@@ -52,7 +52,7 @@
         builder.CreateBitCast(va_list_addr, bpp, "ap");
     llvm::Value *addr = builder.CreateLoad(va_list_addr_bpp, "ap.cur");
     // Handle address alignment for type alignment > 32 bits.
-    uint64_t ty_align = td->getABITypeAlignment(ty);
+    uint64_t ty_align = dl->getABITypeAlignment(ty);
 
     if (ty_align > 4) {
       assert((ty_align & (ty_align - 1)) == 0 &&
@@ -67,7 +67,7 @@
     }
     llvm::Value *addr_typed = builder.CreateBitCast(addr, pty);
 
-    uint64_t offset = llvm::RoundUpToAlignment(td->getTypeSizeInBits(ty)/8, 4);
+    uint64_t offset = llvm::RoundUpToAlignment(dl->getTypeSizeInBits(ty)/8, 4);
     llvm::Value *next_addr = builder.CreateGEP(addr,
       llvm::ConstantInt::get(llvm::Type::getInt32Ty(*mContext), offset),
       "ap.next");
diff --git a/lib/AndroidBitcode/Mips/MipsABCExpandVAArg.cpp b/lib/AndroidBitcode/Mips/MipsABCExpandVAArg.cpp
index 495cef4..d211ccb 100644
--- a/lib/AndroidBitcode/Mips/MipsABCExpandVAArg.cpp
+++ b/lib/AndroidBitcode/Mips/MipsABCExpandVAArg.cpp
@@ -15,14 +15,14 @@
  */
 
 #include <llvm/ADT/Triple.h>
-#include <llvm/DerivedTypes.h>
-#include <llvm/Function.h>
-#include <llvm/Instructions.h>
-#include <llvm/IRBuilder.h>
-#include <llvm/Module.h>
+#include <llvm/IR/DerivedTypes.h>
+#include <llvm/IR/Function.h>
+#include <llvm/IR/Instructions.h>
+#include <llvm/IR/IRBuilder.h>
+#include <llvm/IR/Module.h>
 #include <llvm/Pass.h>
-#include <llvm/Type.h>
-#include <llvm/Target/TargetData.h>
+#include <llvm/IR/Type.h>
+#include <llvm/IR/DataLayout.h>
 
 #include "bcc/AndroidBitcode/ABCExpandVAArgPass.h"
 
@@ -43,14 +43,14 @@
     llvm::Type *ty = pty->getContainedType(0);
     llvm::Value *va_list_addr = pInst->getOperand(0);
     llvm::IRBuilder<> builder(pInst);
-    const llvm::TargetData *td = getAnalysisIfAvailable<llvm::TargetData>();
+    const llvm::DataLayout *dl = getAnalysisIfAvailable<llvm::DataLayout>();
 
     llvm::Type *bp = llvm::Type::getInt8PtrTy(*mContext);
     llvm::Type *bpp = bp->getPointerTo(0);
     llvm::Value *va_list_addr_bpp = builder.CreateBitCast(va_list_addr,
                                                           bpp, "ap");
     llvm::Value *addr = builder.CreateLoad(va_list_addr_bpp, "ap.cur");
-    int64_t type_align = td->getABITypeAlignment(ty);
+    int64_t type_align = dl->getABITypeAlignment(ty);
     llvm::Value *addr_typed;
     llvm::IntegerType *int_ty = llvm::Type::getInt32Ty(*mContext);
 
@@ -69,7 +69,7 @@
     llvm::Value *aligned_addr = builder.CreateBitCast(addr_typed, bp);
     type_align = std::max((unsigned)type_align, (unsigned) 4);
     uint64_t offset =
-      llvm::RoundUpToAlignment(td->getTypeSizeInBits(ty) / 8, type_align);
+      llvm::RoundUpToAlignment(dl->getTypeSizeInBits(ty) / 8, type_align);
     llvm::Value *next_addr =
       builder.CreateGEP(aligned_addr, llvm::ConstantInt::get(int_ty, offset),
                         "ap.next");
diff --git a/lib/AndroidBitcode/X86/X86ABCExpandVAArg.cpp b/lib/AndroidBitcode/X86/X86ABCExpandVAArg.cpp
index 6d9acbc..64fa358 100644
--- a/lib/AndroidBitcode/X86/X86ABCExpandVAArg.cpp
+++ b/lib/AndroidBitcode/X86/X86ABCExpandVAArg.cpp
@@ -15,14 +15,14 @@
  */
 
 #include <llvm/ADT/Triple.h>
-#include <llvm/DerivedTypes.h>
-#include <llvm/Function.h>
-#include <llvm/Instructions.h>
-#include <llvm/IRBuilder.h>
-#include <llvm/Module.h>
+#include <llvm/IR/DerivedTypes.h>
+#include <llvm/IR/Function.h>
+#include <llvm/IR/Instructions.h>
+#include <llvm/IR/IRBuilder.h>
+#include <llvm/IR/Module.h>
 #include <llvm/Pass.h>
-#include <llvm/Type.h>
-#include <llvm/Target/TargetData.h>
+#include <llvm/IR/Type.h>
+#include <llvm/IR/DataLayout.h>
 
 #include "bcc/AndroidBitcode/ABCExpandVAArgPass.h"
 
@@ -43,7 +43,7 @@
     llvm::Type *ty = pty->getContainedType(0);
     llvm::Value *va_list_addr = pInst->getOperand(0);
     llvm::IRBuilder<> builder(pInst);
-    const llvm::TargetData *td = getAnalysisIfAvailable<llvm::TargetData>();
+    const llvm::DataLayout *dl = getAnalysisIfAvailable<llvm::DataLayout>();
 
     llvm::Type *bp = llvm::Type::getInt8PtrTy(*mContext);
     llvm::Type *bpp = bp->getPointerTo(0);
@@ -54,7 +54,7 @@
     llvm::Value *addr_typed = builder.CreateBitCast(addr, pty);
 
     // X86-32 stack type alignment is always 4.
-    uint64_t offset = llvm::RoundUpToAlignment(td->getTypeSizeInBits(ty)/8, 4);
+    uint64_t offset = llvm::RoundUpToAlignment(dl->getTypeSizeInBits(ty)/8, 4);
     llvm::Value *next_addr = builder.CreateGEP(addr,
       llvm::ConstantInt::get(llvm::Type::getInt32Ty(*mContext), offset),
       "ap.next");
diff --git a/lib/Core/BCCContextImpl.h b/lib/Core/BCCContextImpl.h
index a63af49..bcac0c5 100644
--- a/lib/Core/BCCContextImpl.h
+++ b/lib/Core/BCCContextImpl.h
@@ -18,7 +18,7 @@
 #define BCC_CORE_CONTEXT_IMPL_H
 
 #include <llvm/ADT/SmallPtrSet.h>
-#include <llvm/LLVMContext.h>
+#include <llvm/IR/LLVMContext.h>
 
 namespace bcc {
 
diff --git a/lib/Core/Compiler.cpp b/lib/Core/Compiler.cpp
index c229098..458fbc0 100644
--- a/lib/Core/Compiler.cpp
+++ b/lib/Core/Compiler.cpp
@@ -18,11 +18,11 @@
 
 #include <llvm/Analysis/Passes.h>
 #include <llvm/CodeGen/RegAllocRegistry.h>
-#include <llvm/Module.h>
+#include <llvm/IR/Module.h>
 #include <llvm/PassManager.h>
 #include <llvm/Support/TargetRegistry.h>
 #include <llvm/Support/raw_ostream.h>
-#include <llvm/Target/TargetData.h>
+#include <llvm/IR/DataLayout.h>
 #include <llvm/Target/TargetMachine.h>
 #include <llvm/Transforms/IPO.h>
 #include <llvm/Transforms/Scalar.h>
@@ -49,8 +49,8 @@
     /* kErrNoTargetMachine */
     "Failed to compile the script since there's no available TargetMachine."
     " (missing call to Compiler::config()?)",
-    /* kErrTargetDataNoMemory */
-    "Out of memory when create TargetData during compilation.",
+    /* kErrDataLayoutNoMemory */
+    "Out of memory when create DataLayout during compilation.",
     /* kErrMaterialization */
     "Failed to materialize the module.",
     /* kErrInvalidOutputFileState */
@@ -153,19 +153,19 @@
 }
 
 enum Compiler::ErrorCode Compiler::runLTO(Script &pScript) {
-  llvm::TargetData *target_data = NULL;
+  llvm::DataLayout *data_layout = NULL;
 
   // Pass manager for link-time optimization
   llvm::PassManager lto_passes;
 
-  // Prepare TargetData target data from Module
-  target_data = new (std::nothrow) llvm::TargetData(*mTarget->getTargetData());
-  if (target_data == NULL) {
-    return kErrTargetDataNoMemory;
+  // Prepare DataLayout target data from Module
+  data_layout = new (std::nothrow) llvm::DataLayout(*mTarget->getDataLayout());
+  if (data_layout == NULL) {
+    return kErrDataLayoutNoMemory;
   }
 
-  // Add TargetData to the pass manager.
-  lto_passes.add(target_data);
+  // Add DataLayout to the pass manager.
+  lto_passes.add(data_layout);
 
   // Invokde "beforeAddLTOPasses" before adding the first pass.
   if (!beforeAddLTOPasses(pScript, lto_passes)) {
@@ -278,20 +278,20 @@
 
 enum Compiler::ErrorCode Compiler::runCodeGen(Script &pScript,
                                               llvm::raw_ostream &pResult) {
-  llvm::TargetData *target_data;
+  llvm::DataLayout *data_layout;
   llvm::MCContext *mc_context = NULL;
 
   // Create pass manager for MC code generation.
   llvm::PassManager codegen_passes;
 
-  // Prepare TargetData target data from Module
-  target_data = new (std::nothrow) llvm::TargetData(*mTarget->getTargetData());
-  if (target_data == NULL) {
-    return kErrTargetDataNoMemory;
+  // Prepare DataLayout target data from Module
+  data_layout = new (std::nothrow) llvm::DataLayout(*mTarget->getDataLayout());
+  if (data_layout == NULL) {
+    return kErrDataLayoutNoMemory;
   }
 
-  // Add TargetData to the pass manager.
-  codegen_passes.add(target_data);
+  // Add DataLayout to the pass manager.
+  codegen_passes.add(data_layout);
 
   // Invokde "beforeAddCodeGenPasses" before adding the first pass.
   if (!beforeAddCodeGenPasses(pScript, codegen_passes)) {
diff --git a/lib/Core/Source.cpp b/lib/Core/Source.cpp
index 3d712e6..6fa7882 100644
--- a/lib/Core/Source.cpp
+++ b/lib/Core/Source.cpp
@@ -19,9 +19,9 @@
 #include <new>
 
 #include <llvm/Bitcode/ReaderWriter.h>
-#include <llvm/LLVMContext.h>
+#include <llvm/IR/LLVMContext.h>
 #include <llvm/Linker.h>
-#include <llvm/Module.h>
+#include <llvm/IR/Module.h>
 #include <llvm/Support/MemoryBuffer.h>
 #include <llvm/Support/system_error.h>
 
diff --git a/lib/Renderscript/RSCompiler.cpp b/lib/Renderscript/RSCompiler.cpp
index ce43e8b..618c1c3 100644
--- a/lib/Renderscript/RSCompiler.cpp
+++ b/lib/Renderscript/RSCompiler.cpp
@@ -16,7 +16,7 @@
 
 #include "bcc/Renderscript/RSCompiler.h"
 
-#include <llvm/Module.h>
+#include <llvm/IR/Module.h>
 #include <llvm/PassManager.h>
 #include <llvm/Transforms/IPO.h>
 
diff --git a/lib/Renderscript/RSEmbedInfo.cpp b/lib/Renderscript/RSEmbedInfo.cpp
index faa71bf..6f6e9db 100644
--- a/lib/Renderscript/RSEmbedInfo.cpp
+++ b/lib/Renderscript/RSEmbedInfo.cpp
@@ -20,15 +20,14 @@
 #include <cstdlib>
 #include <vector>
 
-#include <llvm/DerivedTypes.h>
-#include <llvm/Function.h>
-#include <llvm/Instructions.h>
-#include <llvm/IRBuilder.h>
-#include <llvm/Module.h>
+#include <llvm/IR/DerivedTypes.h>
+#include <llvm/IR/Function.h>
+#include <llvm/IR/Instructions.h>
+#include <llvm/IR/IRBuilder.h>
+#include <llvm/IR/Module.h>
 #include <llvm/Pass.h>
 #include <llvm/Support/raw_ostream.h>
-#include <llvm/Target/TargetData.h>
-#include <llvm/Type.h>
+#include <llvm/IR/Type.h>
 
 #include "bcc/Config/Config.h"
 #include "bcc/Renderscript/RSInfo.h"
diff --git a/lib/Renderscript/RSForEachExpand.cpp b/lib/Renderscript/RSForEachExpand.cpp
index 443f0af..bf1a199 100644
--- a/lib/Renderscript/RSForEachExpand.cpp
+++ b/lib/Renderscript/RSForEachExpand.cpp
@@ -19,15 +19,15 @@
 
 #include <cstdlib>
 
-#include <llvm/DerivedTypes.h>
-#include <llvm/Function.h>
-#include <llvm/Instructions.h>
-#include <llvm/IRBuilder.h>
-#include <llvm/Module.h>
+#include <llvm/IR/DerivedTypes.h>
+#include <llvm/IR/Function.h>
+#include <llvm/IR/Instructions.h>
+#include <llvm/IR/IRBuilder.h>
+#include <llvm/IR/Module.h>
 #include <llvm/Pass.h>
 #include <llvm/Support/raw_ostream.h>
-#include <llvm/Target/TargetData.h>
-#include <llvm/Type.h>
+#include <llvm/IR/DataLayout.h>
+#include <llvm/IR/Type.h>
 
 #include "bcc/Config/Config.h"
 #include "bcc/Renderscript/RSInfo.h"
@@ -103,19 +103,19 @@
   }
 
   // Get the actual value we should use to step through an allocation.
-  // TD - Target Data size/layout information.
+  // DL - Target Data size/layout information.
   // T - Type of allocation (should be a pointer).
   // OrigStep - Original step increment (root.expand() input from driver).
-  llvm::Value *getStepValue(llvm::TargetData *TD, llvm::Type *T,
+  llvm::Value *getStepValue(llvm::DataLayout *DL, llvm::Type *T,
                             llvm::Value *OrigStep) {
-    bccAssert(TD);
+    bccAssert(DL);
     bccAssert(T);
     bccAssert(OrigStep);
     llvm::PointerType *PT = llvm::dyn_cast<llvm::PointerType>(T);
     llvm::Type *VoidPtrTy = llvm::Type::getInt8PtrTy(*C);
     if (mEnableStepOpt && T != VoidPtrTy && PT) {
       llvm::Type *ET = PT->getElementType();
-      uint64_t ETSize = TD->getTypeAllocSize(ET);
+      uint64_t ETSize = DL->getTypeAllocSize(ET);
       llvm::Type *Int32Ty = llvm::Type::getInt32Ty(*C);
       return llvm::ConstantInt::get(Int32Ty, ETSize);
     } else {
@@ -171,7 +171,7 @@
       }
     }
 
-    llvm::TargetData TD(M);
+    llvm::DataLayout DL(M);
 
     llvm::Type *VoidPtrTy = llvm::Type::getInt8PtrTy(*C);
     llvm::Type *Int32Ty = llvm::Type::getInt32Ty(*C);
@@ -272,7 +272,7 @@
     if (hasIn(Signature)) {
       InTy = Args->getType();
       AIn = Builder.CreateAlloca(InTy, 0, "AIn");
-      InStep = getStepValue(&TD, InTy, Arg_instep);
+      InStep = getStepValue(&DL, InTy, Arg_instep);
       InStep->setName("instep");
       Builder.CreateStore(Builder.CreatePointerCast(Builder.CreateLoad(
           Builder.CreateStructGEP(Arg_p, 0)), InTy), AIn);
@@ -284,7 +284,7 @@
     if (hasOut(Signature)) {
       OutTy = Args->getType();
       AOut = Builder.CreateAlloca(OutTy, 0, "AOut");
-      OutStep = getStepValue(&TD, OutTy, Arg_outstep);
+      OutStep = getStepValue(&DL, OutTy, Arg_outstep);
       OutStep->setName("outstep");
       Builder.CreateStore(Builder.CreatePointerCast(Builder.CreateLoad(
           Builder.CreateStructGEP(Arg_p, 1)), OutTy), AOut);
@@ -391,7 +391,7 @@
     ALOGV("Expanding kernel Function %s", F->getName().str().c_str());
 
     // TODO: Refactor this to share functionality with ExpandFunction.
-    llvm::TargetData TD(M);
+    llvm::DataLayout DL(M);
 
     llvm::Type *VoidPtrTy = llvm::Type::getInt8PtrTy(*C);
     llvm::Type *Int32Ty = llvm::Type::getInt32Ty(*C);
@@ -501,7 +501,7 @@
         // We don't increment Args, since we are using the actual return type.
       }
       AOut = Builder.CreateAlloca(OutTy, 0, "AOut");
-      OutStep = getStepValue(&TD, OutTy, Arg_outstep);
+      OutStep = getStepValue(&DL, OutTy, Arg_outstep);
       OutStep->setName("outstep");
       Builder.CreateStore(Builder.CreatePointerCast(Builder.CreateLoad(
           Builder.CreateStructGEP(Arg_p, 1)), OutTy), AOut);
@@ -514,7 +514,7 @@
       InBaseTy = Args->getType();
       InTy =InBaseTy->getPointerTo();
       AIn = Builder.CreateAlloca(InTy, 0, "AIn");
-      InStep = getStepValue(&TD, InTy, Arg_instep);
+      InStep = getStepValue(&DL, InTy, Arg_instep);
       InStep->setName("instep");
       Builder.CreateStore(Builder.CreatePointerCast(Builder.CreateLoad(
           Builder.CreateStructGEP(Arg_p, 0)), InTy), AIn);
diff --git a/lib/Renderscript/RSInfoExtractor.cpp b/lib/Renderscript/RSInfoExtractor.cpp
index c0775b5..09e707b 100644
--- a/lib/Renderscript/RSInfoExtractor.cpp
+++ b/lib/Renderscript/RSInfoExtractor.cpp
@@ -19,9 +19,9 @@
 //===----------------------------------------------------------------------===//
 #include "bcc/Renderscript/RSInfo.h"
 
-#include <llvm/Constants.h>
-#include <llvm/Metadata.h>
-#include <llvm/Module.h>
+#include <llvm/IR/Constants.h>
+#include <llvm/IR/Metadata.h>
+#include <llvm/IR/Module.h>
 
 #include "bcc/Source.h"
 #include "bcc/Support/Log.h"
diff --git a/lib/Renderscript/runtime/build_bc_lib.mk b/lib/Renderscript/runtime/build_bc_lib.mk
index 58f5f6e..d003f5b 100644
--- a/lib/Renderscript/runtime/build_bc_lib.mk
+++ b/lib/Renderscript/runtime/build_bc_lib.mk
@@ -29,7 +29,7 @@
              -O3 \
              -fno-builtin \
              -emit-llvm \
-             -ccc-host-triple armv7-none-linux-gnueabi \
+             -target armv7-none-linux-gnueabi \
              -fsigned-char \
 	     $(bc_translated_clang_cc1_cflags)
 
diff --git a/lib/Renderscript/runtime/build_clcore.sh b/lib/Renderscript/runtime/build_clcore.sh
index 329831f..842245c 100755
--- a/lib/Renderscript/runtime/build_clcore.sh
+++ b/lib/Renderscript/runtime/build_clcore.sh
@@ -9,12 +9,12 @@
 scriptc_path=../../../../base/libs/rs/scriptc
 clang_header_path=../../../../../external/clang/lib/Headers
 
-clang -ccc-host-triple armv7-none-linux-gnueabi -I${scriptc_path} -I${clang_header_path} -c -std=c99 -O3 rs_cl.c -emit-llvm -o rs_cl.bc
+clang -target armv7-none-linux-gnueabi -I${scriptc_path} -I${clang_header_path} -c -std=c99 -O3 rs_cl.c -emit-llvm -o rs_cl.bc
 
 # Generate rs_core.bc
 # ===================
 
-clang -ccc-host-triple armv7-none-linux-gnueabi -I${scriptc_path} -I${clang_header_path} -c -std=c99 -O3 rs_core.c -emit-llvm -o rs_core.bc
+clang -target armv7-none-linux-gnueabi -I${scriptc_path} -I${clang_header_path} -c -std=c99 -O3 rs_core.c -emit-llvm -o rs_core.bc
 
 # Link everything together
 # ========================