Skip to content

Commit 8b24434

Browse files
committed
Avoid infinite recursion when cranelift is the default codegen backend
1 parent 35453ac commit 8b24434

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Diff for: scripts/setup_rust_fork.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ set -e
44
# Compiletest expects all standard library paths to start with /rustc/FAKE_PREFIX.
55
# CG_CLIF_STDLIB_REMAP_PATH_PREFIX will cause cg_clif's build system to pass
66
# --remap-path-prefix to handle this.
7-
CG_CLIF_STDLIB_REMAP_PATH_PREFIX=/rustc/FAKE_PREFIX ./y.sh build
7+
# CG_CLIF_FORCE_GNU_AS will force usage of as instead of the LLVM backend of rustc as we
8+
# the LLVM backend isn't compiled in here.
9+
CG_CLIF_FORCE_GNU_AS=1 CG_CLIF_STDLIB_REMAP_PATH_PREFIX=/rustc/FAKE_PREFIX ./y.sh build
810

911
echo "[SETUP] Rust fork"
1012
git clone https://github.com/rust-lang/rust.git || true

Diff for: src/global_asm.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ pub(crate) fn compile_global_asm(
140140
);
141141

142142
// Assemble `global_asm`
143-
if false {
143+
if option_env!("CG_CLIF_FORCE_GNU_AS").is_some() {
144144
let mut child = Command::new(&config.assembler)
145145
.arg("-o")
146146
.arg(&global_asm_object_file)
@@ -164,6 +164,7 @@ pub(crate) fn compile_global_asm(
164164
.arg(&global_asm_object_file)
165165
.arg("-")
166166
.arg("-Abad_asm_style")
167+
.arg("-Zcodegen-backend=llvm")
167168
.stdin(Stdio::piped())
168169
.spawn()
169170
.expect("Failed to spawn `as`.");

0 commit comments

Comments
 (0)