2022-05-15 12:05:23 +00:00
|
|
|
#!/bin/bash -x
|
|
|
|
|
2022-06-04 15:25:58 +00:00
|
|
|
BASE_FB=${1:-0x8F800000}
|
2022-05-15 12:05:23 +00:00
|
|
|
|
|
|
|
GCCDIR=~/LITEX/riscv64-unknown-elf-gcc-10.1.0-2020.08.2-x86_64-linux-ubuntu14
|
|
|
|
GCCPFX=riscv64-unknown-elf-
|
|
|
|
GCCLINK=${GCCDIR}/bin/${GCCPFX}gcc
|
|
|
|
|
|
|
|
#GCCDIR=/opt/rv32bk
|
|
|
|
#GCCPFX=riscv32-buildroot-linux-gnu-
|
|
|
|
|
|
|
|
GCCDIR=~dolbeau2/LITEX/buildroot-rv32/output/host
|
|
|
|
GCCPFX=riscv32-buildroot-linux-gnu-
|
|
|
|
|
|
|
|
GCC=${GCCDIR}/bin/${GCCPFX}gcc
|
|
|
|
OBJCOPY=${GCCDIR}/bin/${GCCPFX}objcopy
|
|
|
|
|
2022-06-24 21:37:18 +00:00
|
|
|
OPT=-O3 #-fno-inline
|
2022-06-04 12:55:40 +00:00
|
|
|
ARCH=rv32im_zba_zbb_zbt
|
2022-05-15 12:05:23 +00:00
|
|
|
|
2022-06-04 15:25:58 +00:00
|
|
|
PARAM="-DBASE_FB=${BASE_FB}"
|
2022-05-15 12:05:23 +00:00
|
|
|
|
|
|
|
if test "x$1" != "xASM"; then
|
2022-07-23 10:58:13 +00:00
|
|
|
$GCC $OPT -S -o blit_goblin.s $PARAM -march=$ARCH -mabi=ilp32 -mstrict-align -fno-builtin-memset -nostdlib -ffreestanding -nostartfiles blit_goblin.c
|
2022-05-15 12:05:23 +00:00
|
|
|
fi
|
2022-07-23 10:58:13 +00:00
|
|
|
$GCC $OPT -c -o blit_goblin.o $PARAM -march=$ARCH -mabi=ilp32 -mstrict-align -fno-builtin-memset -nostdlib -ffreestanding -nostartfiles blit_goblin.s &&
|
|
|
|
$GCCLINK $OPT -o blit_goblin $PARAM -march=$ARCH -mabi=ilp32 -T blit_goblin.lds -nostartfiles blit_goblin.o &&
|
|
|
|
$OBJCOPY -O binary -j .text -j .rodata blit_goblin blit_goblin.raw
|