From 098027869a2947d3aa68c7f0f6388eab7d433b4b Mon Sep 17 00:00:00 2001 From: AzureMarker Date: Sat, 1 Jan 2022 18:06:45 -0500 Subject: [PATCH 1/2] Remove staticlib crate type to simplify Cargo.toml We can just use the default (lib). Also standardized the dependency specification. --- Cargo.toml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 80656d7..43ab14b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,10 +5,5 @@ version = "0.1.0" license = "MIT/Apache 2.0" edition = "2021" -[lib] -name = "pthread_3ds" -path = "src/lib.rs" -crate-type = ["staticlib", "lib"] - -[dependencies.libc] -git = "https://github.com/Meziu/libc.git" +[dependencies] +libc = { git = "https://github.com/Meziu/libc.git" } From 04a89ae72cbd66aefa027750f21e265c390f2dcd Mon Sep 17 00:00:00 2001 From: AzureMarker Date: Mon, 3 Jan 2022 21:55:16 -0800 Subject: [PATCH 2/2] 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 f010f81..59864c2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,12 @@ #![feature(thread_local)] #![allow(non_camel_case_types)] +/// 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() {} + // LIBCTRU THREADS pub type _LOCK_T = i32;