Skip to content

Commit

Permalink
Merge pull request #557 from sysprog21/modular-softfloat
Browse files Browse the repository at this point in the history
Use upstream SoftFloat and unify build system
  • Loading branch information
jserv authored Feb 12, 2025
2 parents e9675f7 + edfa83e commit bdfa187
Show file tree
Hide file tree
Showing 9 changed files with 363 additions and 17 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ jobs:
if: ${{ always() }}
- name: undefined behavior test
run: |
make clean && make ENABLE_UBSAN=1 check -j$(nproc)
make distclean && make ENABLE_UBSAN=1 check -j$(nproc)
make ENABLE_JIT=1 clean && make ENABLE_JIT=1 ENABLE_UBSAN=1 check -j$(nproc)
if: ${{ always() }}
- name: boot Linux kernel test
Expand Down Expand Up @@ -260,22 +260,23 @@ jobs:
- name: build artifact
# The GitHub Action for non-x86 CPU
uses: allinurl/run-on-arch-action@master
# FIXME: gcc build fails on Aarch64/Linux hosts
env:
CC: clang
with:
arch: aarch64
distro: ubuntu24.04
githubToken: ${{ github.token }}
# No 'sudo' is available
install: |
apt-get update -q=2
apt-get install -q=2 make git clang python3 python3-pip build-essential libsdl2-dev libsdl2-mixer-dev lsb-release wget software-properties-common gnupg bc
apt-get install -q=2 make git clang python3 python3-pip python3-venv libsdl2-dev libsdl2-mixer-dev lsb-release wget software-properties-common gnupg bc
git config --global --add safe.directory ${{ github.workspace }}
git config --global --add safe.directory ${{ github.workspace }}/src/softfloat
git config --global --add safe.directory ${{ github.workspace }}/src/mini-gdbstub
wget https://apt.llvm.org/llvm.sh
chmod +x ./llvm.sh
./llvm.sh 18
# FIXME: gcc build fails on Aarch64/Linux hosts
env: |
CC: clang-18
# Append custom commands here
run: |
make artifact
Expand Down
3 changes: 1 addition & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
shallow = true
[submodule "softfloat"]
path = src/softfloat
url = https://github.com/sysprog21/berkeley-softfloat-3
branch = rv32emu
url = https://github.com/ucb-bar/berkeley-softfloat-3
shallow = true
[submodule "tests/ansibench"]
path = tests/ansibench
Expand Down
13 changes: 6 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,10 @@ AR := ar
ifeq ("$(CC_IS_EMCC)", "1")
AR = emar
endif
SOFTFLOAT_OUT = $(abspath $(OUT)/softfloat)
src/softfloat/build/Linux-RISCV-GCC/Makefile:
git submodule update --init src/softfloat/
SOFTFLOAT_LIB := $(SOFTFLOAT_OUT)/softfloat.a
$(SOFTFLOAT_LIB): src/softfloat/build/Linux-RISCV-GCC/Makefile
$(MAKE) -C $(dir $<) BUILD_DIR=$(SOFTFLOAT_OUT) CC=$(CC) AR=$(AR)

# Berkeley SoftFloat
include mk/softfloat.mk

ifeq ($(call has, SYSTEM), 1)
DEV_OUT := $(OUT)/devices
endif
Expand Down Expand Up @@ -411,12 +409,13 @@ endif

clean:
$(RM) $(BIN) $(OBJS) $(DEV_OBJS) $(BUILD_DTB) $(BUILD_DTB2C) $(HIST_BIN) $(HIST_OBJS) $(deps) $(WEB_FILES) $(CACHE_OUT) src/rv32_jit.c
-$(RM) $(SOFTFLOAT_LIB)
distclean: clean
$(RM) -r $(OUT)/id1
$(RM) -r $(DEMO_DIR)
$(RM) *.zip
$(RM) -r $(OUT)/mini-gdbstub
-$(RM) $(OUT)/.config
-$(RM) -r $(OUT)/softfloat
-$(RM) -r $(SOFTFLOAT_DUMMY_PLAT) $(OUT)/softfloat

-include $(deps)
Loading

0 comments on commit bdfa187

Please sign in to comment.