qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [RFC v3 09/32] build-sys: add i686 cpu target


From: Peter Maydell
Subject: Re: [RFC v3 09/32] build-sys: add i686 cpu target
Date: Wed, 8 Sep 2021 14:45:56 +0100

On Tue, 7 Sept 2021 at 13:37, <marcandre.lureau@redhat.com> wrote:
>
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> Rust does not have i386 targets, so distinguish when target cpu is i686.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  configure | 13 +++++++++----
>  1 file changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/configure b/configure
> index 8adf2127c3..48ff2837d9 100755
> --- a/configure
> +++ b/configure
> @@ -617,6 +617,8 @@ esac
>  if test ! -z "$cpu" ; then
>    # command line argument
>    :
> +elif check_define __i686__ ; then
> +  cpu="i686"
>  elif check_define __i386__ ; then
>    cpu="i386"

This isn't what the 'cpu' variable is attempting to distinguish.
We care only about "is this the 32-bit Intel CPU family?", which
we for convenience name "i386". We do not attempt (at least not in
configure) to distinguish between different sub-flavours or
versions of that 32-bit architecture. (Similarly, 'arm' just
means "32-bit arm", and doesn't distinguish v5, v6, v7 or whatever.)

As it happens the existing C codebase won't work on a classic
i386 -- for instance the cpu_get_host_ticks() function
for i386 host is implemented as the 'rdtsc' insn, which
didn't come in until the pentium.

For native compilation, I guess we should just assume that
whatever rustc targets by default is the right thing.
For cross compilation we probably need some mechanism for
the user to tell us what the right rust cross target is,
the same way we currently have them pass a --cross-prefix
(which typically looks like a target-triple, but where the
cpu part of the triple isn't necessarily the same thing as
the 'cpu' variable configure is using.

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]