Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ci/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ case $HOST_TARGET in
MANY_SEEDS=16 TEST_TARGET=x86_64-unknown-freebsd run_tests
MANY_SEEDS=16 TEST_TARGET=i686-unknown-freebsd run_tests
MANY_SEEDS=16 TEST_TARGET=x86_64-unknown-illumos run_tests
MANY_SEEDS=16 TEST_TARGET=x86_64-unknown-netbsd run_tests_minimal hello
;;
armv7-unknown-linux-gnueabihf)
# Host
Expand Down
14 changes: 10 additions & 4 deletions src/shims/unix/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,13 @@ const PTHREAD_INIT: u8 = 1;
#[inline]
fn mutexattr_kind_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, u64> {
interp_ok(match &ecx.tcx.sess.target.os {
Os::Linux | Os::Illumos | Os::Solaris | Os::MacOs | Os::FreeBsd | Os::Android => 0,
Os::Linux
| Os::Illumos
| Os::Solaris
| Os::MacOs
| Os::FreeBsd
| Os::Android
| Os::NetBsd => 0,
os => throw_unsup_format!("`pthread_mutexattr` is not supported on {os}"),
})
}
Expand Down Expand Up @@ -135,8 +141,8 @@ impl SyncObj for PthreadMutex {
fn mutex_init_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, Size> {
let offset = match &ecx.tcx.sess.target.os {
Os::Linux | Os::Illumos | Os::Solaris | Os::FreeBsd | Os::Android => 0,
// macOS stores a signature in the first bytes, so we move to offset 4.
Os::MacOs => 4,
// macOS and NetBSD store a signature in the first bytes, so we move to offset 4.
Os::MacOs | Os::NetBsd => 4,
os => throw_unsup_format!("`pthread_mutex` is not supported on {os}"),
};
let offset = Size::from_bytes(offset);
Expand All @@ -163,7 +169,7 @@ fn mutex_init_offset<'tcx>(ecx: &MiriInterpCx<'tcx>) -> InterpResult<'tcx, Size>
check_static_initializer("PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP");
check_static_initializer("PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP");
}
Os::Illumos | Os::Solaris | Os::MacOs | Os::FreeBsd | Os::Android => {
Os::Illumos | Os::Solaris | Os::MacOs | Os::FreeBsd | Os::Android | Os::NetBsd => {
// No non-standard initializers.
}
os => throw_unsup_format!("`pthread_mutex` is not supported on {os}"),
Expand Down