On Mon, Oct 19, 2020 at 2:35 AM Kito Cheng <kito.ch...@sifive.com> wrote:

>  - I was consider to implmenet this into `--with-multilib-list` option,
>    but I am not sure who will using that with riscv*-*-elf*, so I decide to
>    using another option name for that.
>

I believe that --with-multllib-list is only useful for linux targets.  I
added it to fix a problem with one of the distros.  They needed to enable
multilibs to get the right paths that they wanted at install time, but
since we don't support native ilp32 builds on rv64 yet, they needed to be
able to specify that only one multilib gets built.  So that is what the
RISC-V --with-multilib-list is for, and it only allows one multilib to be
selected.

Since you have these as separate options, I think using both
--with-multilib-list and --with-multilib-config should be a configure
error.  At least for RISC-V this doesn't do anything meaningful, two t-*
files get included, and the second one t-withmultilib overrides the first
one t-withmultilib-config, so the --with-multilib-config option does
nothing, regardless of what order you specify the two options.  Note that
t-withmultilib sets MULTILIB_OSDIRNAMES and t-withmultilib-config does not,
so we would get a confused result if they were included in the other
order.  Linux targets need MULTILIB_OSDIRNAMES for embedded elf targets do
not.  Anyways, it is simpler to just not allow both configure options to be
used at the same time.

>  - --with-multilib-config will pass arguments to multilib-generator, and
>    then using the generated multi-lib config file to build the toolchain.
>
>   e.g. Build riscv gcc, default arch/abi is rv64gc/lp64, and build multilib
>        for rv32imafd/ilp32 and rv32i/ilp32; rv32ic/ilp32 will reuse
>        rv32i/ilp32.
>     $ <GCC-SRC>/configure \
>        --target=riscv64-elf \
>        --with-arch=rv64gc --with-abi=lp64 \
>        --with-multilib-config=rv32i-ilp32--c;rv32imafd-ilp32--
>

Overall looks OK to me, and very useful, though RISC-V specific, since the
syntax used is specific to the RISC-V multilib generator.  We do have a
number of target dependent configure options though, like --with-lxc1-sxc1
for MIPS and --with-aix-soname= for AIX, so I don't think this should be a
problem.  Unless maybe we want a clearer name, like maybe
--with-multilib-generator, to indicate that it requires a script to
generate the multilibs.

diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
> index 5330bf3bb293..2972dcad7c26 100644
> --- a/gcc/doc/install.texi
> +++ b/gcc/doc/install.texi
> @@ -1252,6 +1252,36 @@ If @option{--with-multilib-list} is not given, then
> only 32-bit and
>  64-bit run-time libraries will be enabled.
>  @end table
>
> +@item --with-multilib-config=@var{config}
> +Specify what multilibs to build.  @var{config} is a semicolon separated
> list of
> +values, possibly consisting of a single value.  Currently only implemented
> +for riscv*-*-elf*.  The accepted values and meaning is given below.
>

The accepted values and meanings are given below.

> +
> +Every config is construct with four components: architecture string, ABI,
> +reuse rule with architecture string and reuse rule with sub-extension.
>

Every config is constructed with ...

Other than the question of whether we maybe want to rename the configure
option, and some minor english improvements, this is OK.
Jim

Reply via email to