Skip to content

Commit 01f8e56

Browse files
z0w0graydon
authored andcommitted
---
yaml --- r: 20607 b: refs/heads/snap-stage3 c: 480fa7c h: refs/heads/master i: 20605: a569aac 20603: 9c87039 20599: 755c235 20591: cd944fd 20575: 47a5422 20543: 907e46a 20479: 9ebca6f v: v3
1 parent 9fb9af0 commit 01f8e56

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: de5c15edfb0eb44fafb7021b61b51ae2c800b0fd
4+
refs/heads/snap-stage3: 480fa7c00e477dc2bdad1f7750b57c128e78f491
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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)