-
Notifications
You must be signed in to change notification settings - Fork 14k
Closed
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Description
I noticed while browsing through the code that this function:
Lines 2164 to 2210 in f1f6c12
| // FIXME #15460 - create a public function that actually calls our | |
| // static LLVM symbols. Otherwise the linker will just throw llvm | |
| // away. We're just calling lots of stuff until we transitively get | |
| // all of LLVM. This is worse than anything. | |
| pub unsafe fn static_link_hack_this_sucks() { | |
| LLVMInitializePasses(); | |
| LLVMInitializeX86TargetInfo(); | |
| LLVMInitializeX86Target(); | |
| LLVMInitializeX86TargetMC(); | |
| LLVMInitializeX86AsmPrinter(); | |
| LLVMInitializeX86AsmParser(); | |
| LLVMInitializeARMTargetInfo(); | |
| LLVMInitializeARMTarget(); | |
| LLVMInitializeARMTargetMC(); | |
| LLVMInitializeARMAsmPrinter(); | |
| LLVMInitializeARMAsmParser(); | |
| LLVMInitializeMipsTargetInfo(); | |
| LLVMInitializeMipsTarget(); | |
| LLVMInitializeMipsTargetMC(); | |
| LLVMInitializeMipsAsmPrinter(); | |
| LLVMInitializeMipsAsmParser(); | |
| LLVMRustSetLLVMOptions(0 as c_int, | |
| 0 as *const _); | |
| LLVMPassManagerBuilderPopulateModulePassManager(0 as *mut _, 0 as *mut _); | |
| LLVMPassManagerBuilderPopulateLTOPassManager(0 as *mut _, 0 as *mut _, False, False); | |
| LLVMPassManagerBuilderPopulateFunctionPassManager(0 as *mut _, 0 as *mut _); | |
| LLVMPassManagerBuilderSetOptLevel(0 as *mut _, 0 as c_uint); | |
| LLVMPassManagerBuilderUseInlinerWithThreshold(0 as *mut _, 0 as c_uint); | |
| LLVMWriteBitcodeToFile(0 as *mut _, 0 as *const _); | |
| LLVMPassManagerBuilderCreate(); | |
| LLVMPassManagerBuilderDispose(0 as *mut _); | |
| LLVMRustLinkInExternalBitcode(0 as *mut _, 0 as *const _, 0 as size_t); | |
| LLVMLinkInMCJIT(); | |
| LLVMLinkInInterpreter(); | |
| extern { | |
| fn LLVMLinkInMCJIT(); | |
| fn LLVMLinkInInterpreter(); | |
| } | |
| } |
Curious as to the cause, I looked up issue #15460, and realized that it had been closed. I imagine that this hack is probably unnecessary now.
Metadata
Metadata
Assignees
Labels
C-cleanupCategory: PRs that clean code up or issues documenting cleanup.Category: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.