Avoid cpu mismatch to ARM during cross compiling

Change-Id: I80ebcdbd433e5bbbcf9c9d3a7bda6743037c0aad
Signed-off-by: Yong Chen <yong.a.chen@intel.com>
diff --git a/lib/Support/CompilerConfig.cpp b/lib/Support/CompilerConfig.cpp
index eac26aa..71cd7cc 100644
--- a/lib/Support/CompilerConfig.cpp
+++ b/lib/Support/CompilerConfig.cpp
@@ -155,7 +155,9 @@
 #if defined(TARGET_BUILD)
     if (!getProperty("debug.rs.arm-no-tune-for-cpu")) {
 #ifndef FORCE_CPU_VARIANT_32
+#ifdef DEFAULT_ARM_CODEGEN
       setCPU(llvm::sys::getHostCPUName());
+#endif
 #else
 #define XSTR(S) #S
 #define STR(S) XSTR(S)
@@ -175,7 +177,9 @@
 #if defined(TARGET_BUILD)
     if (!getProperty("debug.rs.arm-no-tune-for-cpu")) {
 #ifndef FORCE_CPU_VARIANT_64
+#ifdef DEFAULT_ARM64_CODEGEN
       setCPU(llvm::sys::getHostCPUName());
+#endif
 #else
 #define XSTR(S) #S
 #define STR(S) XSTR(S)