qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qemu-barrier: Fix compiler version check for fu


From: Stefan Weil
Subject: Re: [Qemu-devel] [PATCH] qemu-barrier: Fix compiler version check for future gcc versions
Date: Mon, 08 Oct 2012 22:57:02 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120912 Thunderbird/15.0.1

Am 08.10.2012 22:01, schrieb Michael S. Tsirkin:
On Wed, Oct 03, 2012 at 11:11:02PM +0200, Stefan Weil wrote:
The current check will give a wrong result for gcc-5.x with x < 4.
Using QEMU_GNUC_PREREQ is simpler and fixes that issue.

Signed-off-by: Stefan Weil <address@hidden>
---

With current gcc versions (gcc-4.x) there is no problem.
Nevertheless, I suggest to fix this in stable versions, too.

Regards

Stefan Weil
ACK for stable tree.

  qemu-barrier.h |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qemu-barrier.h b/qemu-barrier.h
index 7e11197..16f0942 100644
--- a/qemu-barrier.h
+++ b/qemu-barrier.h
@@ -19,7 +19,7 @@
   * mfence on 32 bit as well, e.g. if built with -march=pentium-m.
   * However, on i386, there seem to be known bugs as recently as 4.3.
   * */
-#if defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
+#if QEMU_GNUC_PREREQ(4, 4)
  #define smp_mb() __sync_synchronize()
  #else
  #define smp_mb() asm volatile("lock; addl $0,0(%%esp) " ::: "memory")
--
1.7.10

My patch was incomplete: an include statement for compiler.h
is needed (see the patches which were applied to the same file in
git master.

Regards

Stefan Weil




reply via email to

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