Subject: pkg/32464: [patch] emulators/qemu doesn't compile on NetBSD/amd64 -current
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <tnn@netilium.org>
List: pkgsrc-bugs
Date: 01/06/2006 04:25:00
>Number:         32464
>Category:       pkg
>Synopsis:       [patch] emulators/qemu doesn't compile on NetBSD/amd64 -current
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 06 04:25:00 +0000 2006
>Originator:     Tobias Nygren
>Release:        -current 20060102
>Organization:
>Environment:
>Description:
emulators/qemu doesn't compile on NetBSD/amd64 -current.
It may be a compiler bug and/or an inline issue.
A workaround is included below.
>How-To-Repeat:
[...]
gcc -O2 -I/usr/pkg/include -I/usr/include -I. -I/scratch/pkgsrc-obj/emulators/qemu/work.soyokaze/qemu-0.8.0/target-i386 -I/scratch/pkgsrc-obj/emulators/qemu/work.soyokaze/qemu-0.8.0 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -I/scratch/pkgsrc-obj/emulators/qemu/work.soyokaze/qemu-0.8.0/fpu -DHAS_AUDIO -I/scratch/pkgsrc-obj/emulators/qemu/work.soyokaze/qemu-0.8.0/slirp -c -o translate-op.o /scratch/pkgsrc-obj/emulators/qemu/work.soyokaze/qemu-0.8.0/translate-op.c
In file included from /scratch/pkgsrc-obj/emulators/qemu/work.soyokaze/qemu-0.8.0/translate-op.c:36:
op.h: In function `dyngen_code':
op.h:5935: error: parse error before '.' token
op.h:5937: error: parse error before '.' token
op.h:5944: error: parse error before '.' token
op.h:5946: error: parse error before '.' token
gmake[1]: *** [translate-op.o] Error 1
gmake[1]: Leaving directory `/scratch/pkgsrc-obj/emulators/qemu/work.soyokaze/qemu-0.8.0/i386-softmmu'
gmake: *** [all] Error 1
*** Error code 2

>Fix:
$NetBSD$

--- target-i386/op.c.orig	2006-01-06 05:10:30.000000000 +0100
+++ target-i386/op.c
@@ -2099,14 +2099,17 @@ void OPPROTO op_fdivr_STN_ST0(void)
 }
 
 /* misc FPU operations */
+
+void fchs_dummy() {ST0 = floatx_chs(ST0);}
 void OPPROTO op_fchs_ST0(void)
 {
-    ST0 = floatx_chs(ST0);
+    fchs_dummy();
 }
 
+void fabs_dummy() {ST0 = floatx_abs(ST0);}
 void OPPROTO op_fabs_ST0(void)
 {
-    ST0 = floatx_abs(ST0);
+    fabs_dummy();
 }
 
 void OPPROTO op_fxam_ST0(void)

---------------------------------------

$NetBSD$

--- target-sparc/op.c.orig	2005-12-19 23:51:53.000000000 +0100
+++ target-sparc/op.c
@@ -1299,9 +1299,10 @@ void OPPROTO op_flush_T0(void)
     helper_flush(T0);
 }
 
+void fnegs_dummy() {FT0 = -FT1;}
 void OPPROTO op_fnegs(void)
 {
-    FT0 = -FT1;
+	fnegs_dummy();
 }
 
 void OPPROTO op_fabss(void)