Browse Source

Fix errno.h, add -no-pie to tests Makefile

Jeremy Soller 7 years ago
parent
commit
85b80d0fe5
5 changed files with 9 additions and 3 deletions
  1. 6 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. 1 1
      tests/Makefile

+ 6 - 0
include/bits/errno.h

@@ -0,0 +1,6 @@
+#ifndef _BITS_ERRNO_H
+#define _BITS_ERRNO_H
+
+extern __thread 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,

+ 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 "$@"