GCC Newspaper
OCTOBER 6, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
risc-v

RISC-V: Simplify multilib generation for default march/mabi

Prevents GCC from generating a separate multilib directory for the default RISC-V architecture and ABI settings unless other options differ.

GCC will no longer create a separate multilib directory for RISC-V configurations that exactly match the default march and mabi, unless other distinguishing options like mcmodel are present. This change addresses an issue where a redundant multilib caused incorrect path configurations, such as breaking Ada builds by causing lp64d to be incorrectly appended to the library path. The optimization streamlines multilib generation by only creating distinct multilibs when necessary.

In Details

This commit modifies riscv_multi_lib_info_t::parse to skip multilib generation when a multilib's march and mabi exactly match the defaults, and no other distinguishing options are set. Previously, even if a multilib was functionally identical to the default, it would still be generated as a distinct subdirectory. This caused issues like incorrect MULTISUBDIR values in broken Ada builds configured with --with-multilib-list=lp64d.

For Context
Multilib
A feature in GCC that allows a single compiler installation to support multiple target configurations (e.g., different architectures, ABIs, or instruction sets) by providing corresponding library and header file sets.
RISC-V march
Specifies the base RISC-V instruction set architecture features to enable, such as 'rv64imafdc'.
RISC-V mabi
Specifies the Application Binary Interface for the RISC-V target, determining conventions for function calls, data types, and structure padding.
lp64d
A specific RISC-V ABI where 'l' indicates 64-bit pointers, 'p' indicates standard calling conventions, '64' indicates 64-bit integers, and 'd' indicates double-precision floating-point support.
Filed Under: risc-vmultilibgcc