From 4927cc7eb86d2f5b9337dfa30e8ea38a083bf562 Mon Sep 17 00:00:00 2001 From: Tommy Murphy Date: Wed, 9 Oct 2024 13:49:03 +0100 Subject: [PATCH] Enable RV32 build of Linux/musl toolchain - effectively reverse the restrictions imposed by this commit: https://github.com/riscv-collab/riscv-gnu-toolchain/commit/629c67e0a93ec03edd3dfab60a2b8ad9c1768a2a --- .github/workflows/build.yaml | 2 -- .github/workflows/nightly-release.yaml | 2 -- Makefile.in | 6 ------ README.md | 5 ----- configure | 4 ++-- configure.ac | 2 +- 6 files changed, 3 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 2b04c058cb5..9490127a77a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -18,8 +18,6 @@ jobs: target: [rv32gc-ilp32d, rv64gc-lp64d] compiler: [gcc, llvm] exclude: - - mode: musl - target: rv32gc-ilp32d - mode: musl compiler: llvm steps: diff --git a/.github/workflows/nightly-release.yaml b/.github/workflows/nightly-release.yaml index 1b4a3d4e6b1..606c71da20c 100644 --- a/.github/workflows/nightly-release.yaml +++ b/.github/workflows/nightly-release.yaml @@ -53,8 +53,6 @@ jobs: target: [rv32gc-ilp32d, rv64gc-lp64d] compiler: [gcc, llvm] exclude: - - mode: musl - target: rv32gc-ilp32d - mode: musl compiler: llvm steps: diff --git a/Makefile.in b/Makefile.in index 745642d1889..27b01cc1b12 100644 --- a/Makefile.in +++ b/Makefile.in @@ -141,13 +141,7 @@ GCC_CHECKING_FLAGS := $(GCC_CHECKING_FLAGS) --enable-werror-always endif newlib: stamps/build-gcc-newlib-stage2 linux: stamps/build-gcc-linux-stage2 -ifneq (,$(findstring riscv32,$(MUSL_TUPLE))) -.PHONY: musl -musl: - @echo "musl only supports 64bit builds." && exit 1 -else musl: stamps/build-gcc-musl-stage2 -endif uclibc: stamps/build-gcc-uclibc-stage2 ifeq (@enable_gdb@,--enable-gdb) newlib: stamps/build-gdb-newlib diff --git a/README.md b/README.md index d9a8205ad7e..77ff55cc346 100644 --- a/README.md +++ b/README.md @@ -100,11 +100,6 @@ systems. It will support the most common `-march`/`-mabi` options, which can be seen by using the `--print-multi-lib` flag on either cross-compiler. -The musl compiler (riscv64-unknown-linux-musl-) will only be able to target -64-bit systems due to limitations in the upstream musl architecture support. -The `--enable-multilib` flag therefore does not actually enable multilib support -for musl libc. - Linux toolchain has an additional option `--enable-default-pie` to control the default PIE enablement for GCC, which is disable by default. diff --git a/configure b/configure index 24eb3fca799..9e98edf09f5 100755 --- a/configure +++ b/configure @@ -1382,8 +1382,8 @@ Optional Features: information --enable-default-pie build linux toolchain with default PIE [--enable-default-pie] - --enable-multilib build both RV32 and RV64 runtime libraries (only - RV64 for musl libc) [--disable-multilib] + --enable-multilib build both RV32 and RV64 runtime libraries + [--disable-multilib] --enable-gcc-checking Enable gcc internal checking, it will make gcc very slow, only enable it when developing gcc [--disable-gcc-checking] diff --git a/configure.ac b/configure.ac index 8cf7e16cd5b..89f60802146 100644 --- a/configure.ac +++ b/configure.ac @@ -174,7 +174,7 @@ AS_IF([test "x$enable_multilib" != xno], [AC_SUBST(newlib_multilib_names,"$with_arch-$with_abi")]) AS_IF([test "x$enable_multilib" != xno], - [AC_SUBST(musl_multilib_names,"rv64imac-lp64 rv64imafdc-lp64d")], + [AC_SUBST(musl_multilib_names,"rv32imac-ilp32 rv32imafdc-ilp32d rv64imac-lp64 rv64imafdc-lp64d")], [AC_SUBST(musl_multilib_names,"$with_arch-$with_abi")]) AC_ARG_ENABLE(gcc-checking,