qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Thomas Huth <thuth@redhat.com>
Cc: qemu-devel@nongnu.org,
	Richard Henderson <richard.henderson@linaro.org>,
	pbonzini@redhat.com, peter.maydell@linaro.org
Subject: Re: [Qemu-devel] [PATCH for-4.0] compiler.h: Add an explicit check for the compiler version
Date: Fri, 30 Nov 2018 11:15:55 +0000	[thread overview]
Message-ID: <20181130111555.GA9162@redhat.com> (raw)
In-Reply-To: <1543574620-17506-1-git-send-email-thuth@redhat.com>

On Fri, Nov 30, 2018 at 11:43:40AM +0100, Thomas Huth wrote:
> The questions about our minimum compiler requirement pops up every
> couple of months, and we then have to recall the details each time.
> So let's document this in a proper way, by adding a comment and
> check for the right compiler version to our compiler.h header.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  include/qemu/compiler.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
> index ca9bc85..775446b 100644
> --- a/include/qemu/compiler.h
> +++ b/include/qemu/compiler.h
> @@ -22,6 +22,14 @@
>  # define QEMU_GNUC_PREREQ(maj, min) 0
>  #endif
>  
> +/*
> + * We need at least GCC 4.1 for atomics support. Clang also supports these,
> + * and reports itself as GCC 4.2, so it passes this check, too.
> + */
> +#if !QEMU_GNUC_PREREQ(4, 1)
> +#error QEMU needs a compiler that is compatible with GCC v4.1 or newer
> +#endif

This encodes our current minimum which is fine as a first step.

I think we could reasonably increase our min version now that we
have declared explicitly what platforms we intend to support

      RHEL-7: 4.8.5
      Debian (Stretch): 6.3.0
      Debian (Jessie): 4.8.4
      OpenBSD (ports): 4.9.4
      FreeBSD (ports): 8.2.0
      OpenSUSE Leap 15: 7.3.1
      Ubuntu (Xenial): 5.3.1
      macOS (Homebrew): 8.2.0

Arguably we don't care about gcc version for *BSD and macOS since those
platforms normally use CLang

Anyway, with this info I think we can reasonably pick gcc 4.8.0

We would need an explicit check for clang, however, instead of
relying on it claiming gcc 4.2 support - that's a way inaccurate
claim anyway so detecting a specific clang version would be
better regardless IMHO


Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|

  parent reply	other threads:[~2018-11-30 11:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-30 10:43 [Qemu-devel] [PATCH for-4.0] compiler.h: Add an explicit check for the compiler version Thomas Huth
2018-11-30 10:46 ` Paolo Bonzini
2018-11-30 11:15 ` Daniel P. Berrangé [this message]
2018-11-30 12:30   ` Thomas Huth
2018-11-30 12:46     ` Paolo Bonzini
2018-11-30 12:52       ` Thomas Huth
2018-11-30 14:47         ` Daniel P. Berrangé
2018-11-30 13:04     ` Daniel P. Berrangé

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=20181130111555.GA9162@redhat.com \
    --to=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=thuth@redhat.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 NNTP newsgroup(s).