allow loading of llvm plugins on nightly
This commit is contained in:
parent
fb3ea63d9b
commit
4dbdcd1c5c
3 changed files with 13 additions and 0 deletions
|
@ -129,6 +129,16 @@ unsafe fn configure_llvm(sess: &Session) {
|
||||||
|
|
||||||
llvm::LLVMInitializePasses();
|
llvm::LLVMInitializePasses();
|
||||||
|
|
||||||
|
for plugin in &sess.opts.debugging_opts.llvm_plugins {
|
||||||
|
let path = CString::new(plugin.as_bytes()).unwrap();
|
||||||
|
let res = libc::dlopen(path.as_ptr(), libc::RTLD_LAZY | libc::RTLD_GLOBAL);
|
||||||
|
if res.is_null() {
|
||||||
|
println!("{}", CStr::from_ptr(libc::dlerror()).to_string_lossy().into_owned());
|
||||||
|
}
|
||||||
|
println!("{:p}", res);
|
||||||
|
println!("{}", plugin);
|
||||||
|
}
|
||||||
|
|
||||||
rustc_llvm::initialize_available_targets();
|
rustc_llvm::initialize_available_targets();
|
||||||
|
|
||||||
llvm::LLVMRustSetLLVMOptions(llvm_args.len() as c_int, llvm_args.as_ptr());
|
llvm::LLVMRustSetLLVMOptions(llvm_args.len() as c_int, llvm_args.as_ptr());
|
||||||
|
|
|
@ -707,6 +707,7 @@ fn test_debugging_options_tracking_hash() {
|
||||||
tracked!(instrument_coverage, Some(InstrumentCoverage::All));
|
tracked!(instrument_coverage, Some(InstrumentCoverage::All));
|
||||||
tracked!(instrument_mcount, true);
|
tracked!(instrument_mcount, true);
|
||||||
tracked!(link_only, true);
|
tracked!(link_only, true);
|
||||||
|
tracked!(llvm_plugins, vec![String::from("plugin_name")]);
|
||||||
tracked!(merge_functions, Some(MergeFunctions::Disabled));
|
tracked!(merge_functions, Some(MergeFunctions::Disabled));
|
||||||
tracked!(mir_emit_retag, true);
|
tracked!(mir_emit_retag, true);
|
||||||
tracked!(mir_opt_level, Some(4));
|
tracked!(mir_opt_level, Some(4));
|
||||||
|
|
|
@ -1122,6 +1122,8 @@ options! {
|
||||||
"link native libraries in the linker invocation (default: yes)"),
|
"link native libraries in the linker invocation (default: yes)"),
|
||||||
link_only: bool = (false, parse_bool, [TRACKED],
|
link_only: bool = (false, parse_bool, [TRACKED],
|
||||||
"link the `.rlink` file generated by `-Z no-link` (default: no)"),
|
"link the `.rlink` file generated by `-Z no-link` (default: no)"),
|
||||||
|
llvm_plugins: Vec<String> = (Vec::new(), parse_list, [TRACKED],
|
||||||
|
"a list LLVM plugins to enable (space separated)"),
|
||||||
llvm_time_trace: bool = (false, parse_bool, [UNTRACKED],
|
llvm_time_trace: bool = (false, parse_bool, [UNTRACKED],
|
||||||
"generate JSON tracing data file from LLVM data (default: no)"),
|
"generate JSON tracing data file from LLVM data (default: no)"),
|
||||||
ls: bool = (false, parse_bool, [UNTRACKED],
|
ls: bool = (false, parse_bool, [UNTRACKED],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue