The sample program in cranelift/filetests/src/function_runner.rs would abort with an mprotect failure under certain circumstances, see https://github.com/bytecodealliance/wasmtime/pull/4453#issuecomment-1303803222 Root cause was that enabling PROT_EXEC on the main process heap may be prohibited, depending on Linux distro and version. This only shows up in the doc test sample program because the main clif-util is multi-threaded and therefore allocations will happen on glibc's per-thread heap, which is allocated via mmap, and not the main process heap. Work around the problem by enabling the "selinux-fix" feature of the cranelift-jit crate dependency in the filetests. Note that this didn't compile out of the box, so a separate fix is also required and provided as part of this PR. Going forward, it would be preferable to always use mmap to allocate the backing memory for JITted code.
30 lines
1009 B
TOML
30 lines
1009 B
TOML
[package]
|
|
name = "cranelift-filetests"
|
|
authors = ["The Cranelift Project Developers"]
|
|
version = "0.0.0"
|
|
description = "Test driver and implementations of the filetest commands"
|
|
license = "Apache-2.0 WITH LLVM-exception"
|
|
documentation = "https://docs.rs/cranelift-filetests"
|
|
repository = "https://github.com/bytecodealliance/wasmtime"
|
|
publish = false
|
|
edition.workspace = true
|
|
|
|
[dependencies]
|
|
cranelift-codegen = { workspace = true, features = ["testing_hooks"] }
|
|
cranelift-frontend = { workspace = true }
|
|
cranelift-interpreter = { workspace = true }
|
|
cranelift-native = { workspace = true }
|
|
cranelift-reader = { workspace = true }
|
|
cranelift-preopt = { workspace = true }
|
|
cranelift-jit = { workspace = true, features = ["selinux-fix"] }
|
|
cranelift-module = { workspace = true }
|
|
file-per-thread-logger = "0.1.2"
|
|
filecheck = "0.5.0"
|
|
gimli = { workspace = true }
|
|
log = { workspace = true }
|
|
num_cpus = "1.8.0"
|
|
target-lexicon = { workspace = true }
|
|
thiserror = "1.0.15"
|
|
anyhow = { workspace = true }
|
|
similar = "2.1.0"
|