return Is64Bit ? "core2" : "yonah";
}
- // All x86 devices running Android have core2 as their common
- // denominator. This makes a better choice than pentium4.
+ // On Android use targets compatible with gcc
if (Triple.getEnvironment() == llvm::Triple::Android)
- return "core2";
+ return Is64Bit ? "x86-64" : "i686";
// Everything else goes to x86-64 in 64-bit mode.
if (Is64Bit)
Features.push_back("-fsgsbase");
}
+ if (Triple.getEnvironment() == llvm::Triple::Android) {
+ // Add sse3 feature to comply with gcc on Android
+ Features.push_back("+sse3");
+ }
+
// Now add any that the user explicitly requested on the command line,
// which may override the defaults.
for (arg_iterator it = Args.filtered_begin(options::OPT_m_x86_Features_Group),
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=ANDROID-X86 %s
// ANDROID-X86: clang
-// ANDROID-X86: "-target-cpu" "core2"
+// ANDROID-X86: "-target-cpu" "i686"
+// ANDROID-X86: "-target-feature" "+sse3"
// RUN: %clang -target x86_64-linux-android -### -S %s 2>&1 \
// RUN: --sysroot=%S/Inputs/basic_android_tree/sysroot \
// RUN: | FileCheck --check-prefix=ANDROID-X86_64 %s
// ANDROID-X86_64: clang
-// ANDROID-X86_64: "-target-cpu" "core2"
+// ANDROID-X86_64: "-target-cpu" "x86-64"
+// ANDROID-X86_64: "-target-feature" "+sse3"
// RUN: %clang -target mips-linux-gnu -### -S %s 2>&1 | \
// RUN: FileCheck -check-prefix=MIPS %s