Browse Source

qemu: fix building on mips arch

Add fallback zero value definition for MAP_SYNC etc. even when building
for CONFIG_LINUX.

Fixes openwrt/packages#11067

Reported-by: Rosen Penev <rosenp@gmail.com>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
lilik-openwrt-22.03
Yousong Zhou 5 years ago
parent
commit
47d9bf8418
7 changed files with 57 additions and 9 deletions
  1. +1
    -1
      utils/qemu/Makefile
  2. +1
    -1
      utils/qemu/patches/0001-configure-allow-disable-fortify_source.patch
  3. +1
    -2
      utils/qemu/patches/0002-configure-allow-enabling-disabling-libudev-from-comm.patch
  4. +2
    -2
      utils/qemu/patches/0003-configure-enable-guest_agent-no-matter-whether-softm.patch
  5. +1
    -1
      utils/qemu/patches/0004-disas-fix-compilation-failure-when-isnan-is-a-macro.patch
  6. +1
    -2
      utils/qemu/patches/0005-pc-bios-fix-compilation-when-AS-is-actually-gcc-driv.patch
  7. +50
    -0
      utils/qemu/patches/0006-util-mmap-alloc-fix-missing-MAP_SYNC.patch

+ 1
- 1
utils/qemu/Makefile View File

@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=qemu PKG_NAME:=qemu
PKG_VERSION:=4.2.0 PKG_VERSION:=4.2.0
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=d3481d4108ce211a053ef15be69af1bdd9dde1510fda80d92be0f6c3e98768f0 PKG_HASH:=d3481d4108ce211a053ef15be69af1bdd9dde1510fda80d92be0f6c3e98768f0
PKG_SOURCE_URL:=http://download.qemu.org/ PKG_SOURCE_URL:=http://download.qemu.org/


+ 1
- 1
utils/qemu/patches/0001-configure-allow-disable-fortify_source.patch View File

@ -1,7 +1,7 @@
From d4fcdea769a4629c874ebe1801d83e854c94d5e4 Mon Sep 17 00:00:00 2001 From d4fcdea769a4629c874ebe1801d83e854c94d5e4 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com> From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Sat, 24 Feb 2018 13:43:19 +0800 Date: Sat, 24 Feb 2018 13:43:19 +0800
Subject: [PATCH 1/5] configure: allow disable fortify_source
Subject: [PATCH] configure: allow disable fortify_source
Tell build system of qemu to not add _FORTIFY_SOURCE options and let the Tell build system of qemu to not add _FORTIFY_SOURCE options and let the
OpenWrt base build system decide flavor of fortify_source to use OpenWrt base build system decide flavor of fortify_source to use


+ 1
- 2
utils/qemu/patches/0002-configure-allow-enabling-disabling-libudev-from-comm.patch View File

@ -1,8 +1,7 @@
From 2a6ab8342245c8dc2a09478d8eb0292e2dbcecf2 Mon Sep 17 00:00:00 2001 From 2a6ab8342245c8dc2a09478d8eb0292e2dbcecf2 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com> From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Tue, 2 Apr 2019 06:31:31 +0000 Date: Tue, 2 Apr 2019 06:31:31 +0000
Subject: [PATCH 2/5] configure: allow enabling/disabling libudev from command
line
Subject: [PATCH] configure: allow enabling/disabling libudev from command line
--- ---
configure | 4 ++++ configure | 4 ++++


+ 2
- 2
utils/qemu/patches/0003-configure-enable-guest_agent-no-matter-whether-softm.patch View File

@ -1,8 +1,8 @@
From 296215421441b73bc6eb487f1d4e7e15e0510a77 Mon Sep 17 00:00:00 2001 From 296215421441b73bc6eb487f1d4e7e15e0510a77 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com> From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Fri, 7 Feb 2020 03:02:44 +0800 Date: Fri, 7 Feb 2020 03:02:44 +0800
Subject: [PATCH 3/5] configure: enable guest_agent no matter whether softmmu
is enabled
Subject: [PATCH] configure: enable guest_agent no matter whether softmmu is
enabled
guest_agent as a tool to be run on guest machines does not depend on guest_agent as a tool to be run on guest machines does not depend on
whether there is a softmmu is to be built at this configure/make run whether there is a softmmu is to be built at this configure/make run


