Commit Graph

1946 Commits

Author SHA1 Message Date
Ralf Jung
5d35548985 helpers.rs cleanup 2020-02-23 18:52:12 +01:00
bors
2752d1b74b Auto merge of #1167 - christianpoveda:shims-refactor, r=RalfJung
Reorganize shims by platform

Fixes https://github.com/rust-lang/miri/issues/1161. I am currently testing which shims belong to which platform. If you are reading this and know the answer for any of those please write me :P

Edit: this is a list of the shims I haven't been able to figure out to which platform they belong:
 -~~`malloc`~~
 -~~`calloc`~~
 -~~`posix_memalign`~~
 -~~`free`~~
 -~~`realloc`~~
 -~~`__rust_alloc`~~
 -~~`__rust_alloc_zeroed`~~
 -~~`__rust_dealloc`~~
 -~~`__rust_realloc`~~
 -~~`__rust_maybe_catch_panic`~~
 -~~`syscall`~~
 -~~`getrandom`~~
 -~~`dlsym`~~
 -~~`memcmp`~~
 -~~`memrchr`~~
 -~~`memchr`~~
 -~~`strlen`~~
 -~~`signal`~~
 -~~`sigaction`~~
 -~~`sigaltstack`~~
 -~~`sysconf`~~
 -~~`sched_getaffinity`~~
 -~~`isatty`~~
 -~~`pthread_key_create`~~
 -~~`pthread_key_delete`~~
 -~~`pthread_getspecific`~~
 -~~`pthread_setspecific`~~
 -~~`pthread_attr_init`~~
 -~~`pthread_attr_destroy`~~
 -~~`pthread_self`~~
 -~~`pthread_attr_setstacksize`~~
 -~~`pthread_attr_getstack`~~
 -~~`pthread_create`~~
 -~~`pthread_mutexattr_init`~~
 -~~`pthread_mutexattr_settype`~~
 -~~`pthread_mutex_init`~~
 -~~`pthread_mutexattr_destroy`~~
 -~~`pthread_mutex_lock`~~
 -~~`pthread_mutex_unlock`~~
 -~~`pthread_mutex_destroy`~~
 -~~`pthread_rwlock_rdlock`~~
 -~~`pthread_rwlock_unlock`~~
 -~~`pthread_rwlock_wrlock`~~
 -~~`pthread_rwlock_destroy`~~
 -~~`pthread_condattr_init`~~
 -~~`pthread_condattr_setclock`~~
 -~~`pthread_cond_init`~~
 -~~`pthread_condattr_destroy`~~
 -~~`pthread_cond_destroy`~~
 -~~`pthread_atfork`~~
 -~~`posix_fadvise`~~
 -~~`mmap`~~
 -~~`mprotect`~~
