Skip to content

Commit 70ba23b

Browse files
authored
Merge pull request rust-lang#1300 from bjorn3/rename_build_to_dist
Rename the build/ directory to dist/
2 parents a00c7a0 + 9c21990 commit 70ba23b

File tree

13 files changed

+51
-46
lines changed

13 files changed

+51
-46
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
./y.rs test
112112
113113
- name: Package prebuilt cg_clif
114-
run: tar cvfJ cg_clif.tar.xz build
114+
run: tar cvfJ cg_clif.tar.xz dist
115115

116116
- name: Upload prebuilt cg_clif
117117
if: matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
@@ -213,7 +213,7 @@ jobs:
213213
214214
- name: Package prebuilt cg_clif
215215
# don't use compression as xzip isn't supported by tar on windows and bzip2 hangs
216-
run: tar cvf cg_clif.tar build
216+
run: tar cvf cg_clif.tar dist
217217

218218
- name: Upload prebuilt cg_clif
219219
uses: actions/upload-artifact@v3

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ perf.data.old
1414
/build_sysroot/sysroot_src
1515
/build_sysroot/compiler-builtins
1616
/build_sysroot/rustc_version
17+
/dist
1718
/rust
1819
/download

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Assuming `$cg_clif_dir` is the directory you cloned this repo into and you follo
3737
In the directory with your project (where you can do the usual `cargo build`), run:
3838

3939
```bash
40-
$ $cg_clif_dir/build/cargo-clif build
40+
$ $cg_clif_dir/dist/cargo-clif build
4141
```
4242

4343
This will build your project with rustc_codegen_cranelift instead of the usual LLVM backend.

