Skip to content

Commit

Permalink
Add MacOS tool in assemble.sh (nexus-xyz#248)
Browse files Browse the repository at this point in the history
Most of us use Mac.
I suggest change the command to native mactool.

Update:

This script will now detect if MacOS or not and use the tool accordingly.

Summary:

Test Plan:

Co-authored-by: duc-nx <>
  • Loading branch information
duc-nx authored Jul 25, 2024
1 parent 680092c commit 4891111
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions runtime/assemble.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
#!/bin/sh

set -e

rm -f bin/*.a
# Detect the operating system
if [ "$(uname)" = "Darwin" ]; then
# macOS
GCC_PREFIX="riscv64-elf-"
else
# Assume Linux
GCC_PREFIX="riscv-none-elf-"
fi

rm -f bin/***.a
for ext in i imc
do
riscv-none-elf-gcc -c -mabi=ilp32 -march=rv32${ext} -mcmodel=medlow asm.S -o bin/nexus-rt.o
riscv-none-elf-ar crs bin/riscv32${ext}-unknown-none-elf.a bin/nexus-rt.o
${GCC_PREFIX}gcc -c -mabi=ilp32 -march=rv32${ext} -mcmodel=medlow asm.S -o bin/nexus-rt.o
${GCC_PREFIX}ar crs bin/riscv32${ext}-unknown-none-elf.a bin/nexus-rt.o
done

rm bin/nexus-rt.o

0 comments on commit 4891111

Please sign in to comment.