On Fri, 21 Aug 2026 18:42:07 PDT (-0700), [email protected] wrote:
Hi, Thanks for the detailed explanation. I understand the concern regarding the breaking change and the lack of ISA-based dynamic multilib resolution.
To address this, I have experimented with alternative approaches and laid out 
the multilibs in the sysroot using the following directory structure in my 
local environment:
They're: usr/lib<xlen>/<arch>/<abi>
Could you please share your thoughts on this sysroot layout? Do you think this 
structure could serve as a practical workaround or a step towards better 
multilib organization?

Something like that would be part of the equation, but it doesn't handle the dynamic detection side of things. It'd basically end up in the same spot we're in for the -elf toolchains, where we're just doing build-time multilib detection. That works fine in -elf land, but I think most people who want to do build-time stuff in the Linux toolchains just build a non-multilib toolchain because they're going to end up rebuilding the whole distro anyway (as opposed to in -elf, where people tend to have externally built toolchains and projects with somewhat self-contained build systems).

Evan had a patch for glibc-hwcaps a while ago, the general opinion was that the implementation was fine but we needed to figure out what targets we were going to support. I think none of that has really changed, but if you're intrested in this stuff that's probably the best place to start. I'm pretty confident Evan won't mind someone picking it up ;)

[email protected]
From: Palmer Dabbelt
Date: 2026-08-22 00:23
To: Kito Cheng
CC: panciyan; gcc-patches; Richard.Earnshaw; jeffreyalaw
Subject: Re: [PATCH] RISC-V: Fix glibc multilib configure
On Fri, 21 Aug 2026 00:22:42 PDT (-0700), Kito Cheng wrote:
This seems more like a patch for riscv-gnu-toolchain rather than GCC?
Ya, I agree this is basically just a distro problem: if you're building binaries you need to know what's implemented on the systems you're going to be running them on. That said: we did change the default behavior here so it's going to break some users. We also don't have a great way to fix that, as we're not doing ISA-based dynamic multilib resolution. So if I understand how this all works, we've basically changed the default multilib to include V when it didn't on older releases. We've talked about trying to fix this ISA-dependent multilib resolution stuff a few times. Last round we sort of got hung up on the "what should the supported set of multilibs actually be", and I suspect we'd end up there again (and likely will continue to end up there until someone makes hardware that's actually interesting in these binary-compatible use cases).
panciyan <[email protected]> 於 2026年8月19日週三 下午1:48寫道:

Building glibc with -march=rv64gcv causes GCC to auto-vectorize generic
C code (e.g. calc_state_hash in regex), generating RVV instructions. On
hardware without the V extension, this results in SIGILL.

Signed-off-by: Ciyan Pan <[email protected]>
ChangeLog:

        * configure: Regenerate.
        * configure.ac: Remove rv64gcv-lp64d.

---
 configure    | 5 -----
 configure.ac | 2 +-
 2 files changed, 1 insertion(+), 6 deletions(-)

diff --git a/configure b/configure
index d610aa16..6328fcee 100755
--- a/configure
+++ b/configure
@@ -4159,11 +4159,6 @@ fi
 if test "x$enable_multilib" = xyes
 then :
   glibc_multilib_names="rv32imac-ilp32 rv32gc-ilp32d rv64imac-lp64 
rv64gc-lp64d"
-  # Vector extension is currently not supported on Big-endian systems.
-  if test "x$endian" = xlittle
-  then :
-       glibc_multilib_names+=" rv64gcv-lp64d"
-  fi

 else $as_nop
   glibc_multilib_names="$with_arch-$with_abi"
diff --git a/configure.ac b/configure.ac
index 4e534faa..dd32ec6c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -158,7 +158,7 @@ AS_IF([test "x$enable_multilib" = xyes || test 
"x$with_multilib_generator" != xn
        [AC_SUBST(multilib_flags,--disable-multilib)])

 AS_IF([test "x$enable_multilib" = xyes],
-       [AC_SUBST(glibc_multilib_names,"rv32imac-ilp32 rv32gc-ilp32d rv64imac-lp64 
rv64gc-lp64d rv64gcv-lp64d")],
+       [AC_SUBST(glibc_multilib_names,"rv32imac-ilp32 rv32gc-ilp32d rv64imac-lp64 
rv64gc-lp64d")],
        [AC_SUBST(glibc_multilib_names,"$with_arch-$with_abi")])

 AS_IF([test "x$enable_multilib" = xyes],
--
2.43.0

Reply via email to