[cfe-commits] r147872 - in /cfe/trunk/lib: CodeGen/TargetInfo.cpp Driver/ToolChains.cpp Driver/Tools.cpp
Chandler Carruth
chandlerc at gmail.com
Tue Jan 10 11:47:42 PST 2012
Author: chandlerc
Date: Tue Jan 10 13:47:42 2012
New Revision: 147872
URL: http://llvm.org/viewvc/llvm-project?rev=147872&view=rev
Log:
Add support for the androideabi environment to our triple support, and
for the arm-linux-androideabi triple in particular.
Also use this to do a better job of selecting soft FP settings.
Patch by Evgeniy Stepanov.
Modified:
cfe/trunk/lib/CodeGen/TargetInfo.cpp
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Driver/Tools.cpp
Modified: cfe/trunk/lib/CodeGen/TargetInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/TargetInfo.cpp?rev=147872&r1=147871&r2=147872&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/TargetInfo.cpp (original)
+++ cfe/trunk/lib/CodeGen/TargetInfo.cpp Tue Jan 10 13:47:42 2012
@@ -2374,7 +2374,7 @@
bool isEABI() const {
StringRef Env = getContext().getTargetInfo().getTriple().getEnvironmentName();
- return (Env == "gnueabi" || Env == "eabi");
+ return (Env == "gnueabi" || Env == "eabi" || Env == "androideabi");
}
private:
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=147872&r1=147871&r2=147872&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Tue Jan 10 13:47:42 2012
@@ -1164,7 +1164,10 @@
SmallVectorImpl<StringRef> &Triples) {
if (HostArch == llvm::Triple::arm || HostArch == llvm::Triple::thumb) {
static const char *const ARMLibDirs[] = { "/lib" };
- static const char *const ARMTriples[] = { "arm-linux-gnueabi" };
+ static const char *const ARMTriples[] = {
+ "arm-linux-gnueabi",
+ "arm-linux-androideabi"
+ };
LibDirs.append(ARMLibDirs, ARMLibDirs + llvm::array_lengthof(ARMLibDirs));
Triples.append(ARMTriples, ARMTriples + llvm::array_lengthof(ARMTriples));
} else if (HostArch == llvm::Triple::x86_64) {
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=147872&r1=147871&r2=147872&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Tue Jan 10 13:47:42 2012
@@ -517,6 +517,7 @@
} else {
// Select the default based on the platform.
switch(Triple.getEnvironment()) {
+ case llvm::Triple::ANDROIDEABI:
case llvm::Triple::GNUEABI:
ABIName = "aapcs-linux";
break;
@@ -589,6 +590,15 @@
// EABI is always AAPCS, and if it was not marked 'hard', it's softfp
FloatABI = "softfp";
break;
+ case llvm::Triple::ANDROIDEABI: {
+ StringRef ArchName =
+ getLLVMArchSuffixForARM(getARMTargetCPU(Args, Triple));
+ if (ArchName.startswith("v7"))
+ FloatABI = "softfp";
+ else
+ FloatABI = "soft";
+ break;
+ }
default:
// Assume "soft", but warn the user we are guessing.
FloatABI = "soft";
More information about the cfe-commits
mailing list