Write a primary version for that, did you mind giving it a try? The basic idea is to select multilib only by ABI, so that we don't need to bother with endless multilib reuse cases... On Wed, Apr 19, 2023 at 9:38 AM Kito Cheng wrote: > > OK, thanks, I know what the problem is, I tried rv64 but didn't try > rv32, I have another fix in my mind, and will post another fix soon. > > On Wed, Apr 19, 2023 at 9:29 AM Palmer Dabbelt wrote: > > > > On Tue, 18 Apr 2023 18:26:18 PDT (-0700), Kito Cheng wrote: > > > And which -march -mabi you used will got issue? > > > > > > On Wed, Apr 19, 2023 at 8:51 AM Palmer Dabbelt wrote: > > >> > > >> On Tue, 18 Apr 2023 17:47:31 PDT (-0700), Kito Cheng wrote: > > >> > Do you mind shared gcc configure and the option you tried? > > >> > > >> Just riscv-gnu-toolchain with "--enbale-multilib --enable-linux". > > >> > > >> > On Wed, Apr 19, 2023 at 4:01 AM Palmer Dabbelt wrote: > > >> >> > > >> >> On Tue, 18 Apr 2023 08:44:24 PDT (-0700), gcc-patches@gcc.gnu.org wrote: > > >> >> >> Yep, if I drop the non-canonicial strings via > > >> >> >> > > >> >> >> diff --git a/gcc/config/riscv/multilib-generator b/gcc/config/riscv/multilib-generator > > >> >> >> index 58b7198b243..a63a4d69c18 100755 > > >> >> >> --- a/gcc/config/riscv/multilib-generator > > >> >> >> +++ b/gcc/config/riscv/multilib-generator > > >> >> >> @@ -174,7 +174,7 @@ for cmodel in cmodels: > > >> >> >> ext_combs = expand_combination(ext) > > >> >> >> alts = sum([[x] + [x + y for y in ext_combs] for x in [arch] + extra], []) > > >> >> >> alts = filter(lambda x: len(x) != 0, alts) > > >> >> >> - alts = alts + list(map(lambda a : arch_canonicalize(a, args.misa_spec), alts)) > > >> >> >> + alts = list(map(lambda a : arch_canonicalize(a, args.misa_spec), alts)) > > >> >> >> > > >> >> >> # Drop duplicated entry. > > >> >> >> alts = unique(alts) > > >> >> >> > > >> >> >> then I can't link `-march=rv32imafdcv`, I need > > >> >> >> `-march=rv32imacv_zicsr_zve32f_zve32x_zve64x_zvl128b_zvl32b_zvl64b`. That's > > >> >> >> kind of a headache for users to type in. > > >> >> > > > >> >> > Yes, that's a headache for users, but arch string canonicalization is > > >> >> > hiddened at the process, > > >> >> > so the user could still just use rv32imafdcv at compile time and > > >> >> > multi-lib config. > > >> >> > > > >> >> > And the driver and multilib-generator (with arch_canonicalize) script > > >> >> > will handle those headache in the background. > > >> >> > > >> >> Sorry, I'm not exactly sure what you're trying to say. I just rebuilt > > >> >> GCC with this patch (and t-linux-multilib regenerated from it), it's not > > >> >> resolving multlibs for the short names. > > > > `-march=rv32imafdcv` is the broken one, > > `-march=rv32imacv_zicsr_zve32f_zve32x_zve64x_zvl128b_zvl32b_zvl64b` > > resolves multilibs (there's a bit more above).