> I came up with another idea. What if we:
> 
> 1. Keep the "default" ABI libs in the toplevel directory. There is
> *always* a default ABI so treating it specially is not really nonsense.
> 2. Create a symlink for consistency. For example, if --with-abi=lp64d, -
> -with-multilib-list=lp64d,lp64s:
> 
>  * /usr/lib/gcc/loongarch64-linux-gnu/14.0.0 contains the lp64d
>    libraries.
>  * /usr/lib/gcc/loongarch64-linux-gnu/14.0.0/lp64s contains the lp64s
>    libraries.
>  * /usr/lib/gcc/loongarch64-linux-gnu/14.0.0/lp64d is a symlink to "."
> 
> Then we can refer to the lp64d libgcc.a with both
> /usr/lib/gcc/loongarch64-linux-gnu/14.0.0/lp64d/libgcc.a, and
> /usr/lib/gcc/loongarch64-linux-gnu/14.0.0/libgcc.a.
> 
> For referring to the default multilib, the non-suffixed
> /usr/lib/gcc/loongarch64-linux-gnu/14.0.0 path should be used; for
> referring lp64d (no matter what the default is),
> /usr/lib/gcc/loongarch64-linux-gnu/14.0.0/lp64d should be used.
> 
> The symlink can be created by the GCC building system or manually by the
> distro maintainer (or gcc packager).
> 
> Thoughts?
> 
> -- 
> Xi Ruoyao <xry...@xry111.site> School of Aerospace Science and
> Technology, Xidian University

Yes, this also eliminates the duplicate build.

In this case, the symlink would not really be necessary since the
toplevel directory is searched by the driver for all ABI configurations
anyways.

It is even easier to implement:

1. (gcc/config.gcc) stipulate that
   loongarch64-linux-gnu    == --with-abi=lp64d,
   loongarch64-linux-gnuf64 == --with-abi=lp64d,
   loongarch64-linux-gnuf32 == --with-abi=lp64f,
   loongarch64-linux-gnusf  == --with-abi=lp64s,
   and no customization is allowed.
   (maybe we can simply remove --with-abi?)

2. (config-ml.in) delete the "default" multisubdir from ${multidirs}.
   (which is base/lp64d for --with-abi=lp64d)

No other tweaking in config-ml.in is required.  So this seems to be
canonical.

The only problem is, I understand that triplets are essential to
the GNU build system, but should they always imply the default
ABI to be used when the compiler is invoked without an argument?

Reply via email to