workaround to make qemu happy on amd64 until a better and more correct

fix is applied.
sturm@ ok, maintainer ok a previous more generic approach.
This commit is contained in:
fgsch 2005-11-03 18:41:55 +00:00
parent bfd5225608
commit 11f007dd2c
6 changed files with 73 additions and 24 deletions

View File

@ -1,10 +1,11 @@
# $OpenBSD: Makefile,v 1.5 2005/10/25 03:25:44 todd Exp $
# $OpenBSD: Makefile,v 1.6 2005/11/03 18:41:55 fgsch Exp $
ONLY_FOR_ARCHS= i386 macppc # no success building on other archs yet
# no success building on other archs yet
ONLY_FOR_ARCHS= amd64 i386 macppc
COMMENT= "multi system emulator"
DISTNAME= qemu-0.7.2
PKGNAME= qemu-0.7.2
PKGNAME= ${DISTNAME}p0
CATEGORIES= emulators
HOMEPAGE= http://fabrice.bellard.free.fr/qemu/
@ -25,4 +26,8 @@ USE_X11= Yes
WANTLIB= m z ossaudio X11 Xext usbhid util pthread c
CONFIGURE_STYLE= gnu
.if ${MACHINE_ARCH} == "amd64"
PATCH_LIST= patch-* misc-*
.endif
.include <bsd.port.mk>

View File

@ -0,0 +1,17 @@
$OpenBSD: misc-target-i386_helper_c,v 1.1 2005/11/03 18:41:55 fgsch Exp $
--- target-i386/helper.c.orig Tue Oct 25 02:58:34 2005
+++ target-i386/helper.c Tue Oct 25 02:59:43 2005
@@ -3483,3 +3483,13 @@ void tlb_fill(target_ulong addr, int is_
}
env = saved_env;
}
+
+void helper_fchs_ST0(void)
+{
+ ST0 = floatx_chs(ST0);
+}
+
+void helper_fabs_ST0(void)
+{
+ ST0 = floatx_abs(ST0);
+}

View File

@ -0,0 +1,18 @@
$OpenBSD: misc-target-i386_op_c,v 1.1 2005/11/03 18:41:55 fgsch Exp $
--- target-i386/op.c.orig Tue Oct 25 02:58:19 2005
+++ target-i386/op.c Tue Oct 25 02:59:25 2005
@@ -2100,12 +2100,12 @@ void OPPROTO op_fdivr_STN_ST0(void)
/* misc FPU operations */
void OPPROTO op_fchs_ST0(void)
{
- ST0 = floatx_chs(ST0);
+ helper_fchs_ST0();
}
void OPPROTO op_fabs_ST0(void)
{
- ST0 = floatx_abs(ST0);
+ helper_fabs_ST0();
}
void OPPROTO op_fxam_ST0(void)

View File

@ -0,0 +1,12 @@
$OpenBSD: misc-target-sparc_op_c,v 1.1 2005/11/03 18:41:55 fgsch Exp $
--- target-sparc/op.c.orig Tue Oct 25 02:31:41 2005
+++ target-sparc/op.c Tue Oct 25 02:32:12 2005
@@ -1301,7 +1301,7 @@ void OPPROTO op_flush_T0(void)
void OPPROTO op_fnegs(void)
{
- FT0 = -FT1;
+ do_fnegs();
}
void OPPROTO op_fabss(void)

View File

@ -0,0 +1,15 @@
$OpenBSD: misc-target-sparc_op_helper_c,v 1.1 2005/11/03 18:41:55 fgsch Exp $
--- target-sparc/op_helper.c.orig Tue Oct 25 02:31:48 2005
+++ target-sparc/op_helper.c Tue Oct 25 02:32:36 2005
@@ -26,6 +26,11 @@ void do_fabss(void)
FT0 = float32_abs(FT1);
}
+void do_fnegs(void)
+{
+ FT0 = -FT1;
+}
+
#ifdef TARGET_SPARC64
void do_fabsd(void)
{

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-Makefile_target,v 1.4 2005/10/25 03:25:44 todd Exp $
--- Makefile.target.orig Sun Sep 4 12:11:31 2005
+++ Makefile.target Mon Oct 24 21:59:30 2005
$OpenBSD: patch-Makefile_target,v 1.5 2005/11/03 18:41:55 fgsch Exp $
--- Makefile.target.orig Sun Sep 4 14:11:31 2005
+++ Makefile.target Tue Oct 25 02:44:17 2005
@@ -17,7 +17,7 @@ ifdef CONFIG_USER_ONLY
VPATH+=:$(SRC_PATH)/linux-user
DEFINES+=-I$(SRC_PATH)/linux-user -I$(SRC_PATH)/linux-user/$(TARGET_ARCH)
@ -10,24 +10,6 @@ $OpenBSD: patch-Makefile_target,v 1.4 2005/10/25 03:25:44 todd Exp $
#CFLAGS+=-Werror
LDFLAGS=-g
LIBS=
@@ -61,7 +61,7 @@ ifeq ($(ARCH),i386)
CFLAGS+=-fomit-frame-pointer
OP_CFLAGS=$(CFLAGS) -mpreferred-stack-boundary=2
ifeq ($(HAVE_GCC3_OPTIONS),yes)
-OP_CFLAGS+= -falign-functions=0 -fno-gcse
+OP_CFLAGS+= -falign-functions=0 -fno-gcse -mfpmath=387
else
OP_CFLAGS+= -malign-functions=0
endif
@@ -83,7 +83,7 @@ endif
endif
ifeq ($(ARCH),x86_64)
-OP_CFLAGS=$(CFLAGS) -falign-functions=0
+OP_CFLAGS=$(CFLAGS) -falign-functions=0 -mfpmath=387
LDFLAGS+=-Wl,-T,$(SRC_PATH)/x86_64.ld
endif
@@ -138,6 +138,12 @@ OP_CFLAGS=$(CFLAGS) -fomit-frame-pointer
LDFLAGS+=-Wl,-T,m68k.ld
endif