Skip to content

Commit 93655f9

Browse files
z0w0graydon
authored andcommitted
---
yaml --- r: 22715 b: refs/heads/master c: 480fa7c h: refs/heads/master i: 22713: 0de074c 22711: ffc5857 v: v3
1 parent b727517 commit 93655f9

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,5 +1,5 @@
11
---
2-
refs/heads/master: de5c15edfb0eb44fafb7021b61b51ae2c800b0fd
2+
refs/heads/master: 480fa7c00e477dc2bdad1f7750b57c128e78f491
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/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;

trunk/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)