public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jeff Law <jeffreyalaw@gmail.com>
To: Jin Ma <jinma@linux.alibaba.com>, Kito Cheng <kito.cheng@gmail.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>,
	"Maciej W. Rozycki" <macro@embecosm.com>,
	"richard.sandiford" <richard.sandiford@arm.com>,
	"christoph.muellner" <christoph.muellner@vrull.eu>,
	"jinma.contrib" <jinma.contrib@gmail.com>
Subject: Re: [PATCH] RISC-V: Add the option "-mdisable-multilib-check" to avoid multilib checks breaking the compilation.
Date: Mon, 29 May 2023 07:02:18 -0600	[thread overview]
Message-ID: <e9595455-652b-a944-e5b3-2a2f1de34659@gmail.com> (raw)
In-Reply-To: <25b40604-3608-4be4-91e9-46d5ce9ccb9a.jinma@linux.alibaba.com>



On 5/28/23 21:46, Jin Ma wrote:
>>>>> When testing a extension, it is often necessary for a certain program not to
>>>>> need some kind of extension, such as the bitmanip extension, to evaluate the
>>>>> performance or codesize of the extension. However, the current multilib rules
>>>>> will report an error when it is not a superset of the MULTILIB_REQUIRED list,
>>>>> which will cause the program to be unable to link normally, thus failing to
>>>>> achieve the expected purpose.
>>>>
>>>>   Hmm, I have troubles understanding what is going on here.  What do you
>>>> refer to by saying: "it is not a superset of the MULTILIB_REQUIRED list"?
>>>
>>> This is a new matching rule added by kito for the multilib of riscv:
>>> https://github.com/gcc-mirror/gcc/commit/d72ca12b846a9f5c01674b280b1817876c77888f
>>>
>>>>   There should be no problem with linking compiled modules together that
>>>> make use of different extensions, with the static linker figuring out the
>>>> combined set of extensions actually required at run time for the program
>>>> loader to consider, as long as the modules do not have contradicting
>>>> requirements, e.g. big vs little endianness or RV32 vs RV64.
>>>>
>>>>   Can you give me a specific example (compilation options and multilibs
>>>> available) of a failure you refer to?
>>>
>>> A simple example:
>>> 1. Use "--disable-multilib --with-abi =lp64d --with-arch =rv64imafdc_zba_zbb_zbc_zbs"
>>> to build the toolchain".
>>> 2. Use the toolchain to test the impact of zba_zbb_zbc_zbs extensions on the
>>> performance and codesize of some functions or files in the program.
>>>
>>> In this case, I may need to use the command "-mabi=lp64d -march=rv64imafdc" for
>>> the compilation of a specific .c file in the program, which will cause the link to
>>> fail and throw the following error: "FATAL ERROR: Can't find suitable multilib set for
>>> '-march=rv64imafdc'/'-mabi=lp64d'". This does not satisfy the purpose of the test.
>>
>> I feel this case should be build with --with-arch =rv64imafdc and test
>> with -march=rv64imafdc and  -march=rv64imafdc_zba_zbb_zbc_zbs,
>> but anyway I am OK with option :P
> 
> Yes, but with "--with-arch=rv64imafdc" building toolchains, the library will not contain
> zba_zbb_zbc_zbs extensions, so how can we quickly and easily eliminate the impact of not
> using zba_zbb_zbc_zbs extensions in a certain program on program performance and codesize?
> 
> Although-mno-multilib-check is unsafe, it is useful during the development and testing phases.
But I'm not sure that's a good reason to include an unsafe option like 
this in the official GCC sources.

This is the kind of thing that I'd tend to think belongs as a local change.

jeff

  reply	other threads:[~2023-05-29 13:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-23  4:42 Jin Ma
2023-05-25 16:10 ` Kito Cheng
2023-05-26 13:19 ` Maciej W. Rozycki
2023-05-29  2:53   ` Jin Ma
2023-05-29  3:14     ` Kito Cheng
2023-05-29  3:46       ` Jin Ma
2023-05-29 13:02         ` Jeff Law [this message]
2023-05-30 14:48     ` Maciej W. Rozycki
2023-05-30 23:39       ` Jeff Law

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=e9595455-652b-a944-e5b3-2a2f1de34659@gmail.com \
    --to=jeffreyalaw@gmail.com \
    --cc=christoph.muellner@vrull.eu \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jinma.contrib@gmail.com \
    --cc=jinma@linux.alibaba.com \
    --cc=kito.cheng@gmail.com \
    --cc=macro@embecosm.com \
    --cc=richard.sandiford@arm.com \
    /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).