Force atom codegen on x86 bcc_compat.
Change-Id: I3295d7f67868043c9f172dae6d8afa2dcfa17c6b
diff --git a/tools/bcc_compat/Android.mk b/tools/bcc_compat/Android.mk
index 75cf8a4..b8be047 100644
--- a/tools/bcc_compat/Android.mk
+++ b/tools/bcc_compat/Android.mk
@@ -26,8 +26,6 @@
LOCAL_MODULE := bcc_compat
LOCAL_MODULE_CLASS := EXECUTABLES
-LOCAL_CFLAGS := -DFORCE_ARM_CODEGEN
-
LOCAL_SHARED_LIBRARIES := \
libbcc \
libbcinfo \
diff --git a/tools/bcc_compat/Main.cpp b/tools/bcc_compat/Main.cpp
index a62a4cf..316b1f8 100644
--- a/tools/bcc_compat/Main.cpp
+++ b/tools/bcc_compat/Main.cpp
@@ -63,9 +63,7 @@
OptRuntimePath("rt-path", llvm::cl::desc("Specify the runtime library path"),
llvm::cl::value_desc("path"));
-#ifdef TARGET_BUILD
-const std::string OptTargetTriple(DEFAULT_TARGET_TRIPLE_STRING);
-#else
+#ifndef TARGET_BUILD
llvm::cl::opt<std::string>
OptTargetTriple("mtriple",
llvm::cl::desc("Specify the target triple (default: "
@@ -178,6 +176,11 @@
return false;
}
+ // Compatibility mode on x86 requires atom code generation.
+ if (config->getTriple().find("i686") != std::string::npos) {
+ config->setCPU("atom");
+ }
+
// Setup the config according to the value of command line option.
if (OptPIC) {
config->setRelocationModel(llvm::Reloc::PIC_);