Skip to content

Commit

Permalink
Merge branch 'master' into centos7-build
Browse files Browse the repository at this point in the history
  • Loading branch information
tienntr committed Dec 13, 2023
2 parents a157364 + ae9efcc commit c9feff8
Show file tree
Hide file tree
Showing 500 changed files with 37,970 additions and 9,886 deletions.
2 changes: 1 addition & 1 deletion .github/setup-apt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ apt update
apt install -y autoconf automake autotools-dev curl python3 python3-pip libmpc-dev libmpfr-dev \
libgmp-dev gawk build-essential bison flex texinfo gperf libtool \
patchutils bc zlib1g-dev libexpat-dev git ninja-build cmake libglib2.0-dev expect \
device-tree-compiler
device-tree-compiler python3-pyelftools
67 changes: 41 additions & 26 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ jobs:
- mode: musl
compiler: llvm
steps:
- uses: actions/checkout@v2

- name: initialize submodules
- name: Remove unneeded frameworks to recover disk space
run: |
git submodule init
git submodule update --recursive --progress --recommend-shallow
echo "-- Before --"
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
echo "-- After --"
df -h
- uses: actions/checkout@v4

- name: install dependencies
run: sudo ./.github/setup-apt.sh
Expand All @@ -46,12 +50,18 @@ jobs:
- name: make report
if: |
matrix.os == 'ubuntu-20.04'
matrix.os == 'ubuntu-22.04'
&& (matrix.mode == 'linux' || matrix.mode == 'newlib')
&& matrix.compiler == 'gcc'
run: |
sudo make report-${{ matrix.mode }} -j $(nproc)
- name: recover space
run: |
sudo du -hs / 2> /dev/null || true
sudo rm -rf binutils dejagnu gcc gdb glibc llvm musl newlib pk qemu spike || true
sudo du -hs / 2> /dev/null || true
- name: tarball build
run: tar czvf riscv.tar.gz -C /opt/ riscv/

Expand All @@ -67,9 +77,9 @@ jobs:
*)
MODE="elf";;
esac
echo ::set-output name=TOOLCHAIN_NAME::riscv$BITS-$MODE-${{ matrix.os }}-${{ matrix.compiler }}-nightly
echo "TOOLCHAIN_NAME=riscv$BITS-$MODE-${{ matrix.os }}-${{ matrix.compiler }}-nightly" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}
path: riscv.tar.gz
Expand All @@ -78,20 +88,21 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
mode: [newlib, linux]
os: [ubuntu-22.04]
mode: [newlib]
target: [rv64gc-lp64d]
sim: [spike]
exclude:
- sim: spike
mode: linux
steps:
- uses: actions/checkout@v2

- name: initialize submodules
- name: Remove unneeded frameworks to recover disk space
run: |
git submodule init
git submodule update --recursive --progress --recommend-shallow
echo "-- Before --"
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
echo "-- After --"
df -h
- uses: actions/checkout@v4

- name: install dependencies
run: sudo ./.github/setup-apt.sh
Expand All @@ -110,16 +121,20 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
os: [ubuntu-22.04]
mode: [newlib, linux]
target: [rv64gc-lp64d]
steps:
- uses: actions/checkout@v2

- name: initialize submodules
- name: Remove unneeded frameworks to recover disk space
run: |
git submodule init
git submodule update --recursive --progress --recommend-shallow
echo "-- Before --"
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
echo "-- After --"
df -h
- uses: actions/checkout@v4

- name: install dependencies
run: sudo ./.github/setup-apt.sh
Expand Down Expand Up @@ -149,9 +164,9 @@ jobs:
*)
MODE="elf";;
esac
echo ::set-output name=TOOLCHAIN_NAME::riscv$BITS-$MODE-${{ matrix.os }}-multilib-nightly
echo "TOOLCHAIN_NAME=riscv$BITS-$MODE-${{ matrix.os }}-multilib-nightly" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}
path: riscv.tar.gz
32 changes: 21 additions & 11 deletions .github/workflows/nightly-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ jobs:
STALE=true
fi
fi
echo "::set-output name=stale::$STALE"
echo "stale=$STALE" >> $GITHUB_OUTPUT
if [ "$STALE" == "true" ]; then
exit 1
fi
Expand All @@ -58,12 +58,16 @@ jobs:
- mode: musl
compiler: llvm
steps:
- uses: actions/checkout@v2