2020-02-23 17:03:30 +00:00
Christian Poveda
208665836e
panic if target platform is incorrect instead 2020-02-22 09:02:29 -05:00
Christian Poveda
c2bcab55b0
improve docs 2020-02-22 08:55:45 -05:00
Christian Poveda
9e9a090026
minor fixes 2020-02-22 02:18:42 -05:00
Ralf Jung
08332bc730 dont overwrite bootstrap flags 2020-02-21 20:06:31 +01:00
Christian Poveda
bb3a711b3e
rename platform specific shims 2020-02-19 17:53:33 -05:00
Christian Poveda
3418b40dac
remove syscall shim from macos and move getrandom to linux module 2020-02-19 17:48:16 -05:00
Christian Poveda
b213f88b58
promote memrchr to work on any platform 2020-02-19 17:48:15 -05:00
Christian Poveda
9a7bc3972c
promote open and lseek shims to posix 2020-02-19 17:48:15 -05:00
Christian Poveda
dbef2340b2
add docs for `emulate_foreign_item_by_bame 2020-02-19 17:48:15 -05:00
Christian Poveda
32bc015e35
reorganize comments for shim's classification 2020-02-19 17:48:15 -05:00
Christian Poveda
bc7513bffd
move CreateThread to windows shims 2020-02-19 17:48:15 -05:00
Christian Poveda
1dbc0c9869
remove hack for panics 2020-02-19 17:48:15 -05:00
Christian Poveda
b819493585
move remaining shims 2020-02-19 17:48:15 -05:00
Christian Poveda
63160c66cd
move pthread related functions 2020-02-19 17:48:15 -05:00
Christian Poveda
8fe7543191
add helper function for target platform checks 2020-02-19 17:47:34 -05:00
David Cook
ae7d98b68f Extract constant for minimum fd 2020-02-18 18:06:33 -06:00
David Cook
8216f3c0f3 Back out placeholder variants from FileHandle 2020-02-17 22:24:33 -06:00
David Cook
a6a8f09f1e Address review comments 2020-02-17 22:24:33 -06:00
David Cook
962a740426 Rewrite file descriptor handling 2020-02-17 22:24:33 -06:00
David Cook
eda35e153b Add methods to FileHandler 2020-02-17 22:24:33 -06:00
David Cook
1de9d107cf Style fixes 2020-02-17 22:24:33 -06:00
David Cook
3aff803868 Add comment 2020-02-17 22:24:33 -06:00
David Cook
085874d1ff Add F_DUPFD/F_DUPFD_CLOEXEC to fcntl shim 2020-02-17 22:24:33 -06:00
bors
daaf9f7e28 Auto merge of #1177 - RalfJung:debug-assert, r=RalfJung
Make sure we evaluate debug assertions in local crate and libstd

Fixes https://github.com/rust-lang/miri/issues/1126
2020-02-16 13:04:06 +00:00
Ralf Jung
6ff5b3fcf9 make sure we also trigger debug assertions in libstd 2020-02-16 13:55:51 +01:00
Christian Poveda
c233c4ad9c
migrate more functions 2020-02-14 16:37:30 -05:00
Christian Poveda
f2f8fb2c20
migrate more functions 2020-02-14 16:37:30 -05:00
Christian Poveda
e7d6e718b9
reorganize shims by platform 2020-02-14 16:37:29 -05:00
bors
0a803c9752 Auto merge of #1158 - divergentdave:shim-rename, r=RalfJung
Add shim for rename

This adds a straightforward shim for rename, which is used by `std::fs::rename`. Testing is included.

As a heads up, I expect one or two merge conflicts between my PRs, since some of them touch the same `use` statements, or add items near the same places. I'll rebase and fix them as they come up.
2020-02-14 20:26:23 +00:00
Ralf Jung
26d25220ef fix for Panic InterpError refactoring 2020-02-13 14:01:35 +01:00
David Cook
38204b6321 Add shim for rename 2020-02-08 22:33:49 -06:00
bors
f9615bfd67 Auto merge of #1159 - divergentdave:shim-seek, r=RalfJung
Add shim for seeking files

This adds a shim for `lseek64` (`lseek` on macOS). This enables the use of `<File as Seek>::seek`. Testing is included.
2020-02-08 13:54:33 +00:00
Ralf Jung
4b6a0d7a8e bump rustc; adjust tests 2020-02-06 11:20:28 +01:00
bors
e7f5c4f155 Auto merge of #1151 - divergentdave:statx-AT_EMPTY_PATH, r=RalfJung
Add support for AT_EMPTY_PATH to statx shim

This enables use of `File::metadata()`.
2020-01-30 21:30:32 +00:00
Ralf Jung
ef154df607 pass MPlaceTy by-value, as we usually do 2020-01-30 13:38:49 +01:00
David Cook
2f25e4cd17 Error with EINVAL on unsupported whence argument 2020-01-29 19:04:18 -06:00
David Cook
6e9abea272 Update comment 2020-01-28 22:59:28 -06:00
David Cook
d8da3968d6 Change function name, comments, and error message 2020-01-28 19:43:55 -06:00
David Cook
0d0902a1e1 Apply shim to lseek too (for macOS) 2020-01-26 18:07:31 -06:00
David Cook
01b5e8260e Add no-op shim for posix_fadvise 2020-01-26 15:10:01 -06:00
David Cook
03b5d95cff Add shim for lseek64 2020-01-26 12:36:36 -06:00
David Cook
90f3aae2de Add fstat shim for OSX 2020-01-26 11:58:08 -06:00
David Cook
d94b88ef98 Add support for AT_EMPTY_PATH to statx shim 2020-01-25 22:21:33 -06:00
David Cook
625fa742bc
Shim intrinsics::atomic_singlethreadfence, etc. 2020-01-24 19:02:58 -06:00
bors
6a0f14bef7 Auto merge of #1146 - RalfJung:rustup, r=RalfJung
Rustup
2020-01-15 18:36:23 +00:00
Ralf Jung
23c74449a2 rustup 2020-01-15 19:27:21 +01:00
bors
b4c54b4641 Auto merge of #1143 - christianpoveda:symlink-shim, r=RalfJung
Add shim for symbolic link creation

r? @RalfJung
2020-01-10 17:21:12 +00:00
Christian Poveda
5e71f2debc
fix windows symlink creation 2020-01-10 12:18:24 -05:00