diff --git a/include/bits/errno.h b/include/bits/errno.h new file mode 100644 index 0000000000000000000000000000000000000000..7266f57ee2d1437570e139283613187128e428cf --- /dev/null +++ b/include/bits/errno.h @@ -0,0 +1,6 @@ +#ifndef _BITS_ERRNO_H +#define _BITS_ERRNO_H + +extern __thread int errno; + +#endif /* _BITS_ERRNO_H */ diff --git a/include/errno.h b/include/errno.h deleted file mode 100644 index 02b7e0c00f57580b0e132baa1c6679fa4a44a3b2..0000000000000000000000000000000000000000 --- a/include/errno.h +++ /dev/null @@ -1 +0,0 @@ -extern __thread int errno; diff --git a/src/errno/cbindgen.toml b/src/errno/cbindgen.toml index e71467bc3cc2a9abf964813b4d7a08c4b0c56cb9..1159d8eda7d72be9043ea92755f9783a7677704e 100644 --- a/src/errno/cbindgen.toml +++ b/src/errno/cbindgen.toml @@ -1,4 +1,4 @@ -sys_includes = [] +sys_includes = ["bits/errno.h"] include_guard = "_ERRNO_H" language = "C" diff --git a/src/errno/src/lib.rs b/src/errno/src/lib.rs index 3cb5cd036c4cdd178d54ab15f1fc25d18aa9c124..a40975c9f9ef62073cd7fc737e96721f54b7b2a7 100644 --- a/src/errno/src/lib.rs +++ b/src/errno/src/lib.rs @@ -4,6 +4,7 @@ extern crate platform; +#[repr(C)] pub enum Errno { // Argument list too long E2BIG = 1, diff --git a/tests/Makefile b/tests/Makefile index 8d87af542c9b85dc10bdf89aa339ab7d36ce5e5c..7d293f7246448f9a0ef3ae77d318a438f2478436 100644 --- a/tests/Makefile +++ b/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 "$@"