- name: initialize submodules
- name: Remove unneeded frameworks to recover disk space
run: |
git submodule init
git submodule update --recursive --progress --recommend-shallow
echo "-- Before --"
df -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
echo "-- After --"
df -h
- uses: actions/checkout@v4

- name: install apt dependencies
run: sudo ./.github/setup-apt.sh
Expand All @@ -84,6 +88,12 @@ jobs:
run: |
sudo make -j$(nproc) build-sim SIM=qemu
- name: recover space
run: |
sudo du -hs / 2> /dev/null || true
sudo rm -rf binutils dejagnu gcc gdb glibc llvm musl newlib pk qemu spike || true
sudo du -hs / 2> /dev/null || true
- name: tarball build
run: tar czvf riscv.tar.gz -C /opt/ riscv/

Expand All @@ -99,9 +109,9 @@ jobs:
*)
MODE="elf";;
esac
echo ::set-output name=TOOLCHAIN_NAME::riscv$BITS-$MODE-${{ matrix.os }}-${{ matrix.compiler }}-nightly
echo "TOOLCHAIN_NAME=riscv$BITS-$MODE-${{ matrix.os }}-${{ matrix.compiler }}-nightly" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: ${{ steps.toolchain-name-generator.outputs.TOOLCHAIN_NAME }}
path: riscv.tar.gz
Expand Down Expand Up @@ -171,11 +181,11 @@ jobs:
file: .[1],
extension: .[2]
}
]
]
}'
)
echo "::set-output name=asset_matrix::${ASSET_MATRIX}"
echo "asset_matrix=${ASSET_MATRIX}" >> $GITHUB_OUTPUT
shell: bash


Expand Down
10 changes: 5 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
[submodule "binutils"]
path = binutils
url = https://sourceware.org/git/binutils-gdb.git
branch = binutils-2_40-branch
branch = binutils-2_41-release-point
[submodule "gcc"]
path = gcc
url = https://gcc.gnu.org/git/gcc.git
branch = releases/gcc-12
branch = releases/gcc-13
[submodule "glibc"]
path = glibc
url = https://sourceware.org/git/glibc.git
[submodule "dejagnu"]
path = dejagnu
url = https://git.savannah.gnu.org/git/dejagnu.git
branch = dejagnu-1.6.3
branch = master
[submodule "newlib"]
path = newlib
url = https://sourceware.org/git/newlib-cygwin.git
branch = master
[submodule "gdb"]
path = gdb
url = https://sourceware.org/git/binutils-gdb.git
branch = gdb-12-branch
branch = gdb-13-branch
[submodule "qemu"]
path = qemu
url = https://gitlab.com/qemu-project/qemu.git
Expand All @@ -39,4 +39,4 @@
[submodule "llvm"]
path = llvm
url = https://github.com/llvm/llvm-project.git
branch = release/15.x
branch = release/17.x
41 changes: 27 additions & 14 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ ifeq ($(MULTILIB_GEN),)
NEWLIB_MULTILIB_NAMES := @newlib_multilib_names@
GCC_MULTILIB_FLAGS := $(MULTILIB_FLAGS)
else
NEWLIB_MULTILIB_NAMES := $(shell echo "$(MULTILIB_GEN)" | $(SED) 's/;/\n/g'| $(AWK) '{split($$0,a,"-"); printf "%s-%s ", a[1],a[2]}')
NEWLIB_MULTILIB_NAMES := $(shell echo "$(MULTILIB_GEN)" | $(SED) 's/;/\n/g' | $(SED) '/^$$/d' | $(AWK) '{split($$0,a,"-"); printf "%s-%s ", a[1],a[2]}')
GCC_MULTILIB_FLAGS := $(MULTILIB_FLAGS) --with-multilib-generator="$(MULTILIB_GEN)"
endif
GLIBC_MULTILIB_NAMES := @glibc_multilib_names@
GCC_CHECKING_FLAGS := @gcc_checking@

