From ae6daf77ba9762f4f118b2342298ce5fa2e32a7a Mon Sep 17 00:00:00 2001 From: bjorn3 Date: Fri, 22 Jan 2021 12:28:32 +0100 Subject: [PATCH] Default to Cranelift newBE --- .github/workflows/main.yml | 2 +- Cargo.toml | 2 +- build.sh | 13 +++++++------ src/lib.rs | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9eeca7c2819..20c58423a0c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: os: [ubuntu-latest, macos-latest] env: - BACKEND: "" - - BACKEND: --features newbe + - BACKEND: --oldbe steps: - uses: actions/checkout@v2 diff --git a/Cargo.toml b/Cargo.toml index eb9d4e09ebc..4558da2de73 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ libloading = { version = "0.6.0", optional = true } default = ["jit", "inline_asm"] jit = ["cranelift-jit", "libloading"] inline_asm = [] -newbe = [] +oldbe = [] [profile.dev] # By compiling dependencies with optimizations, performing tests gets much faster. diff --git a/build.sh b/build.sh index a00c01a179c..522b3b3f592 100755 --- a/build.sh +++ b/build.sh @@ -5,7 +5,7 @@ set -e export CHANNEL="release" build_sysroot=1 target_dir='build' -newbe='' +oldbe='' while [[ $# != 0 ]]; do case $1 in "--debug") @@ -18,12 +18,13 @@ while [[ $# != 0 ]]; do target_dir=$2 shift ;; - "--newbe") - newbe='--features newbe' + "--oldbe") + oldbe='--features oldbe' ;; *) echo "Unknown flag '$1'" - echo "Usage: ./build.sh [--debug] [--without-sysroot] [--target-dir DIR] [--newbe]" + echo "Usage: ./build.sh [--debug] [--without-sysroot] [--target-dir DIR] [--oldbe]" + exit 1 ;; esac shift @@ -43,9 +44,9 @@ else exit 1 fi if [[ "$CHANNEL" == "release" ]]; then - cargo build $newbe --release + cargo build $oldbe --release else - cargo build $newbe + cargo build $oldbe fi rm -rf "$target_dir" diff --git a/src/lib.rs b/src/lib.rs index 2152d2ebdef..9b5b7d8051c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -339,10 +339,10 @@ fn build_isa(sess: &Session) -> Box { let flags = settings::Flags::new(flags_builder); - let variant = if cfg!(feature = "newbe") { - cranelift_codegen::isa::BackendVariant::MachInst - } else { + let variant = if cfg!(feature = "oldbe") { cranelift_codegen::isa::BackendVariant::Legacy + } else { + cranelift_codegen::isa::BackendVariant::MachInst }; let mut isa_builder = cranelift_codegen::isa::lookup_variant(target_triple, variant).unwrap(); // Don't use "haswell", as it implies `has_lzcnt`.macOS CI is still at Ivy Bridge EP, so `lzcnt`