]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/sgx/abi/mod.rs
SGX target: add thread local storage
[rust.git] / src / libstd / sys / sgx / abi / mod.rs
index cade96e3f52b7e8e57d43fde83b7bc87d0ed452b..99ea7a381f37b2c27614ed4d25241611c4eb79a8 100644 (file)
@@ -17,6 +17,8 @@
 pub(super) mod panic;
 
 // library features
+pub mod thread;
+pub mod tls;
 #[macro_use]
 mod usercalls;
 
 #[no_mangle]
 #[allow(unreachable_code)]
 extern "C" fn entry(p1: u64, p2: u64, p3: u64, secondary: bool, p4: u64, p5: u64) -> (u64, u64) {
+    // FIXME: how to support TLS in library mode?
+    let tls = Box::new(tls::Tls::new());
+    let _tls_guard = unsafe { tls.activate() };
+
     if secondary {
         unimplemented!("thread entrypoint");