Skip to content

Commit

Permalink
auto merge of #5354 : ILyoan/rust/normalize_triple, r=graydon
Browse files Browse the repository at this point in the history
LLVM could not recognize target-os when target-triple was given as like 'arm-linux-androideabi'.
Normalizing target-triple fill the missing elements. 
In the case of 'arm-linux-androideabi', nomalized target-triple will be "arm-unknown-linux-androideabi" and this let llvm recognize the triple correctly. (arch: arm, vendor: unknown, os: linux, environment: android)
  • Loading branch information
bors committed Mar 15, 2013
2 parents c724dae + 10df2ea commit 2b059c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/rustllvm/RustWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,10 @@ LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
Options.EnableSegmentedStacks = EnableSegmentedStacks;

std::string Err;
const Target *TheTarget = TargetRegistry::lookupTarget(triple, Err);
std::string Trip(Triple::normalize(triple));
std::string FeaturesStr;
std::string Trip(triple);
std::string CPUStr("generic");
const Target *TheTarget = TargetRegistry::lookupTarget(Trip, Err);
TargetMachine *Target =
TheTarget->createTargetMachine(Trip, CPUStr, FeaturesStr,
Options, Reloc::PIC_,
Expand Down

0 comments on commit 2b059c6

Please sign in to comment.