build_system/abi_cafe.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ static ABI_CAFE: CargoProject = CargoProject::git(&ABI_CAFE_REPO, ".");
1414
pub(crate) fn run(
1515
channel: &str,
1616
sysroot_kind: SysrootKind,
17-
target_dir: &Path,
17+
dist_dir: &Path,
1818
cg_clif_dylib: &Path,
1919
host_triple: &str,
2020
target_triple: &str,
@@ -33,7 +33,7 @@ pub(crate) fn run(
3333
build_sysroot::build_sysroot(
3434
channel,
3535
sysroot_kind,
36-
target_dir,
36+
dist_dir,
3737
cg_clif_dylib,
3838
host_triple,
3939
target_triple,

build_system/build_sysroot.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,21 @@ use super::SysrootKind;
99
pub(crate) fn build_sysroot(
1010
channel: &str,
1111
sysroot_kind: SysrootKind,
12-
target_dir: &Path,
12+
dist_dir: &Path,
1313
cg_clif_dylib_src: &Path,
1414
host_triple: &str,
1515
target_triple: &str,
1616
) {
1717
eprintln!("[BUILD] sysroot {:?}", sysroot_kind);
1818

19-
if target_dir.exists() {
20-
fs::remove_dir_all(target_dir).unwrap();
19+
if dist_dir.exists() {
20+
fs::remove_dir_all(dist_dir).unwrap();
2121
}
22-
fs::create_dir_all(target_dir.join("bin")).unwrap();
23-
fs::create_dir_all(target_dir.join("lib")).unwrap();
22+
fs::create_dir_all(dist_dir.join("bin")).unwrap();
23+
fs::create_dir_all(dist_dir.join("lib")).unwrap();
2424

2525
// Copy the backend
26-
let cg_clif_dylib_path = target_dir
26+
let cg_clif_dylib_path = dist_dir
2727
.join(if cfg!(windows) {
2828
// Windows doesn't have rpath support, so the cg_clif dylib needs to be next to the
2929
// binaries.
@@ -42,14 +42,14 @@ pub(crate) fn build_sysroot(
4242
build_cargo_wrapper_cmd
4343
.arg(PathBuf::from("scripts").join(format!("{wrapper}.rs")))
4444
.arg("-o")
45-
.arg(target_dir.join(wrapper_name))
45+
.arg(dist_dir.join(wrapper_name))
4646
.arg("-g");
4747
spawn_and_wait(build_cargo_wrapper_cmd);
4848
}
4949

5050
let default_sysroot = super::rustc_info::get_default_sysroot();
5151

52-
let rustlib = target_dir.join("lib").join("rustlib");
52+
let rustlib = dist_dir.join("lib").join("rustlib");
5353
let host_rustlib_lib = rustlib.join(host_triple).join("lib");
5454
let target_rustlib_lib = rustlib.join(target_triple).join("lib");
5555
fs::create_dir_all(&host_rustlib_lib).unwrap();
@@ -114,7 +114,7 @@ pub(crate) fn build_sysroot(
114114
SysrootKind::Clif => {
115115
build_clif_sysroot_for_triple(
116116
channel,
117-
target_dir,
117+
dist_dir,
118118
host_triple,
119119
&cg_clif_dylib_path,
120120
None,
@@ -129,7 +129,7 @@ pub(crate) fn build_sysroot(
129129
};
130130
build_clif_sysroot_for_triple(
131131
channel,
132-
target_dir,
132+
dist_dir,
133133
target_triple,
134134
&cg_clif_dylib_path,
135135
linker,
@@ -142,7 +142,7 @@ pub(crate) fn build_sysroot(
142142
let file = file.unwrap().path();
143143
let filename = file.file_name().unwrap().to_str().unwrap();
144144
if filename.contains("std-") && !filename.contains(".rlib") {
145-
try_hard_link(&file, target_dir.join("lib").join(file.file_name().unwrap()));
145+
try_hard_link(&file, dist_dir.join("lib").join(file.file_name().unwrap()));
146146
}
147147
}
148148
}
@@ -153,7 +153,7 @@ static STANDARD_LIBRARY: CargoProject = CargoProject::local("build_sysroot");
153153

154154
fn build_clif_sysroot_for_triple(
155155
channel: &str,
156-
target_dir: &Path,
156+
dist_dir: &Path,
157157
triple: &str,
158158
cg_clif_dylib_path: &Path,
159159
linker: Option<&str>,
@@ -189,7 +189,7 @@ fn build_clif_sysroot_for_triple(
189189
// Build sysroot
190190
let mut rustflags = "-Zforce-unstable-if-unmarked -Cpanic=abort".to_string();
191191
rustflags.push_str(&format!(" -Zcodegen-backend={}", cg_clif_dylib_path.to_str().unwrap()));
192-
rustflags.push_str(&format!(" --sysroot={}", target_dir.to_str().unwrap()));
192+
rustflags.push_str(&format!(" --sysroot={}", dist_dir.to_str().unwrap()));
193193
if channel == "release" {
194194
rustflags.push_str(" -Zmir-opt-level=3");
195195
}
@@ -221,7 +221,7 @@ fn build_clif_sysroot_for_triple(
221221
};
222222
try_hard_link(
223223
entry.path(),
224-
target_dir.join("lib").join("rustlib").join(triple).join("lib").join(entry.file_name()),
224+
dist_dir.join("lib").join("rustlib").join(triple).join("lib").join(entry.file_name()),
225225
);
226226
}
227227
}

build_system/mod.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ fn usage() {
1717
eprintln!("Usage:");
1818
eprintln!(" ./y.rs prepare");
1919
eprintln!(
20-
" ./y.rs build [--debug] [--sysroot none|clif|llvm] [--target-dir DIR] [--no-unstable-features]"
20+
" ./y.rs build [--debug] [--sysroot none|clif|llvm] [--dist-dir DIR] [--no-unstable-features]"
2121
);
2222
eprintln!(
23-
" ./y.rs test [--debug] [--sysroot none|clif|llvm] [--target-dir DIR] [--no-unstable-features]"
23+
" ./y.rs test [--debug] [--sysroot none|clif|llvm] [--dist-dir DIR] [--no-unstable-features]"
2424
);
2525
}
2626

@@ -75,15 +75,15 @@ pub fn main() {
7575
}
7676
};
7777

78-
let mut target_dir = PathBuf::from("build");
78+
let mut dist_dir = PathBuf::from("dist");
7979
let mut channel = "release";
8080
let mut sysroot_kind = SysrootKind::Clif;
8181
let mut use_unstable_features = true;
8282
while let Some(arg) = args.next().as_deref() {
8383
match arg {
84-
"--target-dir" => {
85-
target_dir = PathBuf::from(args.next().unwrap_or_else(|| {
86-
arg_error!("--target-dir requires argument");
84+
"--dist-dir" => {
85+
dist_dir = PathBuf::from(args.next().unwrap_or_else(|| {
86+
arg_error!("--dist-dir requires argument");
8787
}))
8888
}
8989
"--debug" => channel = "debug",
@@ -101,7 +101,7 @@ pub fn main() {
101101
arg => arg_error!("Unexpected argument {}", arg),
102102
}
103103
}
104-
target_dir = std::env::current_dir().unwrap().join(target_dir);
104+
dist_dir = std::env::current_dir().unwrap().join(dist_dir);
105105

106106
let host_triple = if let Ok(host_triple) = std::env::var("HOST_TRIPLE") {
107107
host_triple
@@ -128,7 +128,7 @@ pub fn main() {
128128
tests::run_tests(
129129
channel,
130130
sysroot_kind,
131-
&target_dir,
131+
&dist_dir,
132132
&cg_clif_dylib,
133133
&host_triple,
134134
&target_triple,
@@ -137,7 +137,7 @@ pub fn main() {
137137
abi_cafe::run(
138138
channel,
139139
sysroot_kind,
140-
&target_dir,
140+
&dist_dir,
141141
&cg_clif_dylib,
142142
&host_triple,
143143
&target_triple,
@@ -147,7 +147,7 @@ pub fn main() {
147147
build_sysroot::build_sysroot(
148148
channel,
149149
sysroot_kind,
150-
&target_dir,
150+
&dist_dir,
151151
&cg_clif_dylib,
152152
&host_triple,
153153
&target_triple,

build_system/tests.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
274274
eprintln!("[BENCH COMPILE] ebobby/simple-raytracer");
275275
let cargo_clif = env::current_dir()
276276
.unwrap()
277-
.join("build")
277+
.join("dist")
278278
.join(get_wrapper_file_name("cargo-clif", "bin"));
279279
let source_dir = SIMPLE_RAYTRACER.source_dir();
280280
let manifest_path = SIMPLE_RAYTRACER.manifest_path();
@@ -432,7 +432,7 @@ const EXTENDED_SYSROOT_SUITE: &[TestCase] = &[
432432
pub(crate) fn run_tests(
433433
channel: &str,
434434
sysroot_kind: SysrootKind,
435-
target_dir: &Path,
435+
dist_dir: &Path,
436436
cg_clif_dylib: &Path,
437437
host_triple: &str,
438438
target_triple: &str,
@@ -443,7 +443,7 @@ pub(crate) fn run_tests(
443443
build_sysroot::build_sysroot(
444444
channel,
445445
SysrootKind::None,
446-
&target_dir,
446+
&dist_dir,
447447
cg_clif_dylib,
448448
&host_triple,
449449
&target_triple,
@@ -462,7 +462,7 @@ pub(crate) fn run_tests(
462462
build_sysroot::build_sysroot(
463463
channel,
464464
sysroot_kind,
465-
&target_dir,
465+
&dist_dir,
466466
cg_clif_dylib,
467467
&host_triple,
468468
&target_triple,
@@ -503,11 +503,11 @@ impl TestRunner {
503503
target_triple.contains("x86_64") && is_native && !host_triple.contains("windows");
504504

505505
let mut rustc_clif = root_dir.clone();
506-
rustc_clif.push("build");
506+
rustc_clif.push("dist");
507507
rustc_clif.push(get_wrapper_file_name("rustc-clif", "bin"));
508508

509509
let mut rustdoc_clif = root_dir.clone();
510-
rustdoc_clif.push("build");
510+
rustdoc_clif.push("dist");
511511
rustdoc_clif.push(get_wrapper_file_name("rustdoc-clif", "bin"));
512512

513513
let mut rustflags = env::var("RUSTFLAGS").ok().unwrap_or("".to_string());

clean_all.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
set -e
33

44
rm -rf build_sysroot/{sysroot_src/,target/,compiler-builtins/,rustc_version}
5-
rm -rf target/ build/ perf.data{,.old} y.bin
5+
rm -rf target/ dist/ perf.data{,.old} y.bin
66
rm -rf download/
77

88
# Kept for now in case someone updates their checkout of cg_clif before running clean_all.sh
99
# FIXME remove at some point in the future
10-
rm -rf rand/ regex/ simple-raytracer/ portable-simd/ abi-checker/ abi-cafe/
10+
rm -rf rand/ regex/ simple-raytracer/ portable-simd/ abi-checker/ abi-cafe/ build/

docs/usage.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Assuming `$cg_clif_dir` is the directory you cloned this repo into and you follo
99
In the directory with your project (where you can do the usual `cargo build`), run:
1010

1111
```bash
12-
$ $cg_clif_dir/build/cargo-clif build
12+
$ $cg_clif_dir/dist/cargo-clif build
1313
```
1414

1515
This will build your project with rustc_codegen_cranelift instead of the usual LLVM backend.
@@ -19,7 +19,7 @@ This will build your project with rustc_codegen_cranelift instead of the usual L
1919
> You should prefer using the Cargo method.
2020
2121
```bash
22-
$ $cg_clif_dir/build/rustc-clif my_crate.rs
22+
$ $cg_clif_dir/dist/rustc-clif my_crate.rs
2323
```
2424

2525
## Jit mode
@@ -32,20 +32,20 @@ In jit mode cg_clif will immediately execute your code without creating an execu
3232
> The jit mode will probably need cargo integration to make this possible.
3333
3434
```bash
35-
$ $cg_clif_dir/build/cargo-clif jit
35+
$ $cg_clif_dir/dist/cargo-clif jit
3636
```
3737

3838
or
3939

4040
```bash
41-
$ $cg_clif_dir/build/rustc-clif -Zunstable-features -Cllvm-args=mode=jit -Cprefer-dynamic my_crate.rs
41+
$ $cg_clif_dir/dist/rustc-clif -Zunstable-features -Cllvm-args=mode=jit -Cprefer-dynamic my_crate.rs
4242
```
4343

4444
There is also an experimental lazy jit mode. In this mode functions are only compiled once they are
4545
first called.
4646

4747
```bash
48-
$ $cg_clif_dir/build/cargo-clif lazy-jit
48+
$ $cg_clif_dir/dist/cargo-clif lazy-jit
4949
```
5050

5151
## Shell
@@ -54,7 +54,7 @@ These are a few functions that allow you to easily run rust code from the shell
5454

5555
```bash
5656
function jit_naked() {
57-
echo "$@" | $cg_clif_dir/build/rustc-clif - -Zunstable-features -Cllvm-args=mode=jit -Cprefer-dynamic
57+
echo "$@" | $cg_clif_dir/dist/rustc-clif - -Zunstable-features -Cllvm-args=mode=jit -Cprefer-dynamic
5858
}
5959

6060
function jit() {

scripts/filter_profile.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#![forbid(unsafe_code)]/* This line is ignored by bash
33
# This block is ignored by rustc
44
pushd $(dirname "$0")/../
5-
RUSTC="$(pwd)/build/rustc-clif"
5+
RUSTC="$(pwd)/dist/rustc-clif"
66
popd
77
PROFILE=$1 OUTPUT=$2 exec $RUSTC -Zunstable-options -Cllvm-args=mode=jit -Cprefer-dynamic $0
88
#*/

scripts/setup_rust_fork.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ changelog-seen = 2
3636
ninja = false
3737
3838
[build]
39-
rustc = "$(pwd)/../build/rustc-clif"
39+
rustc = "$(pwd)/../dist/rustc-clif"
4040
cargo = "$(rustup which cargo)"
4141
full-bootstrap = true
4242
local-rebuild = true

scripts/test_rustc_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ rm src/test/ui/consts/issue-33537.rs # same
8989
# doesn't work due to the way the rustc test suite is invoked.
9090
# should work when using ./x.py test the way it is intended
9191
# ============================================================
92-
rm -r src/test/run-make/emit-shared-files # requires the rustdoc executable in build/bin/
92+
rm -r src/test/run-make/emit-shared-files # requires the rustdoc executable in dist/bin/
9393
rm -r src/test/run-make/unstable-flag-required # same
9494
rm -r src/test/run-make/rustdoc-* # same
9595
rm -r src/test/run-make/issue-88756-default-output # same

src/intrinsics/llvm_aarch64.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ pub(crate) fn codegen_aarch64_llvm_intrinsic_call<'tcx>(
1616
// llvm.aarch64.neon.sqshl.v*i*
1717

1818
match intrinsic {
19+
"llvm.aarch64.isb" => {
20+
fx.bcx.ins().fence();
21+
}
22+
1923
_ if intrinsic.starts_with("llvm.aarch64.neon.abs.v") => {
2024
intrinsic_args!(fx, args => (a); intrinsic);
2125

0 commit comments

Comments
 (0)