Skip to content

Remove hax #22408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 18, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 1 addition & 60 deletions src/librustc_llvm/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub use self::Linkage::*;

use std::ffi::CString;
use std::cell::RefCell;
use std::{raw, mem, ptr};
use std::{raw, mem};
use libc::{c_uint, c_ushort, uint64_t, c_int, size_t, c_char};
use libc::{c_longlong, c_ulonglong, c_void};
use debuginfo::{DIBuilderRef, DIDescriptor,
Expand Down Expand Up @@ -2225,65 +2225,6 @@ pub unsafe fn debug_loc_to_string(c: ContextRef, tr: DebugLocRef) -> String {
.expect("got a non-UTF8 DebugLoc from LLVM")
}

// 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();

LLVMInitializeAArch64TargetInfo();
LLVMInitializeAArch64Target();
LLVMInitializeAArch64TargetMC();
LLVMInitializeAArch64AsmPrinter();
LLVMInitializeAArch64AsmParser();

LLVMInitializeMipsTargetInfo();
LLVMInitializeMipsTarget();
LLVMInitializeMipsTargetMC();
LLVMInitializeMipsAsmPrinter();
LLVMInitializeMipsAsmParser();

LLVMInitializePowerPCTargetInfo();
LLVMInitializePowerPCTarget();
LLVMInitializePowerPCTargetMC();
LLVMInitializePowerPCAsmPrinter();
LLVMInitializePowerPCAsmParser();

LLVMRustSetLLVMOptions(0 as c_int, ptr::null());

LLVMPassManagerBuilderPopulateModulePassManager(ptr::null_mut(), ptr::null_mut());
LLVMPassManagerBuilderPopulateLTOPassManager(ptr::null_mut(), ptr::null_mut(), False, False);
LLVMPassManagerBuilderPopulateFunctionPassManager(ptr::null_mut(), ptr::null_mut());
LLVMPassManagerBuilderSetOptLevel(ptr::null_mut(), 0 as c_uint);
LLVMPassManagerBuilderUseInlinerWithThreshold(ptr::null_mut(), 0 as c_uint);
LLVMWriteBitcodeToFile(ptr::null_mut(), ptr::null());
LLVMPassManagerBuilderCreate();
LLVMPassManagerBuilderDispose(ptr::null_mut());

LLVMRustLinkInExternalBitcode(ptr::null_mut(), ptr::null(), 0 as size_t);

LLVMLinkInMCJIT();
LLVMLinkInInterpreter();

extern {
fn LLVMLinkInMCJIT();
fn LLVMLinkInInterpreter();
}
}

// The module containing the native LLVM dependencies, generated by the build system
// Note that this must come after the rustllvm extern declaration so that
// parts of LLVM that rustllvm depends on aren't thrown away by the linker.
Expand Down