Skip to content

Commit 629737e

Browse files
bors[bot]smsxgli
andauthored
Merge #79
79: update to riscv 0.7 r=almindor a=smsxgli hi everyone, I am a new guy with both github, rust and riscv, and this is my first PR, so if I miss something or do something wrong, please let me know (and forgive my poor english, since I am not a native speaker). crate `riscv` v0.7 solved link error about [`different hardware float abi`](#85), but riscv-rt still depend on `riscv` v0.6. Co-authored-by: smsxgli <smsxgli@gmail.com>
2 parents 142f91d + 27b0ed5 commit 629737e

28 files changed

+37
-9
lines changed

riscv-rt/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ license = "ISC"
1010

1111
[dependencies]
1212
r0 = "1.0.0"
13-
riscv = "0.6"
13+
riscv = "0.7"
1414
riscv-rt-macros = { path = "macros", version = "0.1.6" }
1515

1616
[features]

riscv-rt/assemble.ps1

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1+
New-Item -Force -Name bin -Type Directory
2+
13
# remove existing blobs because otherwise this will append object files to the old blobs
24
Remove-Item -Force bin/*.a
35

46
$crate = "riscv-rt"
5-
$extension_sets = @("i", "im", "ic", "imc")
7+
8+
$extension_sets = @("i", "im", "ic", "imc", "if", "ifc", "imf", "imfc", "ifd", "ifdc", "imfd", "imfdc")
9+
610
$pwd = Get-Location
711

8-
foreach ($ext in $extension_sets) {
9-
riscv64-unknown-elf-gcc -ggdb3 -fdebug-prefix-map=$pwd=/riscv-rt -c -mabi=ilp32 -march=rv32$ext asm.S -o bin/$crate.o
12+
foreach ($ext in $extension_sets)
13+
{
14+
$abi = ""
15+
if ($ext.contains("d"))
16+
{$abi = "d"}
17+
elseif ($ext.contains("f"))
18+
{$abi = "f"}
19+
20+
riscv64-unknown-elf-gcc -ggdb3 -fdebug-prefix-map=$pwd=/riscv-rt -c "-mabi=ilp32$abi" "-march=rv32$ext" asm.S -o bin/$crate.o
1021
riscv64-unknown-elf-ar crs bin/riscv32$ext-unknown-none-elf.a bin/$crate.o
1122

12-
riscv64-unknown-elf-gcc -ggdb3 -fdebug-prefix-map=$pwd=/riscv-rt -c -mabi=lp64 -march=rv64$ext asm.S -o bin/$crate.o
23+
riscv64-unknown-elf-gcc -ggdb3 -fdebug-prefix-map=$pwd=/riscv-rt -c "-mabi=lp64$abi" "-march=rv64$ext" asm.S -o bin/$crate.o
1324
riscv64-unknown-elf-ar crs bin/riscv64$ext-unknown-none-elf.a bin/$crate.o
1425
}
1526

riscv-rt/assemble.sh

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,29 @@ crate=riscv-rt
77
# remove existing blobs because otherwise this will append object files to the old blobs
88
rm -f bin/*.a
99

10-
for ext in i ic im imc
10+
exts=('i' 'ic' 'im' 'imc' 'if' 'ifc' 'imf' 'imfc' 'ifd' 'ifdc' 'imfd' 'imfdc')
11+
12+
for ext in ${exts[@]}
1113
do
12-
riscv64-unknown-elf-gcc -ggdb3 -fdebug-prefix-map=$(pwd)=/riscv-rt -c -mabi=ilp32 -march=rv32${ext} asm.S -o bin/$crate.o
14+
case $ext in
15+
16+
*'d'*)
17+
abi='d'
18+
;;
19+
20+
*'f'*)
21+
abi='f'
22+
;;
23+
24+
*)
25+
abi=''
26+
;;
27+
esac
28+
29+
riscv64-unknown-elf-gcc -ggdb3 -fdebug-prefix-map=$(pwd)=/riscv-rt -c -mabi=ilp32${abi} -march=rv32${ext} asm.S -o bin/$crate.o
1330
riscv64-unknown-elf-ar crs bin/riscv32${ext}-unknown-none-elf.a bin/$crate.o
1431

15-
riscv64-unknown-elf-gcc -ggdb3 -fdebug-prefix-map=$(pwd)=/riscv-rt -c -mabi=lp64 -march=rv64${ext} asm.S -o bin/$crate.o
32+
riscv64-unknown-elf-gcc -ggdb3 -fdebug-prefix-map=$(pwd)=/riscv-rt -c -mabi=lp64${abi} -march=rv64${ext} asm.S -o bin/$crate.o
1633
riscv64-unknown-elf-ar crs bin/riscv64${ext}-unknown-none-elf.a bin/$crate.o
1734
done
1835

124 Bytes
Binary file not shown.
124 Bytes
Binary file not shown.
8.01 KB
Binary file not shown.
7.87 KB
Binary file not shown.
8.01 KB
Binary file not shown.
7.88 KB
Binary file not shown.
124 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)