Skip to content

Commit 8247677

Browse files
committed
Properly bootstrap new target
1 parent 24e515d commit 8247677

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

build.sh

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,38 @@ source config.sh
88
need_cmd clang
99
need_cmd clang++
1010

11-
# Rust requires a custom target file to exist for our custom target as part of the bootstrap build,
12-
# but it doesn't actually look at the contents.
13-
touch /tmp/riscv32em-athena-zkvm-elf.json
11+
# We need to bootstrap the new target for Rust
12+
cat > /tmp/riscv32em-athena-zkvm-elf.json << EOF
13+
{
14+
"arch": "riscv32",
15+
"cpu": "generic-rv32",
16+
"crt-objects-fallback": "false",
17+
"data-layout": "e-m:e-p:32:32-i64:64-n32-S32",
18+
"eh-frame-header": false,
19+
"emit-debug-gdb-scripts": false,
20+
"features": "+e,+m",
21+
"linker": "rust-lld",
22+
"linker-flavor": "gnu-lld",
23+
"llvm-abiname": "ilp32e",
24+
"llvm-target": "riscv32",
25+
"max-atomic-width": 32,
26+
"os": "zkvm",
27+
"panic-strategy": "abort",
28+
"relocation-model": "static",
29+
"singlethread": true,
30+
"target-pointer-width": "32",
31+
"vendor": "athena",
32+
"options": {
33+
"c-flags": "-march=rv32e -mabi=ilp32e",
34+
"pre-link-args": {
35+
"gcc": [
36+
"-march=rv32e",
37+
"-mabi=ilp32e"
38+
]
39+
}
40+
}
41+
}
42+
EOF
1443
export RUST_TARGET_PATH="/tmp"
1544

1645
# Explicitly set CFLAGS without the problematic flags

0 commit comments

Comments
 (0)