qemu: fix the build with clang on powerpc

Workaround the lack the of _CALL_SYSV and build with -O0;
-O1 causes linking errors and -O2 segfaults.

Input by Brad (maintainer)
This commit is contained in:
cwen 2020-04-23 04:30:35 +00:00
parent 5485d4a6f2
commit 47722ebc01
2 changed files with 25 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.194 2020/04/04 08:36:55 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.195 2020/04/23 04:30:35 cwen Exp $
ONLY_FOR_ARCHS= aarch64 amd64 arm i386 powerpc sparc64
@ -106,6 +106,11 @@ CONFIGURE_ARGS+=--disable-debug-info
TEST_TARGET= check
# XXX Optimizer bug, using -O2 causes segfaults, -O1 linking errors
.if ${MACHINE_ARCH:Mpowerpc}
CFLAGS += -O0
.endif
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/qemu
${INSTALL_SCRIPT} ${FILESDIR}/qemu-ifup \

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-tcg_ppc_tcg-target_inc_c,v 1.6 2020/04/23 04:30:35 cwen Exp $
Workaround the lack of _CALL_SYSV with clang on powerpc
Index: tcg/ppc/tcg-target.inc.c
--- tcg/ppc/tcg-target.inc.c.orig
+++ tcg/ppc/tcg-target.inc.c
@@ -25,6 +25,11 @@
#include "elf.h"
#include "tcg-pool.inc.c"
+/* clang does not define _CALL_* */
+#if defined __clang__ && defined __ELF__
+#define _CALL_SYSV 1
+#endif
+
#if defined _CALL_DARWIN || defined __APPLE__
#define TCG_TARGET_CALL_DARWIN
#endif