Skip to content

Commit 1c20462

Browse files
committed
Auto merge of #119470 - bjorn3:sync_cg_clif-2023-12-31, r=bjorn3
Subtree sync for rustc_codegen_cranelift The main highlight this time is a fix for rust-lang/rustc_codegen_cranelift#1437. r? `@ghost` `@rustbot` label +A-codegen +A-cranelift +T-compiler
2 parents fcfe05a + d1d134e commit 1c20462

File tree

6 files changed

+22
-20
lines changed

6 files changed

+22
-20
lines changed

compiler/rustc_codegen_cranelift/.github/workflows/main.yml

+6-10
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,10 @@ jobs:
175175
path: build/cg_clif
176176
key: ${{ runner.os }}-x86_64-unknown-linux-gnu-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
177177

178-
- name: Cache cargo bin dir
179-
uses: actions/cache@v3
180-
with:
181-
path: ~/.cargo/bin
182-
key: ${{ runner.os }}-${{ matrix.env.TARGET_TRIPLE }}-cargo-bin-dir-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
183-
184178
- name: Install hyperfine
185-
run: cargo install hyperfine || true
179+
run: |
180+
sudo apt update
181+
sudo apt install -y hyperfine
186182
187183
- name: Prepare dependencies
188184
run: ./y.sh prepare
@@ -257,14 +253,14 @@ jobs:
257253

258254
- name: Upload prebuilt cg_clif
259255
if: matrix.os == 'windows-latest' || matrix.env.TARGET_TRIPLE != 'x86_64-pc-windows-gnu'
260-
uses: actions/upload-artifact@v3
256+
uses: actions/upload-artifact@v4
261257
with:
262258
name: cg_clif-${{ matrix.env.TARGET_TRIPLE }}
263259
path: cg_clif.tar.xz
264260

265261
- name: Upload prebuilt cg_clif (cross compile)
266262
if: matrix.os != 'windows-latest' && matrix.env.TARGET_TRIPLE == 'x86_64-pc-windows-gnu'
267-
uses: actions/upload-artifact@v3
263+
uses: actions/upload-artifact@v4
268264
with:
269265
name: cg_clif-${{ runner.os }}-cross-x86_64-mingw
270266
path: cg_clif.tar.xz
@@ -283,7 +279,7 @@ jobs:
283279
- uses: actions/checkout@v3
284280

285281
- name: Download all built artifacts
286-
uses: actions/download-artifact@v3
282+
uses: actions/download-artifact@v4
287283
with:
288284
path: artifacts/
289285

compiler/rustc_codegen_cranelift/.github/workflows/rustc.yml

+5
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ jobs:
4343
path: build/cg_clif
4444
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('rust-toolchain', '**/Cargo.lock') }}
4545

46+
- name: Install ripgrep
47+
run: |
48+
sudo apt update
49+
sudo apt install -y ripgrep
50+
4651
- name: Prepare dependencies
4752
run: ./y.sh prepare
4853

Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2023-12-24"
2+
channel = "nightly-2023-12-31"
33
components = ["rust-src", "rustc-dev", "llvm-tools"]

compiler/rustc_codegen_cranelift/scripts/setup_rust_fork.sh

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
set -e
33

4-
# CG_CLIF_FORCE_GNU_AS will force usage of as instead of the LLVM backend of rustc as we
4+
# CG_CLIF_FORCE_GNU_AS will force usage of as instead of the LLVM backend of rustc as
55
# the LLVM backend isn't compiled in here.
66
export CG_CLIF_FORCE_GNU_AS=1
77

@@ -11,20 +11,19 @@ export CG_CLIF_FORCE_GNU_AS=1
1111
CG_CLIF_STDLIB_REMAP_PATH_PREFIX=/rustc/FAKE_PREFIX ./y.sh build
1212

1313
echo "[SETUP] Rust fork"
14-
git clone https://github.com/rust-lang/rust.git --filter=tree:0 || true
14+
git clone --quiet https://github.com/rust-lang/rust.git --filter=tree:0 || true
1515
pushd rust
1616
git fetch
17-
git checkout -- .
18-
git checkout "$(rustc -V | cut -d' ' -f3 | tr -d '(')"
17+
git checkout --no-progress -- .
18+
git checkout --no-progress "$(rustc -V | cut -d' ' -f3 | tr -d '(')"
19+
20+
git submodule update --quiet --init src/tools/cargo library/backtrace library/stdarch
1921

2022
git -c user.name=Dummy -c user.email=dummy@example.com -c commit.gpgSign=false \
2123
am ../patches/*-stdlib-*.patch
2224

2325
cat > config.toml <<EOF
24-
change-id = 115898
25-
26-
[llvm]
27-
ninja = false
26+
change-id = 999999
2827
2928
[build]
3029
rustc = "$(pwd)/../dist/bin/rustc-clif"

compiler/rustc_codegen_cranelift/src/driver/jit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ fn dep_symbol_lookup_fn(
321321
Linkage::NotLinked | Linkage::IncludedFromDylib => {}
322322
Linkage::Static => {
323323
let name = crate_info.crate_name[&cnum];
324-
let mut err = sess.struct_err(format!("Can't load static lib {}", name));
324+
let mut err = sess.dcx().struct_err(format!("Can't load static lib {}", name));
325325
err.note("rustc_codegen_cranelift can only load dylibs in JIT mode.");
326326
err.emit();
327327
}

compiler/rustc_codegen_cranelift/src/global_asm.rs

+2
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ pub(crate) fn compile_global_asm(
154154
}
155155
} else {
156156
let mut child = Command::new(std::env::current_exe().unwrap())
157+
// Avoid a warning about the jobserver fd not being passed
158+
.env_remove("CARGO_MAKEFLAGS")
157159
.arg("--target")
158160
.arg(&config.target)
159161
.arg("--crate-type")

0 commit comments

Comments
 (0)