Skip to content

Commit d220159

Browse files
committed
Merge commit '05677b6bd6c938ed760835d9b1f6514992654ae3' into sync_cg_clif-2021-08-06
1 parent 0f83ac1 commit d220159

40 files changed

+823
-590
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ jobs:
4949
- name: Install MinGW toolchain and wine
5050
if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
5151
run: |
52+
sudo apt-get update
5253
sudo apt-get install -y gcc-mingw-w64-x86-64 wine-stable
5354
rustup target add x86_64-pc-windows-gnu
5455
5556
- name: Install AArch64 toolchain and qemu
5657
if: matrix.os == 'ubuntu-latest' && matrix.env.TARGET_TRIPLE == 'aarch64-unknown-linux-gnu'
5758
run: |
59+
sudo apt-get update
5860
sudo apt-get install -y gcc-aarch64-linux-gnu qemu-user
5961
6062
- name: Prepare dependencies

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,4 @@ perf.data.old
1515
/rand
1616
/regex
1717
/simple-raytracer
18+
/stdsimd

Cargo.lock

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ crate-type = ["dylib"]
88

99
[dependencies]
1010
# These have to be in sync with each other
11-
cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main", features = ["unwind", "all-arch"] }
12-
cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main" }
13-
cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main" }
14-
cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main" }
15-
cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main", optional = true }
16-
cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git", branch = "main" }
11+
cranelift-codegen = { git = "https://github.com/bytecodealliance/wasmtime.git", features = ["unwind", "all-arch"] }
12+
cranelift-frontend = { git = "https://github.com/bytecodealliance/wasmtime.git" }
13+
cranelift-module = { git = "https://github.com/bytecodealliance/wasmtime.git" }
14+
cranelift-native = { git = "https://github.com/bytecodealliance/wasmtime.git" }
15+
cranelift-jit = { git = "https://github.com/bytecodealliance/wasmtime.git", optional = true }
16+
cranelift-object = { git = "https://github.com/bytecodealliance/wasmtime.git" }
1717
target-lexicon = "0.12.0"
18-
gimli = { version = "0.24.0", default-features = false, features = ["write"]}
19-
object = { version = "0.25.0", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
18+
gimli = { version = "0.25.0", default-features = false, features = ["write"]}
19+
object = { version = "0.26.0", default-features = false, features = ["std", "read_core", "write", "archive", "coff", "elf", "macho", "pe"] }
2020

2121
ar = { git = "https://github.com/bjorn3/rust-ar.git", branch = "do_not_remove_cg_clif_ranlib" }
2222
indexmap = "1.0.2"
@@ -36,7 +36,8 @@ smallvec = "1.6.1"
3636
#gimli = { path = "../" }
3737

3838
[features]
39-
default = ["jit", "inline_asm"]
39+
# Enable features not ready to be enabled when compiling as part of rustc
40+
unstable-features = ["jit", "inline_asm"]
4041
jit = ["cranelift-jit", "libloading"]
4142
inline_asm = []
4243

build_sysroot/Cargo.lock

Lines changed: 4 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build_system/build_backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::process::Command;
44

55
pub(crate) fn build_backend(channel: &str, host_triple: &str) -> PathBuf {
66
let mut cmd = Command::new("cargo");
7-
cmd.arg("build").arg("--target").arg(host_triple);
7+
cmd.arg("build").arg("--target").arg(host_triple).arg("--features").arg("unstable-features");
88

99
match channel {
1010
"debug" => {}

build_system/build_sysroot.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,9 @@ pub(crate) fn build_sysroot(
9191
{
9292
let file = file.unwrap().path();
9393
let file_name_str = file.file_name().unwrap().to_str().unwrap();
94-
if file_name_str.contains("rustc_")
94+
if (file_name_str.contains("rustc_")
95+
&& !file_name_str.contains("rustc_std_workspace_")
96+
&& !file_name_str.contains("rustc_demangle"))
9597
|| file_name_str.contains("chalk")
9698
|| file_name_str.contains("tracing")
9799
|| file_name_str.contains("regex")

build_system/prepare.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ pub(crate) fn prepare() {
2727
"341f207c1071f7290e3f228c710817c280c8dca1",
2828
);
2929

30+
clone_repo(
31+
"stdsimd",
32+
"https://github.com/rust-lang/stdsimd",
33+
"be96995d8ddec03fac9a0caf4d4c51c7fbc33507",
34+
);
35+
apply_patches("stdsimd", Path::new("stdsimd"));
36+
3037
clone_repo(
3138
"simple-raytracer",
3239
"https://github.com/ebobby/simple-raytracer",
@@ -60,11 +67,7 @@ fn prepare_sysroot() {
6067
copy_dir_recursively(&sysroot_src_orig.join("library"), &sysroot_src.join("library"));
6168

6269
let rustc_version = get_rustc_version();
63-
fs::write(
64-
Path::new("build_sysroot").join("rustc_version"),
65-
&rustc_version,
66-
)
67-
.unwrap();
70+
fs::write(Path::new("build_sysroot").join("rustc_version"), &rustc_version).unwrap();
6871

6972
eprintln!("[GIT] init");
7073
let mut git_init_cmd = Command::new("git");

clean_all.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ set -e
33

44
rm -rf build_sysroot/{sysroot_src/,target/,compiler-builtins/,rustc_version}
55
rm -rf target/ build/ perf.data{,.old}
6-
rm -rf rand/ regex/ simple-raytracer/
6+
rm -rf rand/ regex/ simple-raytracer/ stdsimd/

docs/usage.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ $ $cg_clif_dir/build/cargo jit
3636
or
3737

3838
```bash
39-
$ $cg_clif_dir/build/bin/cg_clif -Cllvm-args=mode=jit -Cprefer-dynamic my_crate.rs
39+
$ $cg_clif_dir/build/bin/cg_clif -Zunstable-features -Cllvm-args=mode=jit -Cprefer-dynamic my_crate.rs
4040
```
4141

4242
There is also an experimental lazy jit mode. In this mode functions are only compiled once they are
@@ -52,7 +52,7 @@ These are a few functions that allow you to easily run rust code from the shell
5252

5353
```bash
5454
function jit_naked() {
55-
echo "$@" | $cg_clif_dir/build/bin/cg_clif - -Cllvm-args=mode=jit -Cprefer-dynamic
55+
echo "$@" | $cg_clif_dir/build/bin/cg_clif - -Zunstable-features -Cllvm-args=mode=jit -Cprefer-dynamic
5656
}
5757

5858
function jit() {

0 commit comments

Comments
 (0)