Skip to content
Merged
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
8 changes: 7 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,12 @@ jobs:
env:
RUSTFLAGS: "--cfg arc_try_new"

# Check the x64 assembler against the Intel XED disassembler, which knows
# about newer encodings that the bundled Capstone cannot decode. This is
# opt-in via `fuzz-xed` because XED is built from source; the C compiler and
# Python that requires are already present on this runner.
- run: cargo test -p cranelift-assembler-x64 --features fuzz-xed

# Smoke test the coverage script.
- run: rustup target add wasm32-unknown-unknown
- run: rustup component add llvm-tools
Expand All @@ -735,7 +741,7 @@ jobs:
- uses: ./.github/actions/apt-get-install
with:
packages: ocaml-nox ocamlbuild ocaml-findlib libzarith-ocaml-dev
- run: cargo fuzz check --dev
- run: cargo fuzz check --dev --features fuzz-xed
- run: cargo fuzz check --dev --fuzz-dir ./cranelift/isle/fuzz
- run: cargo fuzz check --dev --fuzz-dir ./crates/environ/fuzz --features component-model
- run: cargo fuzz check --dev --fuzz-dir ./cranelift/assembler-x64/fuzz
Expand Down
57 changes: 37 additions & 20 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,7 @@ clap = { version = "4.5.48", default-features = false, features = ["std", "deriv
clap_complete = "4.5.58"
hashbrown = { version = "0.17", default-features = false }
capstone = { version = "0.14.0", default-features = false, features = ['full', 'arch_x86', 'arch_riscv', 'arch_arm64', 'arch_sysz'] }
xed-sys = { version = "0.6" }
smallvec = { version = "1.15.1", features = ["union"] }
tracing = { version = "0.1.41", default-features = false }
bitflags = "2.9.4"
Expand Down
14 changes: 14 additions & 0 deletions cranelift/assembler-x64/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ rust-version.workspace = true
arbitrary = { workspace = true, features = ["derive"], optional = true }
capstone = { workspace = true, optional = true }

# XED is built from C source by its own Python build system, which is picky
# about its environment: it only recognizes x86 host CPUs, and it invokes LLVM
# toolchain binaries (e.g. `llvm-ar`) that are not present on every runner.
# Restrict it to x86_64 Linux -- the only configuration where the oracle
# actually runs, i.e. the `fuzz-xed` CI job and OSS-Fuzz -- so that
# `--all-features` builds keep working elsewhere (see `ci/run-tests.py`).
[target.'cfg(all(target_arch = "x86_64", target_os = "linux"))'.dependencies]
xed-sys = { workspace = true, optional = true }

[dev-dependencies]
arbitrary = { workspace = true, features = ["derive"] }
arbtest = { workspace = true }
Expand All @@ -23,3 +32,8 @@ workspace = true

[features]
fuzz = ['dep:arbitrary', 'dep:capstone']
# Adds Intel XED as a second, optional disassembler oracle for the roundtrip
# fuzzer. This is additive on top of `fuzz` (Capstone remains the default
# oracle); XED is only built when this feature is explicitly enabled, and only
# on x86_64 Linux. Note that building XED requires Python 3.9+ and a C compiler.
fuzz-xed = ['fuzz', 'dep:xed-sys']
Loading
Loading