From 76c4520cea12f564f159c3d95941f519d44395dc Mon Sep 17 00:00:00 2001 From: Paul Sajna Date: Sun, 11 Mar 2018 11:19:56 -0700 Subject: [PATCH 01/11] stat is now autogenerated correctly --- src/stat/build.rs | 12 +++++------- src/stat/cbindgen.toml | 1 + 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/stat/build.rs b/src/stat/build.rs index 74a9a42fe9..57845793f8 100644 --- a/src/stat/build.rs +++ b/src/stat/build.rs @@ -3,11 +3,9 @@ extern crate cbindgen; use std::{env, fs}; fn main() { - /* - *let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set"); - *fs::create_dir_all("../../target/include").expect("failed to create include directory"); - *cbindgen::generate(crate_dir) - * .expect("failed to generate bindings") - * .write_to_file("../../target/include/sys/stat.h"); - */ + let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set"); + fs::create_dir_all("../../target/include").expect("failed to create include directory"); + cbindgen::generate(crate_dir) + .expect("failed to generate bindings") + .write_to_file("../../target/include/sys/stat.h"); } diff --git a/src/stat/cbindgen.toml b/src/stat/cbindgen.toml index d4f38953db..58eced99e1 100644 --- a/src/stat/cbindgen.toml +++ b/src/stat/cbindgen.toml @@ -1,6 +1,7 @@ sys_includes = ["sys/types.h"] include_guard = "_SYS_STAT_H" language = "C" +style = "Tag" [enum] prefix_with_name = true From bc98f6a029c34eb44911428877f5ac72e2740487 Mon Sep 17 00:00:00 2001 From: Paul Sajna Date: Sun, 11 Mar 2018 11:22:10 -0700 Subject: [PATCH 02/11] git rm include/sys/stat.h --- include/sys/stat.h | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 include/sys/stat.h diff --git a/include/sys/stat.h b/include/sys/stat.h deleted file mode 100644 index 97836d36b0..0000000000 --- a/include/sys/stat.h +++ /dev/null @@ -1,39 +0,0 @@ -#ifndef _STAT_H -#define _STAT_H - -#include - -struct stat { - dev_t st_dev; - ino_t st_ino; - nlink_t st_nlink; - mode_t st_mode; - uid_t st_uid; - gid_t st_gid; - dev_t st_rdev; - off_t st_size; - blksize_t st_blksize; - time_t st_atim; - time_t st_mtim; - time_t st_ctim; -}; - -int chmod(const char *path, mode_t mode); - -int fchmod(int fildes, mode_t mode); - -int fstat(int fildes, struct stat *buf); - -int lstat(const char *path, struct stat *buf); - -int mkdir(const char *path, mode_t mode); - -int mkfifo(const char *path, mode_t mode); - -int mknod(const char *path, mode_t mode, dev_t dev); - -int stat(const char *file, struct stat *buf); - -mode_t umask(mode_t mask); - -#endif /* _STAT_H */ From a000f1a2c0af83dbf8e68ca560ff35ce3b163e51 Mon Sep 17 00:00:00 2001 From: Paul Sajna Date: Sun, 11 Mar 2018 11:26:35 -0700 Subject: [PATCH 03/11] fmt --- src/stat/build.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stat/build.rs b/src/stat/build.rs index 57845793f8..0d79f3cce8 100644 --- a/src/stat/build.rs +++ b/src/stat/build.rs @@ -6,6 +6,6 @@ fn main() { let crate_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR not set"); fs::create_dir_all("../../target/include").expect("failed to create include directory"); cbindgen::generate(crate_dir) - .expect("failed to generate bindings") - .write_to_file("../../target/include/sys/stat.h"); + .expect("failed to generate bindings") + .write_to_file("../../target/include/sys/stat.h"); } From ca57f304254653e9d9b4d0d566710da7423d305a Mon Sep 17 00:00:00 2001 From: Paul Sajna Date: Sun, 11 Mar 2018 12:06:46 -0700 Subject: [PATCH 04/11] Update cbindgen --- cbindgen | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cbindgen b/cbindgen index 97ceb5862f..fe26d47afd 160000 --- a/cbindgen +++ b/cbindgen @@ -1 +1 @@ -Subproject commit 97ceb5862f397b14c5b63cd60af7f5f345ad065c +Subproject commit fe26d47afd3e959a8cd73f81f430b061d28c4c3b From c5dd3f870656b0f912e91e36bddf2bc0495d99a7 Mon Sep 17 00:00:00 2001 From: Paul Sajna Date: Sun, 11 Mar 2018 17:01:25 -0700 Subject: [PATCH 05/11] Update Cargo.lock --- Cargo.lock | 158 +++++++++++++++++++++++++++-------------------------- 1 file changed, 80 insertions(+), 78 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b9ae70624b..d695d178dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,14 +1,17 @@ [[package]] name = "ansi_term" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "atty" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -20,12 +23,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "cbindgen" -version = "0.5.0" +version = "0.5.1" dependencies = [ - "clap 2.30.0 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.31.1 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "standalone-syn 0.12.10 (registry+https://github.com/rust-lang/crates.io-index)", "tempdir 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -33,7 +36,7 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -43,11 +46,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "clap" -version = "2.30.0" +version = "2.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", - "atty 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -71,7 +74,7 @@ dependencies = [ name = "ctype" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", ] @@ -84,7 +87,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "errno" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", ] @@ -92,7 +95,7 @@ dependencies = [ name = "fcntl" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", ] @@ -100,7 +103,7 @@ dependencies = [ name = "fenv" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", ] @@ -108,7 +111,7 @@ dependencies = [ name = "float" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "fenv 0.1.0", "platform 0.1.0", ] @@ -131,7 +134,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "grp" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", ] @@ -151,7 +154,7 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.37" +version = "0.2.39" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -174,7 +177,7 @@ dependencies = [ name = "mman" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", ] @@ -205,7 +208,7 @@ name = "parking_lot_core" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -220,9 +223,20 @@ dependencies = [ ] [[package]] -name = "quote" -version = "0.3.15" +name = "proc-macro2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "quote" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "ralloc" @@ -246,7 +260,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -302,7 +316,7 @@ dependencies = [ name = "resource" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", "sys_time 0.1.0", ] @@ -392,46 +406,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "semaphore" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", ] [[package]] name = "serde" -version = "1.0.27" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive" -version = "1.0.27" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive_internals 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_derive_internals 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.12.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_derive_internals" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", - "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.12.14 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "serde_json" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -477,7 +492,7 @@ dependencies = [ name = "stat" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", ] @@ -485,7 +500,7 @@ dependencies = [ name = "stdio" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "errno 0.1.0", "platform 0.1.0", "va_list 0.1.0", @@ -495,7 +510,7 @@ dependencies = [ name = "stdlib" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "ctype 0.1.0", "errno 0.1.0", "platform 0.1.0", @@ -506,7 +521,8 @@ dependencies = [ name = "string" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", + "compiler_builtins 0.1.0 (git+https://github.com/rust-lang-nursery/compiler-builtins.git)", "errno 0.1.0", "platform 0.1.0", "stdlib 0.1.0", @@ -519,27 +535,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.11.11" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "synom" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "sys_time" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", ] @@ -566,7 +574,7 @@ name = "termion" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -583,7 +591,7 @@ dependencies = [ name = "time" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", ] @@ -592,7 +600,7 @@ name = "toml" version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -605,11 +613,6 @@ name = "unicode-width" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "unicode-xid" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "unicode-xid" version = "0.1.0" @@ -619,7 +622,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "unistd" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", ] @@ -634,7 +637,7 @@ dependencies = [ name = "va_list-helper" version = "0.0.2" dependencies = [ - "cc 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -646,7 +649,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "wait" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", "resource 0.1.0", ] @@ -655,7 +658,7 @@ dependencies = [ name = "wctype" version = "0.1.0" dependencies = [ - "cbindgen 0.5.0", + "cbindgen 0.5.1", "platform 0.1.0", ] @@ -689,26 +692,27 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] -"checksum ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6b3568b48b7cefa6b8ce125f9bb4989e52fbcc29ebea88df04cc7c5f12f70455" -"checksum atty 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8352656fd42c30a0c3c89d26dea01e3b77c0ab2af18230835c15e2e13cd51859" +"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum atty 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "af80143d6f7608d746df1520709e5d141c96f240b0e62b0aa41bdfb53374d9d4" "checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf" -"checksum cc 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9be26b24e988625409b19736d130f0c7d224f01d06454b5f81d8d23d6c1a618f" +"checksum cc 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fedf677519ac9e865c4ff43ef8f930773b37ed6e6ea61b6b83b400a7b5787f49" "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" -"checksum clap 2.30.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1c07b9257a00f3fc93b7f3c417fc15607ec7a56823bc2c37ec744e266387de5b" +"checksum clap 2.31.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5dc18f6f4005132120d9711636b32c46a233fad94df6217fa1d81c5e97a9f200" "checksum compiler_builtins 0.1.0 (git+https://github.com/rust-lang-nursery/compiler-builtins.git)" = "" "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -"checksum libc 0.2.37 (registry+https://github.com/rust-lang/crates.io-index)" = "56aebce561378d99a0bb578f8cb15b6114d2a1814a6c7949bbe646d968bb4fa9" +"checksum libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)" = "f54263ad99207254cf58b5f701ecb432c717445ea2ee8af387334bdd1a03fdff" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" "checksum num-traits 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b3c2bd9b9d21e48e956b763c9f37134dc62d9e95da6edb3f672cacb6caf3cd3" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "9fd9d732f2de194336fb02fe11f9eed13d9e76f13f4315b4d88a14ca411750cd" "checksum parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "538ef00b7317875071d5e00f603f24d16f0b474c1a5fc0ccb8b454ca72eafa79" -"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" +"checksum proc-macro2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cd07deb3c6d1d9ff827999c7f9b04cdfd66b1b17ae508e14fe47b620f2282ae0" +"checksum quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1eca14c727ad12702eb4b6bfb5a232287dcf8385cb8ca83a3eeaf6519c44c408" "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" "checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" @@ -721,18 +725,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rustc-ap-syntax 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b6e525fc674e8a75eaed08a90a6df7adfa73a66135056577722185dd7ca0771" "checksum rustc-ap-syntax_pos 40.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e157f53ad5c4a6cf9ae5b5be15325dd2eeca190c03ab9873cc1460788767e5e9" "checksum sc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4ebbb026ba4a707c25caec2db5ef59ad8b41f7ad77cad06257e06229c891f376" -"checksum serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "db99f3919e20faa51bb2996057f5031d8685019b5a06139b1ce761da671b8526" -"checksum serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "f4ba7591cfe93755e89eeecdbcc668885624829b020050e6aec99c2a03bd3fd0" -"checksum serde_derive_internals 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e03f1c9530c3fb0a0a5c9b826bdd9246a5921ae995d75f512ac917fc4dd55b5" -"checksum serde_json 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "57781ed845b8e742fc2bf306aba8e3b408fe8c366b900e3769fbc39f49eb8b39" +"checksum serde 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)" = "4763b773978e495252615e814d2ad04773b2c1f85421c7913869a537f35cb406" +"checksum serde_derive 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)" = "8ab31f00ae5574bb643c196d5e302961c122da1c768604c6d16a35c5d551948a" +"checksum serde_derive_internals 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1fc848d073be32cd982380c06587ea1d433bc1a4c4a111de07ec2286a3ddade8" +"checksum serde_json 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "fab6c4d75bedcf880711c85e39ebf8ccc70d0eba259899047ec5d7436643ee17" "checksum smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44db0ecb22921ef790d17ae13a3f6d15784183ff5f2a01aa32098c7498d2b4b9" "checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b" "checksum standalone-proc-macro2 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "04b0e28c7fb04d85743490bd2a24bd0ec0ff6efc74e7c848748fd9fd2b105410" "checksum standalone-quote 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "45bd227b8113ff91db4f6eadcc73928dc602af00a851f4fe65f3c1cb1a96b5e1" "checksum standalone-syn 0.12.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d800cb9b3b2e08877667aace544bb0882ea3d5cf3ae83c2730a9032becf1f6bd" "checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" -"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" +"checksum syn 0.12.14 (registry+https://github.com/rust-lang/crates.io-index)" = "8c5bc2d6ff27891209efa5f63e9de78648d7801f085e4653701a692ce938d6fd" "checksum tempdir 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f73eebdb68c14bcb24aef74ea96079830e7fa7b31a6106e42ea7ee887c1e134e" "checksum term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fa63644f74ce96fbeb9b794f66aff2a52d601cbd5e80f4b97123e3899f4570f1" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" @@ -740,7 +743,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum toml 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "a7540f4ffc193e0d3c94121edb19b055670d369f77d5804db11ae053a45b6e7e" "checksum unborrow 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e92e959f029e4f8ee25d70d15ab58d2b46f98a17bc238b9265ff0c26f6f3d67f" "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" -"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" "checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" From cc5669939e8514653d1239d0a9be7d23c82df6fb Mon Sep 17 00:00:00 2001 From: Dan Robertson Date: Sun, 11 Mar 2018 22:12:24 +0000 Subject: [PATCH 06/11] Fix include in resource.h and add SIZE_MAX The rusage struct makes use of the timeval structure. Make sure to include sys/time.h so that the type is known. Add SIZE_MAX to stdint.h sys/resource expects the defined structures to not be defined with a typedef. --- include/stdint.h | 2 ++ src/resource/cbindgen.toml | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/stdint.h b/include/stdint.h index ade0ab4fed..faf3693438 100644 --- a/include/stdint.h +++ b/include/stdint.h @@ -49,4 +49,6 @@ typedef int64_t intmax_t; #define UINTMAX_MAX UINT64_MAX typedef uint64_t uintmax_t; +#define SIZE_MAX UINT64_MAX + #endif /* _STDINT_H */ diff --git a/src/resource/cbindgen.toml b/src/resource/cbindgen.toml index f9c595b682..788d105537 100644 --- a/src/resource/cbindgen.toml +++ b/src/resource/cbindgen.toml @@ -1,6 +1,7 @@ -sys_includes = ["sys/types.h"] +sys_includes = ["sys/types.h", "sys/time.h"] include_guard = "_SYS_RESOURCE_H" language = "C" +style = "Tag" [enum] prefix_with_name = true From 7c13ec153eca96dc4f5ac729fe76af6c9c477a0c Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 11 Mar 2018 21:00:53 -0600 Subject: [PATCH 07/11] Update expects --- tests/.gitignore | 1 + tests/expected/alloc.stdout | 4 ++-- tests/expected/getid.stdout | 2 +- tests/expected/link.stderr | 1 + tests/expected/mem.stderr | 0 tests/expected/mem.stdout | 3 +++ tests/expected/setid.stderr | 0 tests/expected/setid.stdout | 3 +++ tests/expected/sleep.stderr | 3 +++ tests/expected/sleep.stdout | 0 tests/expected/sprintf.stderr | 0 tests/expected/sprintf.stdout | 0 tests/expected/stdlib/a64l.stderr | 0 tests/expected/stdlib/a64l.stdout | 2 ++ tests/expected/stdlib/strtol.stderr | 0 tests/expected/stdlib/strtol.stdout | 12 ++++++++++++ tests/expected/string/strchr.stderr | 0 tests/expected/string/strchr.stdout | 3 +++ tests/expected/string/strcspn.stderr | 0 tests/expected/string/strcspn.stdout | 2 ++ tests/expected/string/strncmp.stderr | 0 tests/expected/string/strncmp.stdout | 6 ++++++ tests/expected/string/strrchr.stderr | 0 tests/expected/string/strrchr.stdout | 1 + tests/expected/string/strspn.stderr | 0 tests/expected/string/strspn.stdout | 3 +++ tests/expected/unlink.stderr | 1 + tests/expected/unlink.stdout | 0 28 files changed, 44 insertions(+), 3 deletions(-) create mode 100644 tests/expected/mem.stderr create mode 100644 tests/expected/mem.stdout create mode 100644 tests/expected/setid.stderr create mode 100644 tests/expected/setid.stdout create mode 100644 tests/expected/sleep.stderr create mode 100644 tests/expected/sleep.stdout create mode 100644 tests/expected/sprintf.stderr create mode 100644 tests/expected/sprintf.stdout create mode 100644 tests/expected/stdlib/a64l.stderr create mode 100644 tests/expected/stdlib/a64l.stdout create mode 100644 tests/expected/stdlib/strtol.stderr create mode 100644 tests/expected/stdlib/strtol.stdout create mode 100644 tests/expected/string/strchr.stderr create mode 100644 tests/expected/string/strchr.stdout create mode 100644 tests/expected/string/strcspn.stderr create mode 100644 tests/expected/string/strcspn.stdout create mode 100644 tests/expected/string/strncmp.stderr create mode 100644 tests/expected/string/strncmp.stdout create mode 100644 tests/expected/string/strrchr.stderr create mode 100644 tests/expected/string/strrchr.stdout create mode 100644 tests/expected/string/strspn.stderr create mode 100644 tests/expected/string/strspn.stdout create mode 100644 tests/expected/unlink.stderr create mode 100644 tests/expected/unlink.stdout diff --git a/tests/.gitignore b/tests/.gitignore index d0bc0d66b3..9d5272bf2c 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -36,4 +36,5 @@ /string/strrchr /string/strspn /unlink +/unlink.out /write diff --git a/tests/expected/alloc.stdout b/tests/expected/alloc.stdout index 74753f94e3..e6f5022ade 100644 --- a/tests/expected/alloc.stdout +++ b/tests/expected/alloc.stdout @@ -1,2 +1,2 @@ -malloc 0x55ac6c472618 -calloc 0x55ac6c472618 +malloc 0x560fde600618 +calloc 0x560fde600618 diff --git a/tests/expected/getid.stdout b/tests/expected/getid.stdout index a51fd84a30..5ef0956cf2 100644 --- a/tests/expected/getid.stdout +++ b/tests/expected/getid.stdout @@ -1 +1 @@ -egid: 1000, euid: 1000, gid: 1000, pgid: 23916, pid: 23933, ppid 23918, uid 1000 +egid: 1000, euid: 1000, gid: 1000, pgid: 31979, pid: 32027, ppid 31982, uid 1000 diff --git a/tests/expected/link.stderr b/tests/expected/link.stderr index e69de29bb2..77bae796be 100644 --- a/tests/expected/link.stderr +++ b/tests/expected/link.stderr @@ -0,0 +1 @@ +link: File exists diff --git a/tests/expected/mem.stderr b/tests/expected/mem.stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/mem.stdout b/tests/expected/mem.stdout new file mode 100644 index 0000000000..d2f4e1f86e --- /dev/null +++ b/tests/expected/mem.stdout @@ -0,0 +1,3 @@ +# mem # +Correct memchr +Correct memccpy diff --git a/tests/expected/setid.stderr b/tests/expected/setid.stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/setid.stdout b/tests/expected/setid.stdout new file mode 100644 index 0000000000..269cd844e6 --- /dev/null +++ b/tests/expected/setid.stdout @@ -0,0 +1,3 @@ +32050 belongs to process group 32050 +32050 has egid 1000 and gid 1000 +32050 has euid 1000 and uid 1000 diff --git a/tests/expected/sleep.stderr b/tests/expected/sleep.stderr new file mode 100644 index 0000000000..df935fdb39 --- /dev/null +++ b/tests/expected/sleep.stderr @@ -0,0 +1,3 @@ +sleep: Success +usleep: Success +nanosleep: Success diff --git a/tests/expected/sleep.stdout b/tests/expected/sleep.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/sprintf.stderr b/tests/expected/sprintf.stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/sprintf.stdout b/tests/expected/sprintf.stdout new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/stdlib/a64l.stderr b/tests/expected/stdlib/a64l.stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/stdlib/a64l.stdout b/tests/expected/stdlib/a64l.stdout new file mode 100644 index 0000000000..18c83b1ed9 --- /dev/null +++ b/tests/expected/stdlib/a64l.stdout @@ -0,0 +1,2 @@ +Correct a64l: azAZ9. = 194301926 +Correct a64l: azA = 53222 diff --git a/tests/expected/stdlib/strtol.stderr b/tests/expected/stdlib/strtol.stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/stdlib/strtol.stdout b/tests/expected/stdlib/strtol.stdout new file mode 100644 index 0000000000..6f53efcf01 --- /dev/null +++ b/tests/expected/stdlib/strtol.stdout @@ -0,0 +1,12 @@ +-42 +555 +1234567890 +-42 +555 +1234567890 +38acf +abcdef12 +731 +731 +0 +0 diff --git a/tests/expected/string/strchr.stderr b/tests/expected/string/strchr.stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/string/strchr.stdout b/tests/expected/string/strchr.stdout new file mode 100644 index 0000000000..5a72f0ea5c --- /dev/null +++ b/tests/expected/string/strchr.stdout @@ -0,0 +1,3 @@ +ello +ld + diff --git a/tests/expected/string/strcspn.stderr b/tests/expected/string/strcspn.stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/string/strcspn.stdout b/tests/expected/string/strcspn.stdout new file mode 100644 index 0000000000..2b24e31277 --- /dev/null +++ b/tests/expected/string/strcspn.stdout @@ -0,0 +1,2 @@ +2 +6 diff --git a/tests/expected/string/strncmp.stderr b/tests/expected/string/strncmp.stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/string/strncmp.stdout b/tests/expected/string/strncmp.stdout new file mode 100644 index 0000000000..e385d8a988 --- /dev/null +++ b/tests/expected/string/strncmp.stdout @@ -0,0 +1,6 @@ +-97 +-195 +1 +-255 +-2 +0 diff --git a/tests/expected/string/strrchr.stderr b/tests/expected/string/strrchr.stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/string/strrchr.stdout b/tests/expected/string/strrchr.stdout new file mode 100644 index 0000000000..fdeaa3bc75 --- /dev/null +++ b/tests/expected/string/strrchr.stdout @@ -0,0 +1 @@ +strrch PASS, exiting with status code 0 diff --git a/tests/expected/string/strspn.stderr b/tests/expected/string/strspn.stderr new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/expected/string/strspn.stdout b/tests/expected/string/strspn.stdout new file mode 100644 index 0000000000..54d9c92604 --- /dev/null +++ b/tests/expected/string/strspn.stdout @@ -0,0 +1,3 @@ +5 +1 +0 diff --git a/tests/expected/unlink.stderr b/tests/expected/unlink.stderr new file mode 100644 index 0000000000..19e51d7f67 --- /dev/null +++ b/tests/expected/unlink.stderr @@ -0,0 +1 @@ +unlink: File exists diff --git a/tests/expected/unlink.stdout b/tests/expected/unlink.stdout new file mode 100644 index 0000000000..e69de29bb2 From 41e552b696ff9a082ec1b30a42fbe0f2798062f6 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 11 Mar 2018 21:04:53 -0600 Subject: [PATCH 08/11] Only expect output for a whitelist of binaries --- tests/Makefile | 23 ++++++++++++++--------- tests/expected/alloc.stderr | 0 tests/expected/alloc.stdout | 2 -- tests/expected/getid.stderr | 0 tests/expected/getid.stdout | 1 - tests/expected/setid.stderr | 0 tests/expected/setid.stdout | 3 --- 7 files changed, 14 insertions(+), 15 deletions(-) delete mode 100644 tests/expected/alloc.stderr delete mode 100644 tests/expected/alloc.stdout delete mode 100644 tests/expected/getid.stderr delete mode 100644 tests/expected/getid.stdout delete mode 100644 tests/expected/setid.stderr delete mode 100644 tests/expected/setid.stdout diff --git a/tests/Makefile b/tests/Makefile index 8a626402c0..1feb14bb75 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,5 +1,5 @@ -BINS=\ - alloc \ +# Binaries that should generate the same output every time +EXPECT_BINS=\ atof \ atoi \ brk \ @@ -13,14 +13,12 @@ BINS=\ fcntl \ fsync \ ftruncate \ - getid \ link \ math \ mem \ pipe \ printf \ rmdir \ - setid \ sleep \ sprintf \ stdlib/strtol \ @@ -33,32 +31,39 @@ BINS=\ unlink \ write +# Binaries that may generate varied output +BINS=\ + $(EXPECT_BINS) \ + alloc \ + getid \ + setid + all: $(BINS) clean: rm -f $(BINS) *.out run: $(BINS) - for bin in $(BINS); \ + for bin in $^; \ do \ echo "# $${bin} #"; \ "./$${bin}" test args; \ done -expected: $(BINS) +expected: $(EXPECT_BINS) rm -rf expected mkdir -p expected - for bin in $(BINS); \ + for bin in $^; \ do \ echo "# $${bin} #"; \ mkdir -p expected/`dirname $${bin}`; \ "./$${bin}" test args > "expected/$${bin}.stdout" 2> "expected/$${bin}.stderr"; \ done -verify: $(BINS) +verify: $(EXPECT_BINS) rm -rf gen mkdir -p gen - for bin in $(BINS); \ + for bin in $^; \ do \ echo "# $${bin} #"; \ mkdir -p gen/`dirname $${bin}`; \ diff --git a/tests/expected/alloc.stderr b/tests/expected/alloc.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/expected/alloc.stdout b/tests/expected/alloc.stdout deleted file mode 100644 index e6f5022ade..0000000000 --- a/tests/expected/alloc.stdout +++ /dev/null @@ -1,2 +0,0 @@ -malloc 0x560fde600618 -calloc 0x560fde600618 diff --git a/tests/expected/getid.stderr b/tests/expected/getid.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/expected/getid.stdout b/tests/expected/getid.stdout deleted file mode 100644 index 5ef0956cf2..0000000000 --- a/tests/expected/getid.stdout +++ /dev/null @@ -1 +0,0 @@ -egid: 1000, euid: 1000, gid: 1000, pgid: 31979, pid: 32027, ppid 31982, uid 1000 diff --git a/tests/expected/setid.stderr b/tests/expected/setid.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/expected/setid.stdout b/tests/expected/setid.stdout deleted file mode 100644 index 269cd844e6..0000000000 --- a/tests/expected/setid.stdout +++ /dev/null @@ -1,3 +0,0 @@ -32050 belongs to process group 32050 -32050 has egid 1000 and gid 1000 -32050 has euid 1000 and uid 1000 From 477e8eb4e03f2eac591b2b1212167831ffef5afd Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 11 Mar 2018 21:11:08 -0600 Subject: [PATCH 09/11] Exit run, expected, or verify on error in loop --- tests/Makefile | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 1feb14bb75..7b61b5e61f 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -47,7 +47,7 @@ run: $(BINS) for bin in $^; \ do \ echo "# $${bin} #"; \ - "./$${bin}" test args; \ + "./$${bin}" test args || exit $$?; \ done expected: $(EXPECT_BINS) @@ -57,7 +57,7 @@ expected: $(EXPECT_BINS) do \ echo "# $${bin} #"; \ mkdir -p expected/`dirname $${bin}`; \ - "./$${bin}" test args > "expected/$${bin}.stdout" 2> "expected/$${bin}.stderr"; \ + "./$${bin}" test args > "expected/$${bin}.stdout" 2> "expected/$${bin}.stderr" || exit $$?; \ done verify: $(EXPECT_BINS) @@ -67,9 +67,9 @@ verify: $(EXPECT_BINS) do \ echo "# $${bin} #"; \ mkdir -p gen/`dirname $${bin}`; \ - "./$${bin}" test args > "gen/$${bin}.stdout" 2> "gen/$${bin}.stderr"; \ - diff -u "gen/$${bin}.stdout" "expected/$${bin}.stdout"; \ - diff -u "gen/$${bin}.stderr" "expected/$${bin}.stderr"; \ + "./$${bin}" test args > "gen/$${bin}.stdout" 2> "gen/$${bin}.stderr" || exit $$?; \ + diff -u "gen/$${bin}.stdout" "expected/$${bin}.stdout" || exit $$?; \ + diff -u "gen/$${bin}.stderr" "expected/$${bin}.stderr" || exit $$?; \ done GCCHEAD=\ From 232e364f608f2396977fabc9bd1e872dce29e4f2 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 11 Mar 2018 21:20:56 -0600 Subject: [PATCH 10/11] Remove warnings, build openlibm without stack protector --- test.sh | 9 +++------ tests/.gitignore | 7 ++----- tests/Makefile | 2 +- tests/expected/chdir.stderr | 0 tests/expected/chdir.stdout | 2 -- tests/expected/math.stdout | 1 + tests/fcntl.out | 0 tests/link.c | 1 + tests/math.c | 5 ++++- 9 files changed, 12 insertions(+), 15 deletions(-) delete mode 100644 tests/expected/chdir.stderr delete mode 100644 tests/expected/chdir.stdout delete mode 100755 tests/fcntl.out diff --git a/test.sh b/test.sh index 27f033bb63..1e6d7b819a 100755 --- a/test.sh +++ b/test.sh @@ -4,10 +4,7 @@ set -ex cargo build cargo build --manifest-path src/crt0/Cargo.toml -cd openlibm -make -cd .. +CFLAGS=-fno-stack-protector make -C openlibm -cd tests -make clean -make run +make -C tests clean +make -C tests run diff --git a/tests/.gitignore b/tests/.gitignore index 9d5272bf2c..6cfb8396be 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,3 +1,4 @@ +/*.out /gen/ /alloc /args @@ -6,19 +7,15 @@ /brk /chdir /create -/create.out /ctype /dup -/dup.out /error /fchdir /fcntl /fsync /ftruncate -/ftruncate.out /getid /link -/link.out /math /mem /setid @@ -36,5 +33,5 @@ /string/strrchr /string/strspn /unlink -/unlink.out /write + diff --git a/tests/Makefile b/tests/Makefile index 7b61b5e61f..a252889605 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -4,7 +4,6 @@ EXPECT_BINS=\ atoi \ brk \ args \ - chdir \ create \ ctype \ dup \ @@ -35,6 +34,7 @@ EXPECT_BINS=\ BINS=\ $(EXPECT_BINS) \ alloc \ + chdir \ getid \ setid diff --git a/tests/expected/chdir.stderr b/tests/expected/chdir.stderr deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/tests/expected/chdir.stdout b/tests/expected/chdir.stdout deleted file mode 100644 index 6d79e11be0..0000000000 --- a/tests/expected/chdir.stdout +++ /dev/null @@ -1,2 +0,0 @@ -initial cwd: /home/jeremy/Projects/relibc/tests -final cwd: /home/jeremy/Projects/relibc diff --git a/tests/expected/math.stdout b/tests/expected/math.stdout index e69de29bb2..087a3bdf0e 100644 --- a/tests/expected/math.stdout +++ b/tests/expected/math.stdout @@ -0,0 +1 @@ +cos(3.14) = -0.9999987483024597 diff --git a/tests/fcntl.out b/tests/fcntl.out deleted file mode 100755 index e69de29bb2..0000000000 diff --git a/tests/link.c b/tests/link.c index 383575e8ce..4df0dfde2f 100644 --- a/tests/link.c +++ b/tests/link.c @@ -1,3 +1,4 @@ +#include #include int main(int argc, char** argv) { diff --git a/tests/math.c b/tests/math.c index 159bb14ced..981300fdef 100644 --- a/tests/math.c +++ b/tests/math.c @@ -1,5 +1,8 @@ #include +#include int main(int argc, char ** argv) { - float c = cos(3.14); + double pi = 3.14; + float c = cos(pi); + printf("cos(%f) = %f\n", pi, c); } From 79123321376678c0457d962a2a62cf722a0ca056 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Sun, 11 Mar 2018 21:26:21 -0600 Subject: [PATCH 11/11] Mark sys_time functions no_mangle --- src/sys_time/src/lib.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/sys_time/src/lib.rs b/src/sys_time/src/lib.rs index d56c5755a2..fc03634d3a 100644 --- a/src/sys_time/src/lib.rs +++ b/src/sys_time/src/lib.rs @@ -23,10 +23,12 @@ pub struct fd_set { pub fds_bits: [c_long; 16usize], } +#[no_mangle] pub extern "C" fn getitimer(which: c_int, value: *mut itimerval) -> c_int { unimplemented!(); } +#[no_mangle] pub extern "C" fn setitimer( which: c_int, value: *const itimerval, @@ -35,10 +37,12 @@ pub extern "C" fn setitimer( unimplemented!(); } +#[no_mangle] pub extern "C" fn gettimeofday(tp: *mut timeval, tzp: *const c_void) -> c_int { unimplemented!(); } +#[no_mangle] pub extern "C" fn select( nfds: c_int, readfds: *mut fd_set, @@ -49,6 +53,7 @@ pub extern "C" fn select( unimplemented!(); } +#[no_mangle] pub extern "C" fn utimes(path: *const c_char, times: [timeval; 2]) -> c_int { unimplemented!(); }