On Thu, 2023-09-07 at 17:31 +0800, Yang Yujie wrote: > > This is bad. It makes BOOT_CFLAGS=-mlasx or CFLAGS_FOR_TARGET=-mlasx > > silently ignored so we cannot test a LSX/LASX or vectorizer change with > > them. > > > > Why do we need to purge all user-specified -m options here? > > Yes, that is an issue that I haven't considered. > > The purge rules (self_specs) exist to clean up the driver-generated > canonical option tuple. These options are generated before to the > injection of library-building options from --with-multilib-{list,default}. > They are dependent on the default GCC settings and may not be safely > overriden by any injected individual options, so we choose to start > over with a purge. > > Working on a patch now, Thanks!
I've made some local experiment too, I think we can add a "-mbuild- multilib" option which does nothing but in the hacked spec we can wrap the line in %{mbuild-multilib:...}: %{mbuild-multilib:%<march=* %<mtune=* %<mcmodel=* %<mfpu=* %<msimd=* %{mabi=lp64d:-march=la464 -mno-strict-align -msimd=lsx} %{mabi=lp64s:-march=abi-default -mfpu=32}} Then we can use -mbuild-multilib -mabi=lp64d for non-default multilibs (or all multilibs unless --disable-multilib?). In the document we can just document mbuild-multilib as "internal use only". -- Xi Ruoyao <xry...@xry111.site> School of Aerospace Science and Technology, Xidian University