All of lore.kernel.org
 help / color / mirror / Atom feed
From: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	Anthony PERARD <anthony.perard@vates.tech>
Subject: Re: [PATCH 3/5] build: arm64: provide -target and -march if using clang
Date: Fri, 29 Nov 2024 22:12:30 +0000	[thread overview]
Message-ID: <87iks5bsgd.fsf@epam.com> (raw)
In-Reply-To: <d8bdd084-3e0a-40aa-b829-534219b24df7@suse.com> (Jan Beulich's message of "Fri, 29 Nov 2024 09:04:23 +0100")


Hi Jan,

Jan Beulich <jbeulich@suse.com> writes:

> On 29.11.2024 02:49, Volodymyr Babchuk wrote:
>> Provide -target and -march explicitly when building with clang. This
>> makes cross-compilation much easier, because clang accept this
>> parameters regardless of host platform. Basically,
>> 
>>   make XEN_TARGET_ARCH=arm64 clang=y llvm=y
>> 
>> will behave in the same way if building Xen on x86, or on arm64 or on
>> any other platform.
>> 
>> -march is required because with default value, clang will not
>> recognize EL2 registers.
>> 
>> Signed-off-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
>> ---
>>  config/arm64.mk | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/config/arm64.mk b/config/arm64.mk
>> index c4662f67d0..97eb9a82e7 100644
>> --- a/config/arm64.mk
>> +++ b/config/arm64.mk
>> @@ -5,6 +5,10 @@ CONFIG_XEN_INSTALL_SUFFIX :=
>>  
>>  CFLAGS += #-marm -march= -mcpu= etc
>>  
>> +ifeq ($(clang),y)
>> +CFLAGS += -target aarch64 -march=armv8-a
>> +endif
>
> Why is this dependent on (just?) $(clang), not (also?) $(llvm)?

Because this parameter is handled by clang only. There is no harm in
providing it explicitly. When building on arm64, value of this parameter
will match the default value for the platform. When building on x86, we
need to tell clang that it should generate arm64 code anyways. There is
no reason in trying to make ARM build with x86 instruction set.

> Also
> this affects both toolstack builds and hypervisor. Is applying -march
> like this actually appropriate for the toolstack?

This is a good question. I can't see why this can't be appropriate for
toolstack. I.e. what bad can happen when building the toolstack.

-- 
WBR, Volodymyr

  reply	other threads:[~2024-11-29 22:13 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29  1:49 [PATCH 0/5] aarch64, common: improve clang and llvm support Volodymyr Babchuk
2024-11-29  1:49 ` [PATCH 2/5] build: add possibility to use LLVM tools Volodymyr Babchuk
2024-11-29  7:57   ` Jan Beulich
2024-11-29 14:50     ` Anthony PERARD
2024-11-29  1:49 ` [PATCH 1/5] arm: bugframe: emit msg offset only if msg is present Volodymyr Babchuk
2024-11-29  7:44   ` Jan Beulich
2024-11-29  1:49 ` [PATCH 4/5] xen: build: add support for CFLAGS_REMOVE variable Volodymyr Babchuk
2024-11-29  8:10   ` Jan Beulich
2024-11-29  1:49 ` [PATCH 5/5] xen: arm64: remove -mgeneral-regs-only for vfp.c Volodymyr Babchuk
2024-11-29  8:12   ` Jan Beulich
2024-11-29  1:49 ` [PATCH 3/5] build: arm64: provide -target and -march if using clang Volodymyr Babchuk
2024-11-29  8:04   ` Jan Beulich
2024-11-29 22:12     ` Volodymyr Babchuk [this message]
2024-11-30 17:15       ` Julien Grall
2024-12-02  7:52         ` Jan Beulich
2024-12-02 20:38           ` Julien Grall
2024-12-03 10:35             ` Luca Fancellu
2024-11-30 17:29   ` Julien Grall

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=87iks5bsgd.fsf@epam.com \
    --to=volodymyr_babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.