+ 1
- 1
utils/qemu/patches/0004-disas-fix-compilation-failure-when-isnan-is-a-macro.patch View File

@ -1,7 +1,7 @@
From 3ac531a6bdeecbe40741a76f1dc2b7fa6c11f8ef Mon Sep 17 00:00:00 2001 From 3ac531a6bdeecbe40741a76f1dc2b7fa6c11f8ef Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com> From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Sat, 24 Feb 2018 13:45:25 +0800 Date: Sat, 24 Feb 2018 13:45:25 +0800
Subject: [PATCH 4/5] disas: fix compilation failure when isnan is a macro
Subject: [PATCH] disas: fix compilation failure when isnan is a macro
--- ---
disas/libvixl/vixl/utils.h | 16 +++++++++++----- disas/libvixl/vixl/utils.h | 16 +++++++++++-----


+ 1
- 2
utils/qemu/patches/0005-pc-bios-fix-compilation-when-AS-is-actually-gcc-driv.patch View File

@ -1,8 +1,7 @@
From b6223a90ebbb5729e41b4fcb3bc9ac309ec04784 Mon Sep 17 00:00:00 2001 From b6223a90ebbb5729e41b4fcb3bc9ac309ec04784 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com> From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Sat, 24 Feb 2018 13:46:31 +0800 Date: Sat, 24 Feb 2018 13:46:31 +0800
Subject: [PATCH 5/5] pc-bios: fix compilation when $(AS) is actually gcc
driver
Subject: [PATCH] pc-bios: fix compilation when $(AS) is actually gcc driver
--- ---
pc-bios/optionrom/Makefile | 4 ++-- pc-bios/optionrom/Makefile | 4 ++--


+ 50
- 0
utils/qemu/patches/0006-util-mmap-alloc-fix-missing-MAP_SYNC.patch View File

@ -0,0 +1,50 @@
From f385b623c14b5208df88b0be479a9ab30ab68c72 Mon Sep 17 00:00:00 2001
From: Yousong Zhou <yszhou4tech@gmail.com>
Date: Mon, 30 Mar 2020 12:48:58 +0800
Subject: [PATCH] util/mmap-alloc: fix missing MAP_SYNC
Quote musl-libc commit 9b57db3f958 ("add MAP_SYNC and
MAP_SHARED_VALIDATE from linux v4.15")
> for synchronous page faults, new in linux commit
> 1c9725974074a047f6080eecc62c50a8e840d050 and
> b6fb293f2497a9841d94f6b57bd2bb2cd222da43
> note that only targets that use asm-generic/mman.h have this new
> flag defined, so undef it on other targets (mips*, powerpc*).
Fixes 119906afa5c ("util/mmap-alloc: support MAP_SYNC in
qemu_ram_mmap()")
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
---
util/mmap-alloc.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/util/mmap-alloc.c b/util/mmap-alloc.c
index 27dcccd8ec..e133e38d21 100644
--- a/util/mmap-alloc.c
+++ b/util/mmap-alloc.c
@@ -12,9 +12,6 @@
#ifdef CONFIG_LINUX
#include <linux/mman.h>
-#else /* !CONFIG_LINUX */
-#define MAP_SYNC 0x0
-#define MAP_SHARED_VALIDATE 0x0
#endif /* CONFIG_LINUX */
#include "qemu/osdep.h"
@@ -27,6 +24,13 @@
#include <sys/vfs.h>
#endif
+#ifndef MAP_SYNC
+#define MAP_SYNC 0x0
+#endif
+#ifndef MAP_SHARED_VALIDATE
+#define MAP_SHARED_VALIDATE 0x0
+#endif
+
size_t qemu_fd_getpagesize(int fd)
{
#ifdef CONFIG_LINUX

Loading…
Cancel
Save