mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 03:30:05 +02:00
qemu: Update to 2.1.0 port that includes Haiku native backend.
This commit is contained in:
@@ -1,247 +0,0 @@
|
||||
From 5a9ff734d38b382f532b485f68dc84a3ab361549 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Sun, 31 Aug 2014 11:17:41 +0000
|
||||
Subject: haiku patch
|
||||
|
||||
|
||||
diff --git a/main-loop.c b/main-loop.c
|
||||
index 3cc79f8..f33839b 100644
|
||||
--- a/main-loop.c
|
||||
+++ b/main-loop.c
|
||||
@@ -81,7 +81,9 @@ static int qemu_signal_init(void)
|
||||
*/
|
||||
sigemptyset(&set);
|
||||
sigaddset(&set, SIG_IPI);
|
||||
+#ifndef __HAIKU__
|
||||
sigaddset(&set, SIGIO);
|
||||
+#endif
|
||||
sigaddset(&set, SIGALRM);
|
||||
sigaddset(&set, SIGBUS);
|
||||
pthread_sigmask(SIG_BLOCK, &set, NULL);
|
||||
diff --git a/os-posix.c b/os-posix.c
|
||||
index cb2a7f7..ae5b02c 100644
|
||||
--- a/os-posix.c
|
||||
+++ b/os-posix.c
|
||||
@@ -334,6 +334,9 @@ bool is_daemonized(void)
|
||||
|
||||
int os_mlock(void)
|
||||
{
|
||||
+#ifdef __HAIKU__
|
||||
+ return ENOSYS;
|
||||
+#else
|
||||
int ret = 0;
|
||||
|
||||
ret = mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
@@ -342,4 +345,5 @@ int os_mlock(void)
|
||||
}
|
||||
|
||||
return ret;
|
||||
+#endif
|
||||
}
|
||||
diff --git a/target-xtensa/xtensa-semi.c b/target-xtensa/xtensa-semi.c
|
||||
index 16e9d8c..d6f49c5 100644
|
||||
--- a/target-xtensa/xtensa-semi.c
|
||||
+++ b/target-xtensa/xtensa-semi.c
|
||||
@@ -95,59 +95,53 @@ enum {
|
||||
|
||||
static uint32_t errno_h2g(int host_errno)
|
||||
{
|
||||
- static const uint32_t guest_errno[] = {
|
||||
- [EPERM] = TARGET_EPERM,
|
||||
- [ENOENT] = TARGET_ENOENT,
|
||||
- [ESRCH] = TARGET_ESRCH,
|
||||
- [EINTR] = TARGET_EINTR,
|
||||
- [EIO] = TARGET_EIO,
|
||||
- [ENXIO] = TARGET_ENXIO,
|
||||
- [E2BIG] = TARGET_E2BIG,
|
||||
- [ENOEXEC] = TARGET_ENOEXEC,
|
||||
- [EBADF] = TARGET_EBADF,
|
||||
- [ECHILD] = TARGET_ECHILD,
|
||||
- [EAGAIN] = TARGET_EAGAIN,
|
||||
- [ENOMEM] = TARGET_ENOMEM,
|
||||
- [EACCES] = TARGET_EACCES,
|
||||
- [EFAULT] = TARGET_EFAULT,
|
||||
+ switch (host_errno) {
|
||||
+ case 0: return 0;
|
||||
+ case EPERM: return TARGET_EPERM;
|
||||
+ case ENOENT: return TARGET_ENOENT;
|
||||
+ case ESRCH: return TARGET_ESRCH;
|
||||
+ case EINTR: return TARGET_EINTR;
|
||||
+ case EIO: return TARGET_EIO;
|
||||
+ case ENXIO: return TARGET_ENXIO;
|
||||
+ case E2BIG: return TARGET_E2BIG;
|
||||
+ case ENOEXEC: return TARGET_ENOEXEC;
|
||||
+ case EBADF: return TARGET_EBADF;
|
||||
+ case ECHILD: return TARGET_ECHILD;
|
||||
+ case EAGAIN: return TARGET_EAGAIN;
|
||||
+ case ENOMEM: return TARGET_ENOMEM;
|
||||
+ case EACCES: return TARGET_EACCES;
|
||||
+ case EFAULT: return TARGET_EFAULT;
|
||||
#ifdef ENOTBLK
|
||||
- [ENOTBLK] = TARGET_ENOTBLK,
|
||||
+ case ENOTBLK: return TARGET_ENOTBLK;
|
||||
#endif
|
||||
- [EBUSY] = TARGET_EBUSY,
|
||||
- [EEXIST] = TARGET_EEXIST,
|
||||
- [EXDEV] = TARGET_EXDEV,
|
||||
- [ENODEV] = TARGET_ENODEV,
|
||||
- [ENOTDIR] = TARGET_ENOTDIR,
|
||||
- [EISDIR] = TARGET_EISDIR,
|
||||
- [EINVAL] = TARGET_EINVAL,
|
||||
- [ENFILE] = TARGET_ENFILE,
|
||||
- [EMFILE] = TARGET_EMFILE,
|
||||
- [ENOTTY] = TARGET_ENOTTY,
|
||||
+ case EBUSY: return TARGET_EBUSY;
|
||||
+ case EEXIST: return TARGET_EEXIST;
|
||||
+ case EXDEV: return TARGET_EXDEV;
|
||||
+ case ENODEV: return TARGET_ENODEV;
|
||||
+ case ENOTDIR: return TARGET_ENOTDIR;
|
||||
+ case EISDIR: return TARGET_EISDIR;
|
||||
+ case EINVAL: return TARGET_EINVAL;
|
||||
+ case ENFILE: return TARGET_ENFILE;
|
||||
+ case EMFILE: return TARGET_EMFILE;
|
||||
+ case ENOTTY: return TARGET_ENOTTY;
|
||||
#ifdef ETXTBSY
|
||||
- [ETXTBSY] = TARGET_ETXTBSY,
|
||||
+ case ETXTBSY: return TARGET_ETXTBSY;
|
||||
#endif
|
||||
- [EFBIG] = TARGET_EFBIG,
|
||||
- [ENOSPC] = TARGET_ENOSPC,
|
||||
- [ESPIPE] = TARGET_ESPIPE,
|
||||
- [EROFS] = TARGET_EROFS,
|
||||
- [EMLINK] = TARGET_EMLINK,
|
||||
- [EPIPE] = TARGET_EPIPE,
|
||||
- [EDOM] = TARGET_EDOM,
|
||||
- [ERANGE] = TARGET_ERANGE,
|
||||
- [ENOSYS] = TARGET_ENOSYS,
|
||||
+ case EFBIG: return TARGET_EFBIG;
|
||||
+ case ENOSPC: return TARGET_ENOSPC;
|
||||
+ case ESPIPE: return TARGET_ESPIPE;
|
||||
+ case EROFS: return TARGET_EROFS;
|
||||
+ case EMLINK: return TARGET_EMLINK;
|
||||
+ case EPIPE: return TARGET_EPIPE;
|
||||
+ case EDOM: return TARGET_EDOM;
|
||||
+ case ERANGE: return TARGET_ERANGE;
|
||||
+ case ENOSYS: return TARGET_ENOSYS;
|
||||
#ifdef ELOOP
|
||||
- [ELOOP] = TARGET_ELOOP,
|
||||
+ case ELOOP: return TARGET_ELOOP;
|
||||
#endif
|
||||
};
|
||||
|
||||
- if (host_errno == 0) {
|
||||
- return 0;
|
||||
- } else if (host_errno > 0 && host_errno < ARRAY_SIZE(guest_errno) &&
|
||||
- guest_errno[host_errno]) {
|
||||
- return guest_errno[host_errno];
|
||||
- } else {
|
||||
- return TARGET_EINVAL;
|
||||
- }
|
||||
+ return TARGET_EINVAL;
|
||||
}
|
||||
|
||||
void HELPER(simcall)(CPUXtensaState *env)
|
||||
diff --git a/util/compatfd.c b/util/compatfd.c
|
||||
index 341ada6..e50416d 100644
|
||||
--- a/util/compatfd.c
|
||||
+++ b/util/compatfd.c
|
||||
@@ -17,7 +17,9 @@
|
||||
#include "qemu/compatfd.h"
|
||||
#include "qemu/thread.h"
|
||||
|
||||
+#ifndef __HAIKU__
|
||||
#include <sys/syscall.h>
|
||||
+#endif
|
||||
|
||||
struct sigfd_compat_info
|
||||
{
|
||||
diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c
|
||||
index 4c53211..d7c43c4 100644
|
||||
--- a/util/qemu-openpty.c
|
||||
+++ b/util/qemu-openpty.c
|
||||
@@ -35,7 +35,9 @@
|
||||
#include "config-host.h"
|
||||
#include "qemu-common.h"
|
||||
|
||||
-#if defined(__GLIBC__)
|
||||
+#if defined(__HAIKU__)
|
||||
+# include <termios.h>
|
||||
+#elif defined(__GLIBC__)
|
||||
# include <pty.h>
|
||||
#elif defined CONFIG_BSD
|
||||
# include <termios.h>
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
|
||||
From e0895f808d4c77cc8630d657eef0275d8e3d7333 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Sun, 31 Aug 2014 11:23:00 +0000
|
||||
Subject: sys/signal.h =>
|
||||
|
||||
|
||||
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
|
||||
index cdbfb2e..6779c03 100644
|
||||
--- a/util/oslib-posix.c
|
||||
+++ b/util/oslib-posix.c
|
||||
@@ -60,7 +60,7 @@ extern int daemon(int, int);
|
||||
#include <sys/mman.h>
|
||||
#include <libgen.h>
|
||||
#include <setjmp.h>
|
||||
-#include <sys/signal.h>
|
||||
+#include <signal.h>
|
||||
|
||||
#ifdef CONFIG_LINUX
|
||||
#include <sys/syscall.h>
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
|
||||
From f832224f8dc050d8bab5cf71bd4a358d3b3f27bb Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Mon, 1 Sep 2014 07:28:08 +0000
|
||||
Subject: we use libbsd instead of libutil
|
||||
|
||||
|
||||
diff --git a/tests/Makefile b/tests/Makefile
|
||||
index 4b2e1bb..ac248d0 100644
|
||||
--- a/tests/Makefile
|
||||
+++ b/tests/Makefile
|
||||
@@ -341,7 +341,7 @@ tests/qemu-iotests/socket_scm_helper$(EXESUF): tests/qemu-iotests/socket_scm_hel
|
||||
tests/test-qemu-opts$(EXESUF): tests/test-qemu-opts.o libqemuutil.a libqemustub.a
|
||||
|
||||
ifeq ($(CONFIG_POSIX),y)
|
||||
-LIBS += -lutil
|
||||
+LIBS += -lbsd
|
||||
endif
|
||||
|
||||
# QTest rules
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
|
||||
From c2ca444897e667046f3c266feb7489317f27d403 Mon Sep 17 00:00:00 2001
|
||||
From: Jerome Duval <jerome.duval@gmail.com>
|
||||
Date: Sat, 6 Sep 2014 20:35:22 +0000
|
||||
Subject: adapt configure for x86_64
|
||||
|
||||
* define _POSIX_C_SOURCE for memalign
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index f7685b5..3c063fb 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -659,8 +659,9 @@ AIX)
|
||||
;;
|
||||
Haiku)
|
||||
haiku="yes"
|
||||
+ CFLAGS="$CFLAGS -D_POSIX_C_SOURCE"
|
||||
QEMU_CFLAGS="-DB_USE_POSITIVE_POSIX_ERRORS $QEMU_CFLAGS"
|
||||
- LIBS="-lposix_error_mapper -lnetwork $LIBS"
|
||||
+ LIBS="-lposix_error_mapper -lnetwork -lbsd $LIBS"
|
||||
;;
|
||||
*)
|
||||
audio_drv_list="oss"
|
||||
--
|
||||
1.8.3.4
|
||||
|
||||
@@ -7,11 +7,10 @@ different machine (e.g. your own PC). By using dynamic translation, it \
|
||||
achieves very good performance.
|
||||
"
|
||||
HOMEPAGE="http://wiki.qemu.org/"
|
||||
SRC_URI="http://wiki.qemu-project.org/download/qemu-$portVersion.tar.bz2"
|
||||
CHECKSUM_SHA256="397e23184f4bf613589a8fe0c6542461dc2afdf17ed337e97e6fd2f31e8f8802"
|
||||
SRC_URI="git+https://github.com/mmlr/qemu-haiku.git#4444401842251c18147f83c7d960ec3a82f2b9cb"
|
||||
COPYRIGHT="2003-2014 Fabrice Bellard"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="2"
|
||||
REVISION="3"
|
||||
ARCHITECTURES="x86 x86_64"
|
||||
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
|
||||
# x86_gcc2 is fine as primary target architecture as long as we're building
|
||||
@@ -54,14 +53,11 @@ PROVIDES="
|
||||
cmd:qemu_system_xtensaeb$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
|
||||
PATCHES="qemu-$portVersion.patchset"
|
||||
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix >= $haikuVersion
|
||||
lib:libz$secondaryArchSuffix
|
||||
lib:libintl$secondaryArchSuffix
|
||||
lib:libstdc++$secondaryArchSuffix
|
||||
lib:libsdl$secondaryArchSuffix
|
||||
lib:libglib_2.0$secondaryArchSuffix >= 0.38
|
||||
lib:libpixman_1$secondaryArchSuffix
|
||||
"
|
||||
@@ -69,7 +65,6 @@ REQUIRES="
|
||||
BUILD_REQUIRES="
|
||||
devel:libz$secondaryArchSuffix
|
||||
devel:libfdt$secondaryArchSuffix
|
||||
devel:libsdl$secondaryArchSuffix
|
||||
devel:libglib_2.0$secondaryArchSuffix >= 0.38
|
||||
devel:libpixman_1${secondaryArchSuffix}
|
||||
"
|
||||
@@ -100,5 +95,5 @@ INSTALL()
|
||||
ln -s qemu-system-i386 $binDir/qemu
|
||||
|
||||
# Remove empty config file.
|
||||
rm $settingsDir/qemu/target-x86_64.conf
|
||||
rm $settingsDir/target-x86_64.conf
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user