rustllvm: Specify hard floats for gnueabihf.

This commit is contained in:
Luqman Aden 2013-08-24 08:49:03 -04:00
parent bb9c71fe82
commit cfd0bfbd11

View file

@ -391,19 +391,23 @@ LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
cl::ParseCommandLineOptions(argc, argv); cl::ParseCommandLineOptions(argc, argv);
} }
Triple Trip(Triple::normalize(triple));
TargetOptions Options; TargetOptions Options;
Options.EnableSegmentedStacks = EnableSegmentedStacks; Options.EnableSegmentedStacks = EnableSegmentedStacks;
Options.FixedStackSegmentSize = 2 * 1024 * 1024; // XXX: This is too big. Options.FixedStackSegmentSize = 2 * 1024 * 1024; // XXX: This is too big.
Options.FloatABIType =
(Trip.getEnvironment() == Triple::GNUEABIHF) ? FloatABI::Hard :
FloatABI::Default;
PassManager *PM = unwrap<PassManager>(PMR); PassManager *PM = unwrap<PassManager>(PMR);
std::string Err; std::string Err;
std::string Trip(Triple::normalize(triple));
std::string FeaturesStr(feature); std::string FeaturesStr(feature);
std::string CPUStr(cpu); std::string CPUStr(cpu);
const Target *TheTarget = TargetRegistry::lookupTarget(Trip, Err); const Target *TheTarget = TargetRegistry::lookupTarget(Trip.getTriple(), Err);
TargetMachine *Target = TargetMachine *Target =
TheTarget->createTargetMachine(Trip, CPUStr, FeaturesStr, TheTarget->createTargetMachine(Trip.getTriple(), CPUStr, FeaturesStr,
Options, Reloc::PIC_, Options, Reloc::PIC_,
CodeModel::Default, OptLevel); CodeModel::Default, OptLevel);
Target->addAnalysisPasses(*PM); Target->addAnalysisPasses(*PM);