Re: [PATCH] RISC-V: Don't emit a separate multilib for the default march/mabi

Tsung Chun Lin <[email protected]> Thu, 6 Aug 2026 13:43:05 +0800
Newsgroups gmane.comp.gcc.patches
Message-ID <CAFRyf0P+PM0dX0mvpFrGta8FbxEQrJUQf98WDh5Jpf5AjZ+95w@mail.gmail.com>
Those extra options already affected selection before this patch:
riscv_check_conds() requires each non-march/mabi cond to  appear on
the command
line, rejecting the multilib otherwise. So -mno-vector-strict-align
matters only if a multilib config names it; otherwise it's ignored.
Unchanged either way.

The patch only suppresses an entry that exactly the default: same
march, same mabi, no other cond. Any extra cond keeps the entry,
since it's a genuinely different library.

Jeffrey Law <[email protected]> 於 2026年8月6日週四 上午9:47寫道:
>
>
>
> On 7/30/2026 1:04 AM, Jim Lin wrote:
> > Skip a multilib only when it is exactly equivalent to the default: it
> > shares the default march and mabi and carries no other distinguishing
> > option (such as mcmodel).  A multilib that matches the default march/mabi
> > but differs in another option is kept.
> >
> > This fixes a broken Ada build.  When configured with
> > --with-multilib-list=lp64d, the lp64d multilib is the default but was
> > still emitted as a separate multilib, so MULTISUBDIR became /lib64/lp64d
> > instead of empty.
> >
> > gcc/ChangeLog:
> >
> >       * common/config/riscv/riscv-common.cc
> >       (riscv_multi_lib_info_t::parse): Skip a multilib that is exactly
> >       equivalent to the default march/mabi.
> >
> > Signed-off-by: Jim Lin <[email protected]>
> So it looks sensible, but I do have a question.  Can we get other
> options outside -march, -mabi, and  -mcmodel in that routine.  For
> example, does -mno-vector-strict-align if it were used get in there and
> affect the multilib selection?
>
> jeff