From cfd0bfbd1165294fd33b1ac24e6696d4c6ceb0ca Mon Sep 17 00:00:00 2001 From: Luqman Aden Date: Sat, 24 Aug 2013 08:49:03 -0400 Subject: [PATCH] rustllvm: Specify hard floats for gnueabihf. --- src/rustllvm/RustWrapper.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/rustllvm/RustWrapper.cpp b/src/rustllvm/RustWrapper.cpp index 7e9a790e215..5b8c6bc883f 100644 --- a/src/rustllvm/RustWrapper.cpp +++ b/src/rustllvm/RustWrapper.cpp @@ -391,19 +391,23 @@ LLVMRustWriteOutputFile(LLVMPassManagerRef PMR, cl::ParseCommandLineOptions(argc, argv); } + Triple Trip(Triple::normalize(triple)); + TargetOptions Options; Options.EnableSegmentedStacks = EnableSegmentedStacks; Options.FixedStackSegmentSize = 2 * 1024 * 1024; // XXX: This is too big. + Options.FloatABIType = + (Trip.getEnvironment() == Triple::GNUEABIHF) ? FloatABI::Hard : + FloatABI::Default; PassManager *PM = unwrap(PMR); std::string Err; - std::string Trip(Triple::normalize(triple)); std::string FeaturesStr(feature); std::string CPUStr(cpu); - const Target *TheTarget = TargetRegistry::lookupTarget(Trip, Err); + const Target *TheTarget = TargetRegistry::lookupTarget(Trip.getTriple(), Err); TargetMachine *Target = - TheTarget->createTargetMachine(Trip, CPUStr, FeaturesStr, + TheTarget->createTargetMachine(Trip.getTriple(), CPUStr, FeaturesStr, Options, Reloc::PIC_, CodeModel::Default, OptLevel); Target->addAnalysisPasses(*PM);