EXTRA_MULTILIB_TEST := @extra_multilib_test@

XLEN := $(shell echo $(WITH_ARCH) | tr A-Z a-z | sed 's/.*rv\([0-9]*\).*/\1/')
ifneq ($(XLEN),32)
XLEN := 64
Expand All @@ -91,12 +93,25 @@ GDB_NATIVE_FLAGS := $(GDB_NATIVE_FLAGS_EXTRA)
GLIBC_TARGET_FLAGS := $(GLIBC_TARGET_FLAGS_EXTRA)
GLIBC_CC_FOR_TARGET ?= $(LINUX_TUPLE)-gcc
GLIBC_CXX_FOR_TARGET ?= $(LINUX_TUPLE)-g++
GLIBC_TARGET_BOARDS ?= $(shell echo "$(GLIBC_MULTILIB_NAMES)" | sed 's!\([_a-z0-9]*\)-\([_a-z0-9]*\)!riscv-sim/-march=\1/-mabi=\2/@cmodel@!g')
GLIBC_TARGET_BOARDS ?= $(shell $(srcdir)/scripts/generate_target_board \
--sim-name riscv-sim \
--cmodel $(shell echo @cmodel@ | cut -d '=' -f2) \
--build-arch-abi $(GLIBC_MULTILIB_NAMES) \
--extra-test-arch-abi-flags-list "$(EXTRA_MULTILIB_TEST)")

NEWLIB_CC_FOR_TARGET ?= $(NEWLIB_TUPLE)-gcc
NEWLIB_CXX_FOR_TARGET ?= $(NEWLIB_TUPLE)-g++
NEWLIB_TARGET_BOARDS ?= $(shell echo "$(NEWLIB_MULTILIB_NAMES)" | sed 's!\([_a-z0-9]*\)-\([_a-z0-9]*\)!riscv-sim/-march=\1/-mabi=\2/@cmodel@!g')
NEWLIB_NANO_TARGET_BOARDS ?= $(shell echo "$(NEWLIB_MULTILIB_NAMES)" | sed 's!\([_a-z0-9]*\)-\([_a-z0-9]*\)!riscv-sim-nano/-march=\1/-mabi=\2/@cmodel@!g')
NEWLIB_TARGET_BOARDS ?= $(shell $(srcdir)/scripts/generate_target_board \
--sim-name riscv-sim \
--cmodel $(shell echo @cmodel@ | cut -d '=' -f2) \
--build-arch-abi $(NEWLIB_MULTILIB_NAMES) \
--extra-test-arch-abi-flags-list "$(EXTRA_MULTILIB_TEST)")

NEWLIB_NANO_TARGET_BOARDS ?= $(shell $(srcdir)/scripts/generate_target_board \
--sim-name riscv-sim-nano \
--cmodel $(shell echo @cmodel@ | cut -d '=' -f2) \
--build-arch-abi $(NEWLIB_MULTILIB_NAMES) \
--extra-test-arch-abi-flags-list "$(EXTRA_MULTILIB_TEST)")
NEWLIB_CC_FOR_MULTILIB_INFO := $(NEWLIB_CC_FOR_TARGET)

