about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-07-14 07:38:56 -0700
committerGitHub <noreply@github.com>2020-07-14 07:38:56 -0700
commit905c4e05e1355854c0c63099c70dc1359a3accc7 (patch)
treeb5c5b3fbaac3811b6c4a154f64c9374240b82765 /src/libstd
parent5e61827dd37041ef689ec51860c690114e92a7c9 (diff)
parent9448ed4c1f8b586c9c90a78c12afc4c826041d5a (diff)
downloadrust-905c4e05e1355854c0c63099c70dc1359a3accc7.tar.gz
rust-905c4e05e1355854c0c63099c70dc1359a3accc7.zip
Rollup merge of #73866 - Goirad:fix-entry-improper-ctypes, r=davidtwco
Obviate #[allow(improper_ctypes_definitions)]

Modifies the return type for `fn entry` so that allowing
improper_ctypes_definitions is no longer necessary. This change is
derived from a similar pattern in `libstd/sys/sgx/abi/usercalls/raw.rs`
with `UsercallReturn`.

cc @jethrogb
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/sys/sgx/abi/mod.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libstd/sys/sgx/abi/mod.rs b/src/libstd/sys/sgx/abi/mod.rs
index 5ef26d4cc4d..b0693b63a48 100644
--- a/src/libstd/sys/sgx/abi/mod.rs
+++ b/src/libstd/sys/sgx/abi/mod.rs
@@ -17,6 +17,9 @@ pub mod usercalls;
 #[cfg(not(test))]
 global_asm!(include_str!("entry.S"));
 
+#[repr(C)]
+struct EntryReturn(u64, u64);
+
 #[cfg(not(test))]
 #[no_mangle]
 unsafe extern "C" fn tcs_init(secondary: bool) {
@@ -56,8 +59,7 @@ unsafe extern "C" fn tcs_init(secondary: bool) {
 // able to specify this
 #[cfg(not(test))]
 #[no_mangle]
-#[allow(improper_ctypes_definitions)]
-extern "C" fn entry(p1: u64, p2: u64, p3: u64, secondary: bool, p4: u64, p5: u64) -> (u64, u64) {
+extern "C" fn entry(p1: u64, p2: u64, p3: u64, secondary: bool, p4: u64, p5: u64) -> EntryReturn {
     // FIXME: how to support TLS in library mode?
     let tls = Box::new(tls::Tls::new());
     let _tls_guard = unsafe { tls.activate() };
@@ -65,7 +67,7 @@ extern "C" fn entry(p1: u64, p2: u64, p3: u64, secondary: bool, p4: u64, p5: u64
     if secondary {
         super::thread::Thread::entry();
 
-        (0, 0)
+        EntryReturn(0, 0)
     } else {
         extern "C" {
             fn main(argc: isize, argv: *const *const u8) -> isize;