Skip to content

Commit

Permalink
Disable JIT compiler on unsupported platforms (#21215)
Browse files Browse the repository at this point in the history
(cherry picked from commit b4d0938)
  • Loading branch information
fanatid authored and mergify-bot committed Nov 9, 2021
1 parent a7b3436 commit 0914dc9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 6 additions & 0 deletions ledger/src/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ macro_rules! to_builtin {

/// Builtin programs that are always available
fn genesis_builtins(bpf_jit: bool) -> Vec<Builtin> {
// Currently JIT is not supported on the BPF VM:
// !x86_64: https://github.com/qmonnet/rbpf/issues/48
// Windows: https://github.com/solana-labs/rbpf/issues/217
#[cfg(any(not(target_arch = "x86_64"), target_family = "windows"))]
let bpf_jit = false;

vec![
to_builtin!(solana_bpf_loader_deprecated_program!()),
if bpf_jit {
Expand Down
7 changes: 1 addition & 6 deletions validator/src/bin/solana-test-validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,11 +392,6 @@ fn main() {
IpAddr::V4(Ipv4Addr::new(0, 0, 0, 0)),
faucet_port,
));
// JIT not supported on the BPF VM in Windows currently: https://github.com/solana-labs/rbpf/issues/217
#[cfg(target_family = "windows")]
let bpf_jit = false;
#[cfg(not(target_family = "windows"))]
let bpf_jit = !matches.is_present("no_bpf_jit");

let mut programs = vec![];
if let Some(values) = matches.values_of("bpf_program") {
Expand Down Expand Up @@ -550,7 +545,7 @@ fn main() {
faucet_addr,
..JsonRpcConfig::default()
})
.bpf_jit(bpf_jit)
.bpf_jit(!matches.is_present("no_bpf_jit"))
.rpc_port(rpc_port)
.add_programs_with_path(&programs);

Expand Down

0 comments on commit 0914dc9

Please sign in to comment.