All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tcg/ppc: Fix building with Clang
@ 2021-04-21  1:14 Brad Smith
  2021-04-21  9:03 ` Peter Maydell
  0 siblings, 1 reply; 7+ messages in thread
From: Brad Smith @ 2021-04-21  1:14 UTC (permalink / raw)
  To: Richard Henderson; +Cc: qemu-devel

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_
  //   __RECIP_PRECISION__
  //   __APPLE_ALTIVEC__
  //   __RECIP__
  //   __RECIPF__
  //   __RSQRTE__
  //   __RSQRTEF__
  //   _SOFT_DOUBLE_
  //   __NO_LWSYNC__
  //   __CMODEL_MEDIUM__
  //   __CMODEL_LARGE__
  //   _CALL_SYSV
  //   _CALL_DARWIN

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
+#endif
+
 #if defined _CALL_DARWIN || defined __APPLE__
 #define TCG_TARGET_CALL_DARWIN
 #endif


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-05-27 20:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-21  1:14 [PATCH] tcg/ppc: Fix building with Clang Brad Smith
2021-04-21  9:03 ` Peter Maydell
2021-04-22  5:18   ` Richard Henderson
2021-04-22  9:20     ` Peter Maydell
2021-04-22 15:39       ` Richard Henderson
2021-05-02  4:02         ` Brad Smith
2021-05-27 20:32           ` Brad Smith

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.