Skip to content

Commit ff47574

Browse files
z0w0graydon
authored andcommitted
---
yaml --- r: 31377 b: refs/heads/dist-snap c: 480fa7c h: refs/heads/master i: 31375: b968c2e v: v3
1 parent 6390725 commit ff47574

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: de5c15edfb0eb44fafb7021b61b51ae2c800b0fd
10+
refs/heads/dist-snap: 480fa7c00e477dc2bdad1f7750b57c128e78f491
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/rustllvm/RustWrapper.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ extern "C" bool LLVMLinkModules(LLVMModuleRef Dest, LLVMModuleRef Src) {
7575
return true;
7676
}
7777

78+
void LLVMInitializeX86TargetInfo();
79+
void LLVMInitializeX86Target();
80+
void LLVMInitializeX86TargetMC();
81+
void LLVMInitializeX86AsmPrinter();
82+
void LLVMInitializeX86AsmParser();
83+
7884
extern "C" bool
7985
LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
8086
LLVMModuleRef M,
@@ -84,10 +90,16 @@ LLVMRustWriteOutputFile(LLVMPassManagerRef PMR,
8490
CodeGenOpt::Level OptLevel,
8591
bool EnableSegmentedStacks) {
8692

87-
InitializeAllTargets();
88-
InitializeAllTargetMCs();
89-
InitializeAllAsmPrinters();
90-
InitializeAllAsmParsers();
93+
// Only initialize the platforms supported by Rust here,
94+
// because using --llvm-root will have multiple platforms
95+
// that rustllvm doesn't actually link to and it's pointless to put target info
96+
// into the registry that Rust can not generate machine code for.
97+
98+
LLVMInitializeX86TargetInfo();
99+
LLVMInitializeX86Target();
100+
LLVMInitializeX86TargetMC();
101+
LLVMInitializeX86AsmPrinter();
102+
LLVMInitializeX86AsmParser();
91103

92104
TargetOptions Options;
93105
Options.NoFramePointerElim = true;

branches/dist-snap/src/rustllvm/rustllvm.def.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,8 @@ LLVMInitializeX86Disassembler
390390
LLVMInitializeX86Disassembler
391391
LLVMInitializeX86Target
392392
LLVMInitializeX86Target
393+
LLVMInitializeX86TargetMC
394+
LLVMInitializeX86TargetMC
393395
LLVMInitializeX86TargetInfo
394396
LLVMInitializeX86TargetInfo
395397
LLVMInsertBasicBlock

0 commit comments

Comments
 (0)