mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 16:54:01 +00:00
rustc_llvm: Don't export constants across dlls
For imports of constants across DLLs to work on Windows it *requires* that the import be marked with `dllimport` (unlike functions where the marker is optional, but strongly recommended). This currently isn't working for importing FFI constants across boundaries, however, so the one constant exported from `rustc_llvm.dll` is now a function to be called instead.
This commit is contained in:
parent
b538189ba0
commit
847c8520b1
@ -1771,7 +1771,7 @@ extern {
|
||||
Dialect: c_uint)
|
||||
-> ValueRef;
|
||||
|
||||
pub static LLVMRustDebugMetadataVersion: u32;
|
||||
pub fn LLVMRustDebugMetadataVersion() -> u32;
|
||||
|
||||
pub fn LLVMRustAddModuleFlag(M: ModuleRef,
|
||||
name: *const c_char,
|
||||
|
@ -193,7 +193,7 @@ pub fn finalize(cx: &CrateContext) {
|
||||
// Prevent bitcode readers from deleting the debug info.
|
||||
let ptr = "Debug Info Version\0".as_ptr();
|
||||
llvm::LLVMRustAddModuleFlag(cx.llmod(), ptr as *const _,
|
||||
llvm::LLVMRustDebugMetadataVersion);
|
||||
llvm::LLVMRustDebugMetadataVersion());
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,9 @@ DIT unwrapDI(LLVMMetadataRef ref) {
|
||||
return DIT(ref ? unwrap<MDNode>(ref) : NULL);
|
||||
}
|
||||
|
||||
extern "C" const uint32_t LLVMRustDebugMetadataVersion = DEBUG_METADATA_VERSION;
|
||||
extern "C" const uint32_t LLVMRustDebugMetadataVersion() {
|
||||
return DEBUG_METADATA_VERSION;
|
||||
}
|
||||
|
||||
extern "C" void LLVMRustAddModuleFlag(LLVMModuleRef M,
|
||||
const char *name,
|
||||
|
Loading…
Reference in New Issue
Block a user