[PATCH] MIPS: gas: alter 64 or 32 for r6 triples if march is implicit

YunQiang Su syq@debian.org
Mon May 8 09:18:41 GMT 2023


Jiaxun Yang <jiaxun.yang@flygoat.com> 于2023年5月8日周一 02:35写道:
>
>
>
> > 2023年5月7日 19:17,Maciej W. Rozycki <macro@orcam.me.uk> 写道:
> >
> > On Sat, 6 May 2023, Jiaxun Yang wrote:
> >
> >>>> Hmm, why people wants to build n32 binary on mips32r6 CPU?
> >>>
> >>> I guess o32 toolchain should not work only for 32bit CPU?
> >>
> >> In this case people should override -march option themself, not rely on random
> >> toolchain hacks, since it’s not determinant from user’s perspective what “fallback”
> >> march it will be, especially in case the toolchain is not designed for base ISA.
> >
> > Seconded.  If anyhow, I'd suggest changing the arrangement the GCC way,
> > that is by adding `--with-arch-32=' and `--with-arch-64=' configuration
> > options.  I'm not terribly convinced however that would be a worthwhile
> > improvement, because GAS shouldn't normally be invoked directly, and when
> > called via the GCC driver the driver will do the right thing.
> >
> > YunQiang, do you actually have a use case for invoking GAS directly?  I
> > only do it when debugging GAS, which is sort of irrelevant.  For normal
> > compilations I never do it.
>
> The issue was raised by Glib[1], they are involving `ld` directly.
>
> I recall v8 was generating embedded data as assembly directives and then invoking as to
> generate object file. They claimed it’s faster than GCC.
>
> I think it make sense to get this “workaround” done in GAS/LD, but not in this way.
>  `--with-arch-32=' and `--with-arch-64=` method fits the purpose better.
>

My worry about the --with-arch-32/64 is that: somebody may create a
toolchain like this:

../configure --target=mipsisa64r6el-linux-gnu --with-arch-32=mips32
--with-arch-64=mips64r2

> Thanks
> Jiaxun
>
> [1]: https://gitlab.gnome.org/GNOME/glib/-/issues/2768
> >
> >  Maciej
>


More information about the Binutils mailing list