mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 11:40:06 +02:00
qemu: bump version (#1220)
* disabled stack-protector, and every non-x86 arch. aarch64 broken, but the other arches should work.
This commit is contained in:
248
app-emulation/qemu/patches/qemu-2.8.0.patchset
Normal file
248
app-emulation/qemu/patches/qemu-2.8.0.patchset
Normal file
@@ -0,0 +1,248 @@
|
||||
From 3f9885e579adb971b7d7c3a0512c420cf8eadc69 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Zolt=C3=A1n=20Mizsei?= <zmizsei@extrowerk.com>
|
||||
Date: Sun, 20 Nov 2016 14:04:51 +0100
|
||||
Subject: [PATCH] Haiku patches
|
||||
|
||||
---
|
||||
main-loop.c | 2 ++
|
||||
os-posix.c | 12 ++++++-
|
||||
target-mips/mips-semi.c | 4 +++
|
||||
target-xtensa/xtensa-semi.c | 84 +++++++++++++++++++++------------------------
|
||||
tests/Makefile.include | 2 +-
|
||||
util/compatfd.c | 2 ++
|
||||
util/oslib-posix.c | 2 ++
|
||||
util/qemu-openpty.c | 4 ++-
|
||||
8 files changed, 64 insertions(+), 48 deletions(-)
|
||||
|
||||
diff --git a/main-loop.c b/main-loop.c
|
||||
index 6a7f8d3..f84ad04 100644
|
||||
--- a/main-loop.c
|
||||
+++ b/main-loop.c
|
||||
@@ -83,7 +83,9 @@ static int qemu_signal_init(void)
|
||||
*/
|
||||
sigemptyset(&set);
|
||||
sigaddset(&set, SIG_IPI);
|
||||
+#ifdef SIGIO
|
||||
sigaddset(&set, SIGIO);
|
||||
+#endif
|
||||
sigaddset(&set, SIGALRM);
|
||||
sigaddset(&set, SIGBUS);
|
||||
/* SIGINT cannot be handled via signalfd, so that ^C can be used
|
||||
diff --git a/os-posix.c b/os-posix.c
|
||||
index c6ddb7d..ffbc08e 100644
|
||||
--- a/os-posix.c
|
||||
+++ b/os-posix.c
|
||||
@@ -43,6 +43,15 @@
|
||||
#include <sys/prctl.h>
|
||||
#endif
|
||||
|
||||
+#ifdef __HAIKU__
|
||||
+#ifndef MCL_CURRENT
|
||||
+#define MCL_CURRENT 8192
|
||||
+#endif
|
||||
+#ifndef MCL_FUTURE
|
||||
+#define MCL_FUTURE 16384
|
||||
+#endif
|
||||
+#endif
|
||||
+
|
||||
static struct passwd *user_pwd;
|
||||
static const char *chroot_dir;
|
||||
static int daemonize;
|
||||
@@ -330,11 +339,12 @@ bool is_daemonized(void)
|
||||
int os_mlock(void)
|
||||
{
|
||||
int ret = 0;
|
||||
-
|
||||
+#ifndef __HAIKU__
|
||||
ret = mlockall(MCL_CURRENT | MCL_FUTURE);
|
||||
if (ret < 0) {
|
||||
perror("mlockall");
|
||||
}
|
||||
+#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
diff --git a/target-mips/mips-semi.c b/target-mips/mips-semi.c
|
||||
index a7aefba..16c2336 100644
|
||||
--- a/target-mips/mips-semi.c
|
||||
+++ b/target-mips/mips-semi.c
|
||||
@@ -75,6 +75,7 @@ enum UHIOpenFlags {
|
||||
|
||||
/* Errno values taken from asm-mips/errno.h */
|
||||
static uint16_t host_to_mips_errno[] = {
|
||||
+#ifndef __HAIKU__
|
||||
[ENAMETOOLONG] = 78,
|
||||
#ifdef EOVERFLOW
|
||||
[EOVERFLOW] = 79,
|
||||
@@ -82,6 +83,9 @@ static uint16_t host_to_mips_errno[] = {
|
||||
#ifdef ELOOP
|
||||
[ELOOP] = 90,
|
||||
#endif
|
||||
+#else
|
||||
+NULL
|
||||
+#endif
|
||||
};
|
||||
|
||||
static int errno_mips(int err)
|
||||
diff --git a/target-xtensa/xtensa-semi.c b/target-xtensa/xtensa-semi.c
|
||||
index 370e365..74bd60e 100644
|
||||
--- a/target-xtensa/xtensa-semi.c
|
||||
+++ b/target-xtensa/xtensa-semi.c
|
||||
@@ -92,59 +92,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/tests/Makefile.include b/tests/Makefile.include
|
||||
index 14be491..0975898 100644
|
||||
--- a/tests/Makefile.include
|
||||
+++ b/tests/Makefile.include
|
||||
@@ -645,7 +645,7 @@ tests/migration/initrd-stress.img: tests/migration/stress$(EXESUF)
|
||||
rmdir $(INITRD_WORK_DIR)
|
||||
|
||||
ifeq ($(CONFIG_POSIX),y)
|
||||
-LIBS += -lutil
|
||||
+LIBS +=
|
||||
endif
|
||||
|
||||
# QTest rules
|
||||
diff --git a/util/compatfd.c b/util/compatfd.c
|
||||
index 9a43042..3ead6c5 100644
|
||||
--- a/util/compatfd.c
|
||||
+++ b/util/compatfd.c
|
||||
@@ -18,7 +18,9 @@
|
||||
#include "qemu/compatfd.h"
|
||||
#include "qemu/thread.h"
|
||||
|
||||
+#ifndef __HAIKU__
|
||||
#include <sys/syscall.h>
|
||||
+#endif
|
||||
|
||||
struct sigfd_compat_info
|
||||
{
|
||||
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
|
||||
index f2d4e9e..303b6df 100644
|
||||
--- a/util/oslib-posix.c
|
||||
+++ b/util/oslib-posix.c
|
||||
@@ -37,7 +37,9 @@
|
||||
#include "qapi/error.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include <libgen.h>
|
||||
+#ifndef __HAIKU__
|
||||
#include <sys/signal.h>
|
||||
+#endif
|
||||
#include "qemu/cutils.h"
|
||||
|
||||
#ifdef CONFIG_LINUX
|
||||
diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c
|
||||
index 2e8b43b..adcc732 100644
|
||||
--- a/util/qemu-openpty.c
|
||||
+++ b/util/qemu-openpty.c
|
||||
@@ -35,7 +35,9 @@
|
||||
#include "qemu/osdep.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>
|
||||
--
|
||||
2.10.2
|
||||
|
||||
133
app-emulation/qemu/qemu-2.8.0.recipe
Normal file
133
app-emulation/qemu/qemu-2.8.0.recipe
Normal file
@@ -0,0 +1,133 @@
|
||||
SUMMARY="A generic and open source machine emulator and virtualizer"
|
||||
DESCRIPTION="QEMU is a generic and open source machine emulator and virtualizer.
|
||||
|
||||
QEMU can run OSes and programs made for one machine (e.g. an ARM board) on a \
|
||||
different machine (e.g. your own PC). By using dynamic translation, it \
|
||||
achieves very good performance."
|
||||
HOMEPAGE="http://wiki.qemu.org/"
|
||||
COPYRIGHT="2003-2017 Fabrice Bellard"
|
||||
LICENSE="GNU GPL v2"
|
||||
REVISION="1"
|
||||
SOURCE_URI="https://github.com/qemu/qemu/archive/v$portVersion.tar.gz"
|
||||
CHECKSUM_SHA256="853bfc1058547660df9b8bbd38baab2803dbc62e50c660ec4af48e159976b92c"
|
||||
SOURCE_DIR="qemu-$portVersion"
|
||||
PATCHES="qemu-$portVersion.patchset"
|
||||
|
||||
ARCHITECTURES="!x86_gcc2 x86 x86_64"
|
||||
SECONDARY_ARCHITECTURES="x86"
|
||||
|
||||
PROVIDES="
|
||||
qemu$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_img$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_io$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_aarch64$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_alpha$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_arm$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_cris$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_i386$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_lm32$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_m68k$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_microblaze$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_microblazeel$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_mips$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_mips64$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_mips64el$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_mipsel$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_moxie$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_or32$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_ppc$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_ppc64$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_ppcemb$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_s390x$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_sh4$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_sh4eb$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_sparc$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_sparc64$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_unicore32$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_x86_64$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_xtensa$secondaryArchSuffix = $portVersion
|
||||
cmd:qemu_system_xtensaeb$secondaryArchSuffix = $portVersion
|
||||
"
|
||||
REQUIRES="
|
||||
haiku$secondaryArchSuffix
|
||||
lib:libbz2$secondaryArchSuffix
|
||||
lib:libcurl$secondaryArchSuffix
|
||||
lib:libfdt$secondaryArchSuffix
|
||||
#lib:libgcrypt$secondaryArchSuffix
|
||||
lib:libGL$secondaryArchSuffix
|
||||
lib:libglib_2.0$secondaryArchSuffix
|
||||
lib:libgnutls$secondaryArchSuffix
|
||||
lib:libintl$secondaryArchSuffix
|
||||
lib:libjpeg$secondaryArchSuffix
|
||||
lib:liblzo2$secondaryArchSuffix
|
||||
lib:libncursesw$secondaryArchSuffix
|
||||
lib:libnettle$secondaryArchSuffix
|
||||
lib:libpixman_1$secondaryArchSuffix
|
||||
lib:libpng16$secondaryArchSuffix
|
||||
lib:libsdl2$secondaryArchSuffix
|
||||
lib:libsnappy$secondaryArchSuffix
|
||||
lib:libssh2$secondaryArchSuffix
|
||||
lib:libtasn1$secondaryArchSuffix
|
||||
lib:libusb_1.0$secondaryArchSuffix
|
||||
lib:libz$secondaryArchSuffix
|
||||
"
|
||||
|
||||
BUILD_REQUIRES="
|
||||
devel:libbz2$secondaryArchSuffix
|
||||
devel:libcurl$secondaryArchSuffix
|
||||
devel:libfdt$secondaryArchSuffix
|
||||
#devel:libgcrypt$secondaryArchSuffix
|
||||
devel:libGL$secondaryArchSuffix
|
||||
devel:libglib_2.0$secondaryArchSuffix
|
||||
devel:libgnutls$secondaryArchSuffix
|
||||
devel:libintl$secondaryArchSuffix
|
||||
devel:libjpeg$secondaryArchSuffix
|
||||
devel:liblzo2$secondaryArchSuffix
|
||||
devel:libncursesw$secondaryArchSuffix
|
||||
devel:libnettle$secondaryArchSuffix
|
||||
devel:libpixman_1$secondaryArchSuffix
|
||||
devel:libpng16$secondaryArchSuffix
|
||||
devel:libsdl2$secondaryArchSuffix
|
||||
devel:libsnappy$secondaryArchSuffix
|
||||
devel:libssh2$secondaryArchSuffix
|
||||
devel:libtasn1$secondaryArchSuffix
|
||||
devel:libusb_1.0$secondaryArchSuffix
|
||||
devel:libz$secondaryArchSuffix
|
||||
"
|
||||
BUILD_PREREQUIRES="
|
||||
haiku${secondaryArchSuffix}_devel
|
||||
cmd:awk
|
||||
cmd:gcc$secondaryArchSuffix
|
||||
cmd:gcov$secondaryArchSuffix
|
||||
cmd:gprof$secondaryArchSuffix
|
||||
cmd:ld$secondaryArchSuffix
|
||||
cmd:make
|
||||
cmd:find
|
||||
cmd:pkg_config$secondaryArchSuffix
|
||||
cmd:pod2man
|
||||
cmd:python
|
||||
"
|
||||
|
||||
BUILD()
|
||||
{
|
||||
export CFLAGS="-lbsd -lnetwork"
|
||||
runConfigure --omit-buildspec ./configure \
|
||||
--disable-stack-protector \
|
||||
--target-list=i386-softmmu,x86_64-softmmu
|
||||
# remove the line above to get all the supported targets
|
||||
# aarch64-softmmu broken with --disable-stack-protector
|
||||
make $jobArgs
|
||||
}
|
||||
|
||||
INSTALL()
|
||||
{
|
||||
make install $jobArgs
|
||||
|
||||
# provide convenience symlink to just "qemu"
|
||||
if [ $effectiveTargetArchitecture == x86_64 ]; then
|
||||
ln -s qemu-system-x86_64 $binDir/qemu
|
||||
else
|
||||
ln -s qemu-system-i386 $binDir/qemu
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user