Skip to content

Commit

Permalink
Merge 'c31c102 Bump newlib to 4.3.0' into centos7-build
Browse files Browse the repository at this point in the history
  • Loading branch information
tienntr committed Dec 15, 2023
2 parents 2fd1e90 + c31c102 commit ee6a707
Show file tree
Hide file tree
Showing 26 changed files with 201 additions and 146 deletions.
56 changes: 37 additions & 19 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 @@ -52,6 +56,12 @@ jobs:
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 @@ -86,12 +96,16 @@ jobs:
- 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 @@ -114,12 +128,16 @@ jobs:
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 +167,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
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@
[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 Down
15 changes: 9 additions & 6 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ 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,12 @@ 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 echo "$(GLIBC_MULTILIB_NAMES) $(EXTRA_MULTILIB_TEST)" | sed 's!\([_a-z0-9]*\)-\([_a-z0-9]*\)!riscv-sim/-march=\1/-mabi=\2/@cmodel@!g')

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 echo "$(NEWLIB_MULTILIB_NAMES) $(EXTRA_MULTILIB_TEST)" | 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) $(EXTRA_MULTILIB_TEST)" | sed 's!\([_a-z0-9]*\)-\([_a-z0-9]*\)!riscv-sim-nano/-march=\1/-mabi=\2/@cmodel@!g')
NEWLIB_CC_FOR_MULTILIB_INFO := $(NEWLIB_CC_FOR_TARGET)

MUSL_TARGET_FLAGS := $(MUSL_TARGET_FLAGS_EXTRA)
Expand Down Expand Up @@ -530,7 +532,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 +873,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,7 +886,8 @@ 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 $@)
Expand Down
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ the following command can be used:

RUNTESTFLAGS="riscv.exp" make report

To to restrict a test run to only RISC-V specific tests with match the
To restrict a test run to only RISC-V specific tests with match the
pattern "zb*.c" and "sm*.c" the following command can be used:

RUNTESTFLAGS="riscv.exp=zb*.c\ sm*.c" make report
Expand All @@ -246,6 +246,21 @@ The command below can be used to run the glibc tests:

make check-glibc-linux

##### Adding more arch/abi combination for testing without introducing multilib

`--with-extra-multilib-test` can be used when you want to test more combination
of arch/ABI, for example: built a linux toolchain with multilib with
`rv64gc/lp64d` and `rv64imac/lp64`, but you want to test more configuration like
`rv64gcv/lp64d` or `rv64gcv_zba/lp64d`, then you can use --with-extra-multilib-test
to specify that via `--with-extra-multilib-test="rv64gcv-lp64d;rv64gcv_zba-lp64d"`,
then the testing will run for `rv64gc/lp64d`, `rv64imac/lp64`, `rv64gcv/lp64d`
and `rv64gcv_zba/lp64d`.

`--with-extra-multilib-test` support bare-metal and linux toolchain and support
even multilib is disable, but the user must ensure extra multilib test
configuration can be work with existing lib/multilib, e.g. rv32gcv/ilp32 test
can't work if multilib didn't have any rv32 multilib.

### LLVM / clang

LLVM can be used in combination with the RISC-V GNU Compiler Toolchain
Expand Down
2 changes: 1 addition & 1 deletion binutils
Submodule binutils updated from b2bc62 to 675b9d
Loading

0 comments on commit ee6a707

Please sign in to comment.