Merge pull request #1021 from jordancarlin/gcc14

Update to GCC 14
This commit is contained in:
Rose Thompson 2024-10-18 22:51:03 -05:00 committed by GitHub
commit d37df566b1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 609 additions and 623 deletions

View File

@ -230,9 +230,9 @@ section_header "Installing/Updating RISC-V GNU Toolchain"
STATUS="riscv-gnu-toolchain"
cd "$RISCV"
# Temporarily pin riscv-gnu-toolchain to use GCC 13.2.0. GCC 14 does not work with the Q extension.
if git_check "riscv-gnu-toolchain" "https://github.com/riscv/riscv-gnu-toolchain" "$RISCV/riscv-gnu-toolchain/stamps/build-gcc-newlib-stage2" "b488ddb"; then
if git_check "riscv-gnu-toolchain" "https://github.com/riscv/riscv-gnu-toolchain" "$RISCV/riscv-gnu-toolchain/stamps/build-gcc-newlib-stage2"; then
cd riscv-gnu-toolchain
git reset --hard && git clean -f && git checkout b488ddb #&& git pull
git reset --hard && git clean -f && git checkout master && git pull
./configure --prefix="${RISCV}" --with-multilib-generator="rv32e-ilp32e--;rv32i-ilp32--;rv32im-ilp32--;rv32iac-ilp32--;rv32imac-ilp32--;rv32imafc-ilp32f--;rv32imafdc-ilp32d--;rv64i-lp64--;rv64ic-lp64--;rv64iac-lp64--;rv64imac-lp64--;rv64imafdc-lp64d--;rv64im-lp64--;"
make -j "${NUM_THREADS}" 2>&1 | logger $STATUS; [ "${PIPESTATUS[0]}" == 0 ]
if [ "$clean" ]; then

View File

@ -1,35 +1,43 @@
CEXT := c
CPPEXT := cpp
# Disable builtin rules because they are a shorter (but incorrect) path that Make will use by default
MAKEFLAGS += --no-builtin-rules
SRCDIR := .
SRCEXT := S
AEXT := s
SEXT := S
SRCEXT := \([$(CEXT)$(AEXT)$(SEXT)]\|$(CPPEXT)\)
#SRCS = $(wildcard *.S)
#PROGS = $(patsubst %.S,%,$(SRCS))
SRCDIR = .
SRCEXT = S
OBJEXT := o
EXEEXT := elf
SOURCES ?= $(shell find $(SRCDIR) -type f -regex ".*\.$(SRCEXT)" | sort)
OBJEXT = elf
OBJECTS := $(SOURCES:.$(SEXT)=.$(OBJEXT))
ELFS := $(SOURCES:.$(SRCEXT)=.$(EXEEXT))
OBJDUMPS := $(addsuffix .objdump, $(ELFS))
MEMFILES := $(addsuffix .memfile, $(ELFS))
all: $(OBJECTS)
all: $(OBJDUMPS) $(MEMFILES)
# Create dissassembly
%.elf.objdump: %.elf
riscv64-unknown-elf-objdump -S -D $< > $@
extractFunctionRadix.sh $@
# Change many things if bit width isn't 64
%.elf: $(SRCDIR)/%.$(SEXT) WALLY-init-lib.h Makefile
riscv64-unknown-elf-gcc -g -o $@ -march=rv64gqc_zfa_zba_zbb_zbc_zbs_zfh_zicboz_zicbop_zicbom_zbkb_zbkx_zknd_zkne_zknh -mabi=lp64 -mcmodel=medany \
-nostartfiles -T../../examples/link/link.ld $<
riscv64-unknown-elf-objdump -S -D $@ > $@.objdump
riscv64-unknown-elf-elf2hex --bit-width 64 --input $@ --output $@.memfile
extractFunctionRadix.sh $@.objdump
# Create memfile
%.elf.memfile: %.elf
riscv64-unknown-elf-elf2hex --bit-width 64 --input $< --output $@
sim: %.elf
# Link object file to create executable
.PRECIOUS: %.$(EXEEXT)
%.$(EXEEXT): %.$(OBJEXT)
riscv64-unknown-elf-gcc -g -o $@ -mcmodel=medany -nostartfiles -T../../examples/link/link.ld $*.o
# Assemble into object files
%.$(OBJEXT): %.$(AEXT)
riscv64-unknown-elf-as -g -o $@ -march=rv64gqc_zfa_zba_zbb_zbc_zbs_zfh_zicboz_zicbop_zicbom_zbkb_zbkx_zknd_zkne_zknh -mabi=lp64 $<
# Preprocess assembly files
%.$(AEXT): %.$(SRCEXT) WALLY-init-lib.h
riscv64-unknown-elf-gcc -E -g -o $@ $<
sim: %.$(EXEEXT)
spike +signature=%.signature.output +signature-granularity=8 %.elf
diff --ignore-case %.signature.output %.reference_output || exit
echo "Signature matches! Success!"
clean:
rm -f *.elf *.objdump *.signature.output *.addr *.lab *.memfile
rm -f *.elf *.objdump *.signature.output *.addr *.lab *.memfile *.o *.s

View File

@ -275,4 +275,3 @@ one_0:
bnez t2, loop_0
ret

View File

@ -105,4 +105,3 @@ main:
j done

View File

@ -156,6 +156,3 @@ main:
j done

View File

@ -324,6 +324,3 @@ sretdone:
finished: j done

View File

@ -129,5 +129,3 @@ pagetable:
.8byte 0x200084CF
.8byte 0x200088CF
.8byte 0x20008CCF

View File

@ -179,7 +179,3 @@ pagetable:
.8byte 0x200084EF
.8byte 0x200088EF
.8byte 0x20008CEF

View File

@ -152,8 +152,3 @@ pagetable:
.8byte 0x200000CF
.8byte 0x200000CF
.8byte 0x200000CF

View File

@ -198,4 +198,3 @@ pagetable:
.8byte 0x210074CF
.8byte 0x210078CF
.8byte 0x21007CCF

View File

@ -437,4 +437,3 @@ pagetable:
.8byte 0x00000000200060CF
.8byte 0x000000002000A0CF
.8byte 0x000000002000E0CF

View File

@ -475,4 +475,3 @@ SpecialPage:
.8byte 0x00000000200000CF # valid rwx for VA 80805000 for covering ITLB translate
.8byte 0x20000000200000CF # PBMT=1 for VA 80806000 for covering ITLB BadPBMT
.8byte 0x000000002000000F # valid rwx for VA 80807000 for covering UpdateDA