QEMU-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Brad Smith <brad@comstyle.com>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: qemu-devel@nongnu.org
Subject: tcg/ppc: Fix building with Clang
Date: Tue, 20 Apr 2021 21:04:45 -0400
Message-ID: <YH96LWkx1RwT8T7E@humpty.home.comstyle.com> (raw)

Fix building with Clang.

At the moment Clang does not define _CALL_SYSV as GCC does. From
clang/lib/Basic/Targets/PPC.cpp in getTargetDefines()..

  // FIXME: The following are not yet generated here by Clang, but are
  //        generated by GCC:
  //   _SOFT_FLOAT_
  //   __APPLE_ALTIVEC__
  //   __RECIP__
  //   __RECIPF__
  //   __RSQRTE__
  //   __RSQRTEF__
  //   _SOFT_DOUBLE_
  //   __NO_LWSYNC__
  //   __CMODEL_MEDIUM__
  //   __CMODEL_LARGE__
  //   _CALL_SYSV

This is from the OpenBSD ports tree where we use it to build
on OpenBSD/powerpc.

Signed-off-by: Brad Smith <brad@comstyle.com>

diff --git a/tcg/ppc/tcg-target.c.inc b/tcg/ppc/tcg-target.c.inc
index 838ccfa42d..d2611832e5 100644
--- a/tcg/ppc/tcg-target.c.inc
+++ b/tcg/ppc/tcg-target.c.inc
@@ -25,6 +25,11 @@
 #include "elf.h"
 #include "../tcg-pool.c.inc"
+/* Clang does not define _CALL_* */
+#if defined(__clang__) && defined(__ELF__) && !defined(_CALL_SYSV)
+#define _CALL_SYSV 1
 #if defined _CALL_DARWIN || defined __APPLE__

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YH96LWkx1RwT8T7E@humpty.home.comstyle.com \
    --to=brad@comstyle.com \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

QEMU-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/qemu-devel/0 qemu-devel/git/0.git
	git clone --mirror https://lore.kernel.org/qemu-devel/1 qemu-devel/git/1.git
	git clone --mirror https://lore.kernel.org/qemu-devel/2 qemu-devel/git/2.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 qemu-devel qemu-devel/ https://lore.kernel.org/qemu-devel \
	public-inbox-index qemu-devel

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git