From 3220e60578c2cac07686f28ab134d8c243312039 Mon Sep 17 00:00:00 2001 From: AzureMarker Date: Mon, 3 Jan 2022 21:54:31 -0800 Subject: [PATCH] Add init method to force linking --- src/lib.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index c44e12b..393a7aa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -2,6 +2,12 @@ extern crate libc; +/// Call this somewhere to force Rust to link this module. +/// The call doesn't need to execute, just exist. +/// +/// See https://github.com/rust-lang/rust/issues/47384 +pub fn init() {} + #[no_mangle] extern "C" fn posix_memalign( memptr: *mut *mut libc::c_void,