MUSL_TARGET_FLAGS := $(MUSL_TARGET_FLAGS_EXTRA)
Expand Down Expand Up @@ -189,11 +204,11 @@ report-gdb: report-gdb-@default_target@
ifeq ($(SIM),qemu)
SIM_PATH:=$(srcdir)/scripts/wrapper/qemu:$(srcdir)/scripts
SIM_PREPARE:=PATH="$(SIM_PATH):$(INSTALL_DIR)/bin:$(PATH)" RISC_V_SYSROOT="$(SYSROOT)"
SIM_STAMP:= stamps/build-qemu stamps/install-python-package
SIM_STAMP:= stamps/build-qemu
else
ifeq ($(SIM),spike)
# Using spike simulator.
SIM_PATH:=$(srcdir)/scripts/wrapper/spike
SIM_PATH:=$(srcdir)/scripts/wrapper/spike:$(srcdir)/scripts
SIM_PREPARE:=PATH="$(SIM_PATH):$(INSTALL_DIR)/bin:$(PATH)" PK_PATH="$(INSTALL_DIR)/$(NEWLIB_TUPLE)/bin/" ARCH_STR="$(WITH_ARCH)"
SIM_STAMP:= stamps/build-spike
ifneq (,$(findstring rv32,$(NEWLIB_MULTILIB_NAMES)))
Expand Down Expand Up @@ -530,7 +545,7 @@ stamps/build-gcc-linux-native: $(GCC_SRCDIR) $(GCC_SRC_GIT) stamps/build-gcc-lin
$(WITH_ARCH) \
$(WITH_TUNE) \
$(WITH_ISA_SPEC) \
$(GCC_EXTRA_CONFIGURE_FLAGS) \
$(GCC_EXTRA_CONFIGURE_FLAGS)
$(MAKE) -C $(notdir $@)
$(MAKE) -C $(notdir $@) install
cp -a $(INSTALL_DIR)/$(LINUX_TUPLE)/lib* $(SYSROOT)
Expand Down Expand Up @@ -871,7 +886,7 @@ stamps/build-pk32: $(PK_SRCDIR) $(PK_SRC_GIT) stamps/build-gcc-newlib-stage2
cd $(notdir $@) && $</configure \
--prefix=$(INSTALL_DIR) \
--host=$(NEWLIB_TUPLE) \
--with-arch=rv32imafdc \
--with-arch=rv32gc \
--with-abi=ilp32f
$(MAKE) -C $(notdir $@)
cp $(notdir $@)/pk $(INSTALL_DIR)/$(NEWLIB_TUPLE)/bin/pk32
Expand All @@ -884,16 +899,13 @@ stamps/build-pk64: $(PK_SRCDIR) $(PK_SRC_GIT) stamps/build-gcc-newlib-stage2
cd $(notdir $@) && $</configure \
--prefix=$(INSTALL_DIR) \
--host=$(NEWLIB_TUPLE) \
--with-arch=rv64gc
--with-arch=rv64gc \
--with-abi=lp64d
$(MAKE) -C $(notdir $@)
cp $(notdir $@)/pk $(INSTALL_DIR)/$(NEWLIB_TUPLE)/bin/pk64
mkdir -p $(dir $@)
date > $@

stamps/install-python-package:
python3 -m pip install --user pyelftools
date > $@

stamps/build-qemu: $(QEMU_SRCDIR) $(QEMU_SRC_GIT)
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
Expand Down Expand Up @@ -984,7 +996,8 @@ stamps/check-gcc-linux: stamps/build-gcc-linux-stage2 $(SIM_STAMP) stamps/build-
mkdir -p $(dir $@)
date > $@

stamps/check-glibc-linux-%: $(addprefix stamps/build-glibc-linux-,$(GLIBC_MULTILIB_NAMES))
stamps/check-glibc-linux-%: stamps/build-gcc-linux-stage2 $(SIM_STAMP) stamps/build-dejagnu \
$(addprefix stamps/build-glibc-linux-,$(GLIBC_MULTILIB_NAMES))
$(eval $@_BUILD_DIR := $(notdir $@))
$(eval $@_BUILD_DIR := $(subst check-,build-,$($@_BUILD_DIR)))
$(SIM_PREPARE) $(MAKE) -C $($@_BUILD_DIR) check
Expand Down
Loading

0 comments on commit c9feff8

Please sign in to comment.