All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleksii <oleksii.kurochko@gmail.com>
To: Andrew Cooper <Andrew.Cooper3@citrix.com>,
	 "xen-devel@lists.xenproject.org"
	<xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
	Gianluca Guida <gianluca@rivosinc.com>,
	Doug Goldstein <cardoe@cardoe.com>
Subject: Re: [XEN PATCH v1 2/4] automation: add cross-compiler support for the build script
Date: Thu, 29 Dec 2022 10:13:46 +0200	[thread overview]
Message-ID: <661c2a359f5bc409821b16802e596ace90b67abe.camel@gmail.com> (raw)
In-Reply-To: <8f8c26d5-934d-0dd1-1d51-b04e134fcf6e@citrix.com>

On Wed, 2022-12-28 at 23:24 +0000, Andrew Cooper wrote:
> On 23/12/2022 11:16 am, Oleksii Kurochko wrote:
> > diff --git a/automation/scripts/build b/automation/scripts/build
> > index a593419063..026f480e76 100755
> > --- a/automation/scripts/build
> > +++ b/automation/scripts/build
> > @@ -2,12 +2,12 @@
> >  
> >  test -f /etc/os-release && cat "$_"
> >  
> > -$CC --version
> > +${CROSS_COMPILE}${CC} --version
> >  
> >  # Express the compiler version as an integer.  e.g. GCC 4.9.2 =>
> > 0x040902
> >  cc-ver()
> >  {
> > -    $CC -dumpversion | awk -F. '{ printf "0x%02x%02x%02x", $1, $2,
> > $3 }'
> > +    ${CROSS_COMPILE}${CC} -dumpversion | awk -F. '{ printf
> > "0x%02x%02x%02x", $1, $2, $3 }'
> >  }
> >  
> >  # random config or default config
> > @@ -66,7 +66,7 @@ if ! type python3 || python3 -c "import sys; res
> > = sys.version_info < (3, 5); ex
> >  fi
> >  
> >  # SeaBIOS requires GCC 4.6 or later
> > -if [[ "${CC}" == "gcc" && `cc-ver` -lt 0x040600 ]]; then
> > +if [[ "${CROSS_COMPILE}${CC}" == "gcc" && `cc-ver` -lt 0x040600
> > ]]; then
> 
> This change won't work, because it's no longer a plain "gcc".
> 

If look at tests on GitLab CI&CD these changes don't break anything.

> Also, prepreding CROSS_COMPILE isn't compatible with LLVM toolchains,
> but that's not something you've made any worse with your change (just
> more obvious).
> 

CROSS_COMPILE isn't use with LLVM toolchain. I mean that in case of
LLVM toolchain CROSS_COMPILE would be equal to empty string plus
CC=clang or something similar.

> We probably want a stanza near the top which sets
> CC="${CROSS_COMPILE}${CC}" which can be adjusted to support LLVM in
> due
> course, and we'll need to detect GCC using --version | grep as its
> done
> elsewhere.
> 
> But the other logic wants reworking too so we don't play around with
> bits of the tools build when we're doing a hypervisor-only build
> anyway...
> 

I think that I can get rid of CROSS_COMPILE variable at all and use
CC=riscv64-linux-gnu-gcc direcly for RISC-V 64 targers in build.yaml.
Would this be a better solution?

> ~Andrew

~Oleksii



  reply	other threads:[~2022-12-29  8:14 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-23 11:16 [XEN PATCH v1 0/4] Add minimal RISC-V Xen build and build testing Oleksii Kurochko
2022-12-23 11:16 ` [XEN PATCH v1 1/4] arch/riscv: initial RISC-V support to build/run minimal Xen Oleksii Kurochko
2022-12-23 13:50   ` Julien Grall
2022-12-26 11:14     ` Oleksii
2022-12-28  4:51       ` Alistair Francis
2022-12-28 14:33         ` Oleksii
2022-12-28 19:01         ` Andrew Cooper
2022-12-29  8:11           ` Oleksii
2022-12-28 22:22       ` Julien Grall
2022-12-29  8:45         ` Oleksii
2023-01-02 10:58           ` Julien Grall
2022-12-28 18:56   ` Andrew Cooper
2022-12-29  8:49     ` Oleksii
2022-12-23 11:16 ` [XEN PATCH v1 2/4] automation: add cross-compiler support for the build script Oleksii Kurochko
2022-12-28 23:24   ` Andrew Cooper
2022-12-29  8:13     ` Oleksii [this message]
2022-12-29 13:44       ` Oleksii
2022-12-23 11:16 ` [XEN PATCH v1 3/4] automation: add python3 package for riscv64.dockerfile Oleksii Kurochko
2022-12-28 23:26   ` Andrew Cooper
2022-12-29  7:45     ` Oleksii
2022-12-29 13:05       ` Andrew Cooper
2022-12-23 11:16 ` [XEN PATCH v1 4/4] automation: add RISC-V 64 cross-build tests for Xen Oleksii Kurochko
2022-12-28  4:55   ` Alistair Francis

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=661c2a359f5bc409821b16802e596ace90b67abe.camel@gmail.com \
    --to=oleksii.kurochko@gmail.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=cardoe@cardoe.com \
    --cc=gianluca@rivosinc.com \
    --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.