auto merge of #5354 : ILyoan/rust/normalize_triple, r=graydon

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)
This commit is contained in:
bors 2013-03-15 14:15:50 -07:00
commit 2b059c6e56

View file

@ -433,10 +433,10 @@ LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
Options.EnableSegmentedStacks = EnableSegmentedStacks; Options.EnableSegmentedStacks = EnableSegmentedStacks;
std::string Err; std::string Err;
const Target *TheTarget = TargetRegistry::lookupTarget(triple, Err); std::string Trip(Triple::normalize(triple));
std::string FeaturesStr; std::string FeaturesStr;
std::string Trip(triple);
std::string CPUStr("generic"); std::string CPUStr("generic");
const Target *TheTarget = TargetRegistry::lookupTarget(Trip, Err);
TargetMachine *Target = TargetMachine *Target =
TheTarget->createTargetMachine(Trip, CPUStr, FeaturesStr, TheTarget->createTargetMachine(Trip, CPUStr, FeaturesStr,
Options, Reloc::PIC_, Options, Reloc::PIC_,