pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/42899: emulators/qemu build failure (undefined sysmol linking libqemu.a) (NetBSD 4.0 / i386)
The following reply was made to PR pkg/42899; it has been noted by GNATS.
From: Robert Elz <kre%munnari.OZ.AU@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: pkg/42899: emulators/qemu build failure (undefined sysmol linking
libqemu.a) (NetBSD 4.0 / i386)
Date: Fri, 09 Apr 2010 14:31:44 +0700
Date: Tue, 2 Mar 2010 11:15:05 +0000 (UTC)
From: "OBATA Akio" <obache%NetBSD.org@localhost>
Message-ID: <20100302111505.B533863C37A%www.NetBSD.org@localhost>
| From: "OBATA Akio" <obache%netbsd.org@localhost>
| I feel that softfloat-native.h is broken.
Yes, I think you're right. It looks as if someone upstream botched an
attempt to include an earlier NetBSD pkgsrc patch - and mostly just got
lucky as the patch is only needed on NetBSD 4 (and earlier) systems, so
your average user today on NetBSD 4 or current isn't bothered by it.
| I don't know when isunordered and something had been added in math.h.
4.99.something it appears - it is (they are) in NetBSD 5.0, but not in
NetBSD 4.x for any released x, and not pulled up to netbsd-4 so they're
also not pending for some mythical forthcoming NetBSD 4.n
But it turns out it doesn't matter - all that is needed (approximately) is
to get NetBSD inside the #if that you mentioned, and good things happen.
The .h file in the #ifdef NebtBSD part already checks to see if each of the
relevant macros is defined before redefining it, so on NetBSD systems that
have these things, the genuine NetBSD versions are used, on systems that
don't have them, the replacements from qemu's softfloat.h take over.
On non-netbsd there should be no changes due to this.
I enclose a patch below that seems to correct this problem for me. It
would be nice for it to be tested on something other than NetBSD 4 before
being committed though... (though I can't see how it would break anything).
While I was there, I also fix the next two "fails to compile" on NetBSD 4
problems, and include patches for those below as well - the first is
simple, the x86_84-softmmu/translate.c file won't compile in the default
max data size on NetBSD 4, so I added
UNLIMIT_RESOURCES= datasize
to the Makefile (that should be harmless in all cases). This might
affect other *-softmmu/translate.c compiles as well, some of the others
also looked to be quite slow (suggesting they might also have been quite
big) - but once the limit was gone, they all compiled without problems.
Last, the pc-bios/optionrom signing code was using "od -A" which does not
exist on NetBSD 4, I replaced the use of -A with an appropriate sed
expression (I also made it drop leading 0's from the decimal numbers output
by the "-t u1" option, as they cause expr to believe the numbers are octal).
To go with all of that, the patch below includes a revbump, which is perhaps
not strictly required, but given the number of changes, seemed to me to be
worthwhile, so everyone knows which version of the package they're using in
case of other problems later.
To apply this patch, just save it somewhere and ...
cd .../pkgsrc/emulators/qemu
patch <saved-file-name
you can probably just pipe this entire e-mail into patch if you prefer, but
since this e-mail hasn't existed before i send it, I can't really test that
option...
For the new file names in qemu/patches, I selected patch-au for the
softfloat.h patch, as it appears that patch file name has been used to
patch softfloat.h in the past, and patch-bb for the signoption.sh patch,
as we don't appear to have had a patch-bb before, and that file doesn't
look to have been patched in earlier pkgsrc versions (I admit to having no
understanding at all for the naming scheme used for the qemu patches, all
of the patch-a? are used, just patch-ba, no patch-c? then a bunch of
patch-d? Weird...)
Simply applying this patch should allow qemu to build, install (etc) on
NetBSD 4, and everything else it built on before if I didn't accidentally
break anything - when the patches are checked in, the distinfo file will
need rebuilding to account for the expansion of the $NetBSD$ tags in the
patches.
kre
ps: if anyone knows how to make "cvs diff" do the -N diff option correctly
so new files can be included in the patch, I'd love to know it...
diff -urN ../qemu/Makefile ./Makefile
--- ../qemu/Makefile 2010-02-28 06:21:13.000000000 +0700
+++ ./Makefile 2010-04-09 14:01:43.000000000 +0700
@@ -4,6 +4,7 @@
DISTNAME= qemu-0.12.3
CATEGORIES= emulators
MASTER_SITES= http://download.savannah.gnu.org/releases/qemu/
+PKGREVISION= 1
MAINTAINER= pkgsrc-users%NetBSD.org@localhost
HOMEPAGE= http://www.qemu.org/
@@ -15,6 +16,7 @@
CONFLICTS+= qemu-bin-[0-9]*
NOT_FOR_PLATFORM= NetBSD-1.[0-6]*-*
+UNLIMIT_RESOURCES= datasize
USE_TOOLS+= gmake perl:build
HAS_CONFIGURE= yes
diff -urN ../qemu/distinfo ./distinfo
--- ../qemu/distinfo 2010-02-28 06:21:13.000000000 +0700
+++ ./distinfo 2010-04-09 13:31:27.000000000 +0700
@@ -5,7 +5,9 @@
Size (qemu-0.12.3.tar.gz) = 4693581 bytes
SHA1 (patch-aa) = 7180def64ebff88074666adef21ee1b5022b6881
SHA1 (patch-ao) = e515093b6ea99f9cba665de022fd62f3be911569
+SHA1 (patch-au) = c6e074d9a18db9481b5f061a2cd4468565a3a5f5
SHA1 (patch-ba) = 7c5043a39405f52b512e479a46fc76108580b7bc
+SHA1 (patch-bb) = 5d3d034a9ac0f7f35cd5dc9a8f5814f5cb3e42dc
SHA1 (patch-dd) = 32661203ba023bea67cd7cde1f4088f4d0e5c582
SHA1 (patch-de) = 225eaa996fccc02b17be0099d943c75302600ada
SHA1 (patch-dk) = 5538bebc08b0047e501469f9cb306cb798d0eb00
diff -urN ../qemu/patches/patch-au ./patches/patch-au
--- ../qemu/patches/patch-au 1970-01-01 07:00:00.000000000 +0700
+++ ./patches/patch-au 2010-04-09 11:52:39.000000000 +0700
@@ -0,0 +1,39 @@
+$NetBSD$
+
+--- fpu/softfloat-native.h.orig 2010-02-23 20:54:38.000000000 +0000
++++ fpu/softfloat-native.h 2010-04-09 04:51:33.000000000 +0000
+@@ -23,7 +23,8 @@
+ #if defined(CONFIG_SOLARIS) && \
+ ((CONFIG_SOLARIS_VERSION <= 9 ) || \
+ ((CONFIG_SOLARIS_VERSION >= 10) && (__GNUC__ < 4))) \
+- || (defined(__OpenBSD__) && (OpenBSD < 200811))
++ || (defined(__OpenBSD__) && (OpenBSD < 200811)) \
++ || (defined(__NetBSD__))
+ /*
+ * C99 7.12.3 classification macros
+ * and
+@@ -52,10 +53,8 @@
+ #ifndef isunordered
+ #define isunordered(x, y) __builtin_isunordered(x, y)
+ #endif
+-#endif
+-
++#else
+
+-#define isnormal(x) (fpclass(x) >= FP_NZERO)
+ #define isgreater(x, y) ((!unordered(x, y)) && ((x) > (y)))
+ #define isgreaterequal(x, y) ((!unordered(x, y)) && ((x) >= (y)))
+ #define isless(x, y) ((!unordered(x, y)) && ((x) < (y)))
+@@ -63,6 +62,12 @@
+ #define isunordered(x,y) unordered(x, y)
+ #endif
+
++#ifndef isnormal
++#define isnormal(x) (fpclass(x) >= FP_NZERO)
++#endif
++
++#endif
++
+ #if defined(__sun__) && !defined(CONFIG_NEEDS_LIBSUNMATH)
+
+ #ifndef isnan
diff -urN ../qemu/patches/patch-bb ./patches/patch-bb
--- ../qemu/patches/patch-bb 1970-01-01 07:00:00.000000000 +0700
+++ ./patches/patch-bb 2010-04-09 13:20:48.000000000 +0700
@@ -0,0 +1,19 @@
+$NetBSD$
+
+--- pc-bios/optionrom/signrom.sh.orig 2010-02-23 20:54:38.000000000 +0000
++++ pc-bios/optionrom/signrom.sh 2010-04-09 06:18:25.000000000 +0000
+@@ -26,12 +26,12 @@
+ sum=0
+
+ # find out the file size
+-x=`dd if="$1" bs=1 count=1 skip=2 2>/dev/null | od -t u1 -A n`
++x=`dd if="$1" bs=1 count=1 skip=2 2>/dev/null | od -t u1 | sed -e 's/^[0-9]*
*//' -e 's/^00*\([0-9]\)/\1/'`
+ #size=`expr $x \* 512 - 1`
+ size=$(( $x * 512 - 1 ))
+
+ # now get the checksum
+-nums=`od -A n -t u1 -v "$1"`
++nums=`od -t u1 -v "$1" | sed -e 's/^[0-9]* *//' -e 's/^00*\([0-9]\)/\1/' -e
's/ 00*\([0-9]\)/ \1/g'`
+ for i in ${nums}; do
+ # add each byte's value to sum
+ sum=`expr $sum + $i`
Home |
Main Index |
Thread Index |
Old Index