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:
commit
2b059c6e56
1 changed files with 2 additions and 2 deletions
|
@ -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_,
|
||||||
|
|
Loading…
Add table
Reference in a new issue