public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kito Cheng <kito.cheng@gmail.com>
To: Sebastian Huber <sebastian.huber@embedded-brains.de>
Cc: Kito Cheng <kito.cheng@sifive.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	jimw@sifive.com
Subject: Re: [PATCH] RISC-V: Always define MULTILIB_DEFAULTS
Date: Thu, 28 Jan 2021 12:18:38 +0800	[thread overview]
Message-ID: <CA+yXCZBWCKcjUQiwDttkVpXrXqwpEQ9aqS5Se+3qB9X-pzsMug@mail.gmail.com> (raw)
In-Reply-To: <b7cc4e4a-02d0-da1f-b8ef-f8eeeb9b9a9d@embedded-brains.de>

Hi Sebastian:

Thank for report this issue, I can reproduce that, I'll investigate what
happened today :)

Sebastian Huber <sebastian.huber@embedded-brains.de> 於 2021年1月26日 週二 14:13
寫道:

> Hello Kito,
>
> On 20/11/2020 09:33, Kito Cheng wrote:
> >   - Define MULTILIB_DEFAULTS can reduce the total number of multilib if
> >     the default arch and ABI are listed in the multilib config.
> >
> >   - This also simplify the implementation of --with-multilib-list.
> >
> > gcc/ChangeLog:
> >
> >       * config.gcc (riscv*-*-*): Add TARGET_RISCV_DEFAULT_ABI and
> >       TARGET_RISCV_DEFAULT_ARCH to tm_defines.
> >       Remove including riscv/withmultilib.h for --with-multilib-list.
> >       * config/riscv/riscv.h (STRINGIZING): New.
> >       (__STRINGIZING): Ditto.
> >       (MULTILIB_DEFAULTS): Ditto.
> >       * config/riscv/withmultilib.h: Remove.
>
> I think this change broke the multilib generation for RTEMS (git
> bisect). I had to apply this local patch to build
> a5ad5d5c478ee7bebf057161bb8715ee7d286875:
>
> diff --git a/gcc/config.gcc b/gcc/config.gcc
> index 6f1ee62f7fd..7449c470265 100644
> --- a/gcc/config.gcc
> +++ b/gcc/config.gcc
> @@ -4612,7 +4612,6 @@ case "${target}" in
>                          exit 1
>                          ;;
>                  esac
> - with_arch=`${srcdir}/config/riscv/arch-canonicalize ${with_arch}`
>                  tm_defines="${tm_defines}
> TARGET_RISCV_DEFAULT_ARCH=${with_arch}"
>
>                  # Make sure --with-abi is valid.  If it was not specified,
>
> With this commit we have:
>
> ./gcc/xgcc -print-multi-lib
> .;
> rv32i/ilp32;@march=rv32i@mabi=ilp32
> rv32im/ilp32;@march=rv32im@mabi=ilp32
> rv32iac/ilp32;@march=rv32iac@mabi=ilp32
> rv32imac/ilp32;@march=rv32imac@mabi=ilp32
> rv32imafc/ilp32f;@march=rv32imafc@mabi=ilp32f
> rv64imafd/lp64d;@march=rv64imafd@mabi=lp64d
> rv64imafd/lp64d/medany;@march=rv64imafd@mabi=lp64d@mcmodel=medany
> rv64imac/lp64;@march=rv64imac@mabi=lp64
> rv64imac/lp64/medany;@march=rv64imac@mabi=lp64@mcmodel=medany
> rv64imafdc/lp64d;@march=rv64imafdc@mabi=lp64d
> rv64imafdc/lp64d/medany;@march=rv64imafdc@mabi=lp64d@mcmodel=medany
>
> ./gcc/xgcc -print-multi-directory -march=rv32imafd -mabi=ilp32d
> rv32imafd/ilp32d
>
> So for this option set it prints a multilib directory which is not
> listed. Also GCC seems to use this directory for the search paths and
> cannot find multilib specific C++ header files for example.
>
> In the commit before (3a5d8ed231a0329822b7c032ba0834991732d2a0) we have:
>
> ./gcc/xgcc -print-multi-lib
> .;
> rv32i/ilp32;@march=rv32i@mabi=ilp32
> rv32im/ilp32;@march=rv32im@mabi=ilp32
> rv32imafd/ilp32d;@march=rv32imafd@mabi=ilp32d <-- HERE
> rv32iac/ilp32;@march=rv32iac@mabi=ilp32
> rv32imac/ilp32;@march=rv32imac@mabi=ilp32
> rv32imafc/ilp32f;@march=rv32imafc@mabi=ilp32f
> rv64imafd/lp64d;@march=rv64imafd@mabi=lp64d
> rv64imafd/lp64d/medany;@march=rv64imafd@mabi=lp64d@mcmodel=medany
> rv64imac/lp64;@march=rv64imac@mabi=lp64
> rv64imac/lp64/medany;@march=rv64imac@mabi=lp64@mcmodel=medany
> rv64imafdc/lp64d;@march=rv64imafdc@mabi=lp64d
> rv64imafdc/lp64d/medany;@march=rv64imafdc@mabi=lp64d@mcmodel=medany
>
> ./gcc/xgcc -print-multi-directory -march=rv32imafd -mabi=ilp32d
> rv32imafd/ilp32d
>
> I was not able to figure out what prevents the generation of the
> rv32imafd/ilp32d multilib in commit
> a5ad5d5c478ee7bebf057161bb8715ee7d286875. The gcc/tm.h contains this:
>
> gcc/tm.h:#ifndef TARGET_RISCV_DEFAULT_ARCH
> gcc/tm.h:# define TARGET_RISCV_DEFAULT_ARCH rv32gc
> gcc/tm.h:#ifndef TARGET_RISCV_DEFAULT_ABI
> gcc/tm.h:# define TARGET_RISCV_DEFAULT_ABI ilp32d
>
> --
> embedded brains GmbH
> Herr Sebastian HUBER
> Dornierstr. 4
> 82178 Puchheim
> Germany
> email: sebastian.huber@embedded-brains.de
> phone: +49-89-18 94 741 - 16
> fax:   +49-89-18 94 741 - 08
>
> Registergericht: Amtsgericht München
> Registernummer: HRB 157899
> Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
> Unsere Datenschutzerklärung finden Sie hier:
> https://embedded-brains.de/datenschutzerklaerung/
>
>

      reply	other threads:[~2021-01-28  4:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-20  8:33 Kito Cheng
2020-11-20 22:10 ` Jim Wilson
2020-11-21  6:37   ` Kito Cheng
2020-11-27 23:48     ` Jim Wilson
2020-11-30  3:52       ` Kito Cheng
2021-01-26  6:11 ` Sebastian Huber
2021-01-28  4:18   ` Kito Cheng [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA+yXCZBWCKcjUQiwDttkVpXrXqwpEQ9aqS5Se+3qB9X-pzsMug@mail.gmail.com \
    --to=kito.cheng@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jimw@sifive.com \
    --cc=kito.cheng@sifive.com \
    --cc=sebastian.huber@embedded-brains.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).