Jelajahi Sumber

Merge branch 'master' of github.com:redox-os/relibc

Paul Sajna 7 tahun lalu
induk
melakukan
f6db153ea5
6 mengubah file dengan 12 tambahan dan 5 penghapusan
  1. 7 0
      include/bits/errno.h
  2. 0 1
      include/errno.h
  3. 1 1
      src/errno/cbindgen.toml
  4. 1 0
      src/errno/src/lib.rs
  5. 2 2
      src/platform/src/lib.rs
  6. 1 1
      tests/Makefile

+ 7 - 0
include/bits/errno.h

@@ -0,0 +1,7 @@
+#ifndef _BITS_ERRNO_H
+#define _BITS_ERRNO_H
+
+//TODO extern __thread int errno;
+extern int errno;
+
+#endif /* _BITS_ERRNO_H */

+ 0 - 1
include/errno.h

@@ -1 +0,0 @@
-extern __thread int errno;

+ 1 - 1
src/errno/cbindgen.toml

@@ -1,4 +1,4 @@
-sys_includes = []
+sys_includes = ["bits/errno.h"]
 include_guard = "_ERRNO_H"
 language = "C"
 

+ 1 - 0
src/errno/src/lib.rs

@@ -4,6 +4,7 @@
 
 extern crate platform;
 
+#[repr(C)]
 pub enum Errno {
     // Argument list too long
     E2BIG = 1,

+ 2 - 2
src/platform/src/lib.rs

@@ -2,7 +2,7 @@
 
 #![no_std]
 #![allow(non_camel_case_types)]
-#![feature(thread_local)]
+//TODO #![feature(thread_local)]
 
 #[cfg(all(not(feature = "no_std"), target_os = "linux"))]
 #[macro_use]
@@ -28,7 +28,7 @@ use core::fmt;
 
 use types::*;
 
-#[thread_local]
+//TODO #[thread_local]
 #[no_mangle]
 pub static mut errno: c_int = 0;
 

+ 1 - 1
tests/Makefile

@@ -37,4 +37,4 @@ GCCTAIL=\
 	../openlibm/libopenlibm.a
 
 %: %.c
-	gcc -fno-stack-protector -Wall $(GCCHEAD) "$<" $(GCCTAIL) -o "$@"
+	gcc -no-pie -fno-stack-protector -Wall $(GCCHEAD) "$<" $(GCCTAIL) -o "$@"