Skip to content

Commit cfd0bfb

Browse files
committed
rustllvm: Specify hard floats for gnueabihf.
1 parent bb9c71f commit cfd0bfb

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/rustllvm/RustWrapper.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,19 +391,23 @@ LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
391391
cl::ParseCommandLineOptions(argc, argv);
392392
}
393393

394+
Triple Trip(Triple::normalize(triple));
395+
394396
TargetOptions Options;
395397
Options.EnableSegmentedStacks = EnableSegmentedStacks;
396398
Options.FixedStackSegmentSize = 2 * 1024 * 1024; // XXX: This is too big.
399+
Options.FloatABIType =
400+
(Trip.getEnvironment() == Triple::GNUEABIHF) ? FloatABI::Hard :
401+
FloatABI::Default;
397402

398403
PassManager *PM = unwrap<PassManager>(PMR);
399404

400405
std::string Err;
401-
std::string Trip(Triple::normalize(triple));
402406
std::string FeaturesStr(feature);
403407
std::string CPUStr(cpu);
404-
const Target *TheTarget = TargetRegistry::lookupTarget(Trip, Err);
408+
const Target *TheTarget = TargetRegistry::lookupTarget(Trip.getTriple(), Err);
405409
TargetMachine *Target =
406-
TheTarget->createTargetMachine(Trip, CPUStr, FeaturesStr,
410+
TheTarget->createTargetMachine(Trip.getTriple(), CPUStr, FeaturesStr,
407411
Options, Reloc::PIC_,
408412
CodeModel::Default, OptLevel);
409413
Target->addAnalysisPasses(*PM);

0 commit comments

Comments
 (0)