From 9d1cb1d5631ba745510cc01e15a1314532fb596e Mon Sep 17 00:00:00 2001 From: Zihao Yu Date: Tue, 20 Feb 2024 09:58:55 +0800 Subject: [PATCH] riscv32mini: include the path of origin source * this supports including other files in the original .S source --- scripts/riscv32mini-nemu.mk | 2 -- tools/rvmini/rvmini-common.sh | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/riscv32mini-nemu.mk b/scripts/riscv32mini-nemu.mk index 5d29012..d1beb7d 100644 --- a/scripts/riscv32mini-nemu.mk +++ b/scripts/riscv32mini-nemu.mk @@ -20,5 +20,3 @@ AM_SRCS += riscv/npc/libgcc/div.S \ riscv/npc/libgcc/multi3.c \ riscv/npc/libgcc/ashldi3.c \ riscv/npc/libgcc/unused.c - -INC_PATH += $(AM_HOME)/am/src/riscv/npc/libgcc diff --git a/tools/rvmini/rvmini-common.sh b/tools/rvmini/rvmini-common.sh index 823c3dc..b4ca9eb 100644 --- a/tools/rvmini/rvmini-common.sh +++ b/tools/rvmini/rvmini-common.sh @@ -26,4 +26,5 @@ lut_bin_path=$rvmini_path/lut.bin sed -i "1i#include \"$rvmini_path/inst-replace.h\"" $dst_S flock $rvmini_path/.lock -c "test -e $lut_bin_path || (cd $rvmini_path && gcc gen-lut.c && ./a.out && rm a.out)" -riscv64-linux-gnu-gcc $flags -D_LUT_BIN_PATH=\"$lut_bin_path\" -Wno-trigraphs -c -o $dst $dst_S +src_dir=`dirname $src` +riscv64-linux-gnu-gcc -I$src_dir $flags -D_LUT_BIN_PATH=\"$lut_bin_path\" -Wno-trigraphs -c -o $dst $dst_S