update buildroot to 2017.02.11
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
From d3f1e7e9ff9aae3f770b0bcb9aa3c2f787f76a1b Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
Date: Fri, 5 May 2017 09:07:15 +0200
|
||||
Subject: [PATCH] user-exec: fix usage of mcontext structure on ARM/uClibc
|
||||
|
||||
user-exec.c has some conditional code to decide how to use the
|
||||
mcontext structure. Unfortunately, since uClibc defines __GLIBC__, but
|
||||
with old versions of __GLIBC__ and __GLIBC_MINOR__, an old code path
|
||||
gets used, which doesn't apply to uClibc.
|
||||
|
||||
Fix this by excluding __UCLIBC__, which ensures we fall back to the
|
||||
general case of using uc_mcontext.arm_pc, which works fine with
|
||||
uClibc.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
---
|
||||
user-exec.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/user-exec.c b/user-exec.c
|
||||
index 6db0758..2b3d116 100644
|
||||
--- a/user-exec.c
|
||||
+++ b/user-exec.c
|
||||
@@ -409,7 +409,7 @@ int cpu_signal_handler(int host_signum, void *pinfo,
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
pc = uc->uc_mcontext.__gregs[_REG_R15];
|
||||
-#elif defined(__GLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
|
||||
+#elif defined(__GLIBC__) && !defined(__UCLIBC__) && (__GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ <= 3))
|
||||
pc = uc->uc_mcontext.gregs[R15];
|
||||
#else
|
||||
pc = uc->uc_mcontext.arm_pc;
|
||||
--
|
||||
2.7.4
|
||||
|
||||
120
bsp/buildroot-2017.02.11/package/qemu/Config.in
Normal file
120
bsp/buildroot-2017.02.11/package/qemu/Config.in
Normal file
@@ -0,0 +1,120 @@
|
||||
config BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET
|
||||
bool
|
||||
# Only tested on these architectures
|
||||
default y if BR2_aarch64 || BR2_i386 || BR2_mips || BR2_mipsel \
|
||||
|| BR2_x86_64 || BR2_arm \
|
||||
|| BR2_powerpc64 || BR2_powerpc64le
|
||||
|
||||
comment "QEMU requires a toolchain with wchar, threads"
|
||||
depends on BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET
|
||||
depends on BR2_USE_MMU
|
||||
depends on !(BR2_TOOLCHAIN_HAS_THREADS && BR2_USE_WCHAR)
|
||||
|
||||
config BR2_PACKAGE_QEMU
|
||||
bool "QEMU"
|
||||
depends on BR2_PACKAGE_QEMU_ARCH_SUPPORTS_TARGET
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
depends on BR2_USE_WCHAR # gettext
|
||||
depends on BR2_USE_MMU # fork()
|
||||
select BR2_PACKAGE_LIBGLIB2
|
||||
select BR2_PACKAGE_PIXMAN
|
||||
select BR2_PACKAGE_ZLIB
|
||||
help
|
||||
QEMU is a generic and open source machine emulator and virtualizer.
|
||||
|
||||
When used as a machine emulator, 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.
|
||||
|
||||
When used as a virtualizer, QEMU achieves near native performances
|
||||
by executing the guest code directly on the host CPU. QEMU supports
|
||||
virtualization when executing under the Xen hypervisor or using the
|
||||
KVM kernel module in Linux. When using KVM, QEMU can virtualize x86,
|
||||
server and embedded PowerPC, and S390 guests.
|
||||
|
||||
http://qemu.org/
|
||||
|
||||
if BR2_PACKAGE_QEMU
|
||||
|
||||
comment "Emulators selection"
|
||||
|
||||
config BR2_PACKAGE_QEMU_CUSTOM_TARGETS
|
||||
string "Enable specific targets"
|
||||
help
|
||||
Enter here the list of QEMU targets you want to build. For example:
|
||||
|
||||
System emulation | User-land emulation
|
||||
----------------------+-----------------------
|
||||
i386-softmmu | i386-linux-user
|
||||
arm-softmmu | ppc-linux-user
|
||||
x86_64-softmmu | sparc-bsd-user
|
||||
... | ...
|
||||
|
||||
config QEMU_FOO
|
||||
bool # To break the indentation
|
||||
|
||||
if BR2_PACKAGE_QEMU_CUSTOM_TARGETS = ""
|
||||
|
||||
comment "... or you can select emulator families to enable, below:"
|
||||
|
||||
config BR2_PACKAGE_QEMU_SYSTEM
|
||||
bool "Enable all systems emulation"
|
||||
depends on !BR2_STATIC_LIBS # dtc
|
||||
select BR2_PACKAGE_QEMU_FDT
|
||||
help
|
||||
Say 'y' to build all system emulators/virtualisers that QEMU supports.
|
||||
|
||||
comment "systems emulation needs a toolchain w/ dynamic library"
|
||||
depends on BR2_STATIC_LIBS
|
||||
|
||||
config BR2_PACKAGE_QEMU_LINUX_USER
|
||||
bool "Enable all Linux user-land emulation"
|
||||
# Incompatible "struct sigevent" definition on musl
|
||||
depends on !BR2_TOOLCHAIN_USES_MUSL
|
||||
help
|
||||
Say 'y' to build all Linux user-land emulators that QEMU supports.
|
||||
|
||||
# Note: bsd-user can not be build on Linux
|
||||
|
||||
comment "Linux user-land emulation needs a glibc or uClibc toolchain"
|
||||
depends on BR2_TOOLCHAIN_USES_MUSL
|
||||
|
||||
endif # BR2_PACKAGE_QEMU_CUSTOM_TARGETS == ""
|
||||
|
||||
config BR2_PACKAGE_QEMU_HAS_EMULS
|
||||
def_bool y
|
||||
depends on BR2_PACKAGE_QEMU_SYSTEM || BR2_PACKAGE_QEMU_LINUX_USER || BR2_PACKAGE_QEMU_CUSTOM_TARGETS != ""
|
||||
|
||||
if BR2_PACKAGE_QEMU_HAS_EMULS
|
||||
|
||||
comment "Frontends"
|
||||
|
||||
config BR2_PACKAGE_QEMU_SDL
|
||||
bool "Enable SDL frontend"
|
||||
select BR2_PACKAGE_SDL
|
||||
help
|
||||
Say 'y' to enable the SDL frontend, that is, a graphical window
|
||||
presenting the VM's display.
|
||||
|
||||
comment "Misc. features"
|
||||
|
||||
config BR2_PACKAGE_QEMU_FDT
|
||||
bool "Enable FDT"
|
||||
depends on !BR2_STATIC_LIBS # dtc
|
||||
select BR2_PACKAGE_DTC
|
||||
help
|
||||
Say 'y' here to have QEMU capable of constructing Device Trees,
|
||||
and passing them to the VMs.
|
||||
|
||||
comment "FDT support needs a toolchain w/ dynamic library"
|
||||
depends on BR2_STATIC_LIBS
|
||||
|
||||
endif # BR2_PACKAGE_QEMU_HAS_EMULS
|
||||
|
||||
config BR2_PACKAGE_QEMU_TOOLS
|
||||
bool "Enable tools"
|
||||
help
|
||||
Say 'y' here to include tools packaged with QEMU (e.g. qemu-img).
|
||||
|
||||
endif # BR2_PACKAGE_QEMU
|
||||
41
bsp/buildroot-2017.02.11/package/qemu/Config.in.host
Normal file
41
bsp/buildroot-2017.02.11/package/qemu/Config.in.host
Normal file
@@ -0,0 +1,41 @@
|
||||
config BR2_PACKAGE_HOST_QEMU
|
||||
bool "host qemu"
|
||||
select BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE \
|
||||
if !BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE
|
||||
depends on BR2_arm || BR2_armeb || BR2_aarch64 || \
|
||||
BR2_i386 || BR2_m68k || BR2_microblazeel || \
|
||||
BR2_microblazebe || BR2_mips || BR2_mipsel || \
|
||||
BR2_mips64 || BR2_mips64el || BR2_powerpc || \
|
||||
BR2_powerpc64 || BR2_powerpc64le || BR2_sh || \
|
||||
BR2_sparc || BR2_x86_64
|
||||
help
|
||||
QEMU is a generic and open source machine emulator and virtualizer.
|
||||
|
||||
This option builds an emulator for your selected architecture.
|
||||
|
||||
http://www.qemu.org
|
||||
|
||||
if BR2_PACKAGE_HOST_QEMU
|
||||
|
||||
comment "Emulators selection"
|
||||
|
||||
config BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE
|
||||
bool "Enable system emulation"
|
||||
help
|
||||
Enables the build of the system emulator, which allows to
|
||||
boot an entire system in Qemu.
|
||||
|
||||
config BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
|
||||
bool "Enable Linux user-land emulation"
|
||||
help
|
||||
Enables the build of the user-land emulator, which allows to
|
||||
run user-space applications.
|
||||
|
||||
config BR2_PACKAGE_HOST_QEMU_VDE2
|
||||
bool "VDE2 support"
|
||||
help
|
||||
Enables VDE2 support. VDE2 stands for Virtual Distributed
|
||||
Ethernet and can be used to create virtual switches to
|
||||
"plug" both physical and virtual machines in them.
|
||||
|
||||
endif
|
||||
2
bsp/buildroot-2017.02.11/package/qemu/qemu.hash
Normal file
2
bsp/buildroot-2017.02.11/package/qemu/qemu.hash
Normal file
@@ -0,0 +1,2 @@
|
||||
# Locally computed, tarball verified with GPG signature
|
||||
sha256 7b50634d729dcabe4a96d74062832274fa2f4c883e82904f5e6955f801edab54 qemu-2.8.1.1.tar.xz
|
||||
265
bsp/buildroot-2017.02.11/package/qemu/qemu.mk
Normal file
265
bsp/buildroot-2017.02.11/package/qemu/qemu.mk
Normal file
@@ -0,0 +1,265 @@
|
||||
################################################################################
|
||||
#
|
||||
# qemu
|
||||
#
|
||||
################################################################################
|
||||
|
||||
QEMU_VERSION = 2.8.1.1
|
||||
QEMU_SOURCE = qemu-$(QEMU_VERSION).tar.xz
|
||||
QEMU_SITE = http://download.qemu.org
|
||||
QEMU_LICENSE = GPLv2, LGPLv2.1, MIT, BSD-3c, BSD-2c, Others/BSD-1c
|
||||
QEMU_LICENSE_FILES = COPYING COPYING.LIB
|
||||
# NOTE: there is no top-level license file for non-(L)GPL licenses;
|
||||
# the non-(L)GPL license texts are specified in the affected
|
||||
# individual source files.
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# Host-qemu
|
||||
|
||||
HOST_QEMU_DEPENDENCIES = host-pkgconf host-python host-zlib host-libglib2 host-pixman
|
||||
|
||||
# BR ARCH qemu
|
||||
# ------- ----
|
||||
# arm arm
|
||||
# armeb armeb
|
||||
# bfin not supported
|
||||
# i486 i386
|
||||
# i586 i386
|
||||
# i686 i386
|
||||
# x86_64 x86_64
|
||||
# m68k m68k
|
||||
# microblaze microblaze
|
||||
# mips mips
|
||||
# mipsel mipsel
|
||||
# mips64 mips64
|
||||
# mips64el mips64el
|
||||
# powerpc ppc
|
||||
# powerpc64 ppc64
|
||||
# powerpc64le ppc64 (system) / ppc64le (usermode)
|
||||
# sh2a not supported
|
||||
# sh4 sh4
|
||||
# sh4eb sh4eb
|
||||
# sh4a sh4
|
||||
# sh4aeb sh4eb
|
||||
# sh64 not supported
|
||||
# sparc sparc
|
||||
|
||||
HOST_QEMU_ARCH = $(ARCH)
|
||||
ifeq ($(HOST_QEMU_ARCH),i486)
|
||||
HOST_QEMU_ARCH = i386
|
||||
endif
|
||||
ifeq ($(HOST_QEMU_ARCH),i586)
|
||||
HOST_QEMU_ARCH = i386
|
||||
endif
|
||||
ifeq ($(HOST_QEMU_ARCH),i686)
|
||||
HOST_QEMU_ARCH = i386
|
||||
endif
|
||||
ifeq ($(HOST_QEMU_ARCH),powerpc)
|
||||
HOST_QEMU_ARCH = ppc
|
||||
endif
|
||||
ifeq ($(HOST_QEMU_ARCH),powerpc64)
|
||||
HOST_QEMU_ARCH = ppc64
|
||||
endif
|
||||
ifeq ($(HOST_QEMU_ARCH),powerpc64le)
|
||||
HOST_QEMU_ARCH = ppc64le
|
||||
HOST_QEMU_SYS_ARCH = ppc64
|
||||
endif
|
||||
ifeq ($(HOST_QEMU_ARCH),sh4a)
|
||||
HOST_QEMU_ARCH = sh4
|
||||
endif
|
||||
ifeq ($(HOST_QEMU_ARCH),sh4aeb)
|
||||
HOST_QEMU_ARCH = sh4eb
|
||||
endif
|
||||
HOST_QEMU_SYS_ARCH ?= $(HOST_QEMU_ARCH)
|
||||
|
||||
ifeq ($(BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE),y)
|
||||
HOST_QEMU_TARGETS += $(HOST_QEMU_SYS_ARCH)-softmmu
|
||||
HOST_QEMU_OPTS += --enable-system --enable-fdt
|
||||
HOST_QEMU_DEPENDENCIES += host-dtc
|
||||
else
|
||||
HOST_QEMU_OPTS += --disable-system
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE),y)
|
||||
HOST_QEMU_TARGETS += $(HOST_QEMU_ARCH)-linux-user
|
||||
HOST_QEMU_OPTS += --enable-linux-user
|
||||
|
||||
HOST_QEMU_HOST_SYSTEM_TYPE = $(shell uname -s)
|
||||
ifneq ($(HOST_QEMU_HOST_SYSTEM_TYPE),Linux)
|
||||
$(error "qemu-user can only be used on Linux hosts")
|
||||
endif
|
||||
|
||||
# kernel version as major*256 + minor
|
||||
HOST_QEMU_HOST_SYSTEM_VERSION = $(shell uname -r | awk -F. '{ print $$1 * 256 + $$2 }')
|
||||
HOST_QEMU_TARGET_SYSTEM_VERSION = $(shell echo $(BR2_TOOLCHAIN_HEADERS_AT_LEAST) | awk -F. '{ print $$1 * 256 + $$2 }')
|
||||
HOST_QEMU_COMPARE_VERSION = $(shell test $(HOST_QEMU_HOST_SYSTEM_VERSION) -ge $(HOST_QEMU_TARGET_SYSTEM_VERSION) && echo OK)
|
||||
|
||||
#
|
||||
# The principle of qemu-user is that it emulates the instructions of
|
||||
# the target architecture when running the binary, and then when this
|
||||
# binary does a system call, it converts this system call into a
|
||||
# system call on the host machine. This mechanism makes an assumption:
|
||||
# that the target binary will not do system calls that do not exist on
|
||||
# the host. This basically requires that the target binary should be
|
||||
# built with kernel headers that are older or the same as the kernel
|
||||
# version running on the host machine.
|
||||
#
|
||||
|
||||
ifeq ($(BR_BUILDING),y)
|
||||
ifneq ($(HOST_QEMU_COMPARE_VERSION),OK)
|
||||
$(error "Refusing to build qemu-user: target Linux version newer than host's.")
|
||||
endif
|
||||
endif # BR_BUILDING
|
||||
|
||||
else # BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
|
||||
HOST_QEMU_OPTS += --disable-linux-user
|
||||
endif # BR2_PACKAGE_HOST_QEMU_LINUX_USER_MODE
|
||||
|
||||
ifeq ($(BR2_PACKAGE_HOST_QEMU_VDE2),y)
|
||||
HOST_QEMU_OPTS += --enable-vde
|
||||
HOST_QEMU_DEPENDENCIES += host-vde2
|
||||
endif
|
||||
|
||||
# Override CPP, as it expects to be able to call it like it'd
|
||||
# call the compiler.
|
||||
define HOST_QEMU_CONFIGURE_CMDS
|
||||
cd $(@D); $(HOST_CONFIGURE_OPTS) CPP="$(HOSTCC) -E" \
|
||||
./configure \
|
||||
--target-list="$(HOST_QEMU_TARGETS)" \
|
||||
--prefix="$(HOST_DIR)/usr" \
|
||||
--interp-prefix=$(STAGING_DIR) \
|
||||
--cc="$(HOSTCC)" \
|
||||
--host-cc="$(HOSTCC)" \
|
||||
--python=$(HOST_DIR)/usr/bin/python2 \
|
||||
--extra-cflags="$(HOST_CFLAGS)" \
|
||||
--extra-ldflags="$(HOST_LDFLAGS)" \
|
||||
$(HOST_QEMU_OPTS)
|
||||
endef
|
||||
|
||||
define HOST_QEMU_BUILD_CMDS
|
||||
$(HOST_MAKE_ENV) $(MAKE) -C $(@D)
|
||||
endef
|
||||
|
||||
define HOST_QEMU_INSTALL_CMDS
|
||||
$(HOST_MAKE_ENV) $(MAKE) -C $(@D) install
|
||||
endef
|
||||
|
||||
$(eval $(host-generic-package))
|
||||
|
||||
# variable used by other packages
|
||||
QEMU_USER = $(HOST_DIR)/usr/bin/qemu-$(HOST_QEMU_ARCH)
|
||||
|
||||
#-------------------------------------------------------------
|
||||
# Target-qemu
|
||||
|
||||
QEMU_DEPENDENCIES = host-pkgconf host-python libglib2 zlib pixman
|
||||
|
||||
# Need the LIBS variable because librt and libm are
|
||||
# not automatically pulled. :-(
|
||||
QEMU_LIBS = -lrt -lm
|
||||
|
||||
QEMU_OPTS =
|
||||
|
||||
QEMU_VARS = \
|
||||
LIBTOOL=$(HOST_DIR)/usr/bin/libtool \
|
||||
PYTHON=$(HOST_DIR)/usr/bin/python2 \
|
||||
PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
|
||||
|
||||
# If we want to specify only a subset of targets, we must still enable all
|
||||
# of them, so that QEMU properly builds its list of default targets, from
|
||||
# which it then checks if the specified sub-set is valid. That's what we
|
||||
# do in the first part of the if-clause.
|
||||
# Otherwise, if we do not want to pass a sub-set of targets, we then need
|
||||
# to either enable or disable -user and/or -system emulation appropriately.
|
||||
# That's what we do in the else-clause.
|
||||
ifneq ($(call qstrip,$(BR2_PACKAGE_QEMU_CUSTOM_TARGETS)),)
|
||||
QEMU_OPTS += --enable-system --enable-linux-user
|
||||
QEMU_OPTS += --target-list="$(call qstrip,$(BR2_PACKAGE_QEMU_CUSTOM_TARGETS))"
|
||||
else
|
||||
|
||||
ifeq ($(BR2_PACKAGE_QEMU_SYSTEM),y)
|
||||
QEMU_OPTS += --enable-system
|
||||
else
|
||||
QEMU_OPTS += --disable-system
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_QEMU_LINUX_USER),y)
|
||||
QEMU_OPTS += --enable-linux-user
|
||||
else
|
||||
QEMU_OPTS += --disable-linux-user
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_QEMU_SDL),y)
|
||||
QEMU_OPTS += --enable-sdl
|
||||
QEMU_DEPENDENCIES += sdl
|
||||
QEMU_VARS += SDL_CONFIG=$(BR2_STAGING_DIR)/usr/bin/sdl-config
|
||||
else
|
||||
QEMU_OPTS += --disable-sdl
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_QEMU_FDT),y)
|
||||
QEMU_OPTS += --enable-fdt
|
||||
QEMU_DEPENDENCIES += dtc
|
||||
else
|
||||
QEMU_OPTS += --disable-fdt
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PACKAGE_QEMU_TOOLS),y)
|
||||
QEMU_OPTS += --enable-tools
|
||||
else
|
||||
QEMU_OPTS += --disable-tools
|
||||
endif
|
||||
|
||||
# Override CPP, as it expects to be able to call it like it'd
|
||||
# call the compiler.
|
||||
define QEMU_CONFIGURE_CMDS
|
||||
( cd $(@D); \
|
||||
LIBS='$(QEMU_LIBS)' \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
$(TARGET_CONFIGURE_ARGS) \
|
||||
CPP="$(TARGET_CC) -E" \
|
||||
$(QEMU_VARS) \
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--cross-prefix=$(TARGET_CROSS) \
|
||||
--with-system-pixman \
|
||||
--audio-drv-list= \
|
||||
--enable-kvm \
|
||||
--enable-attr \
|
||||
--enable-vhost-net \
|
||||
--disable-bsd-user \
|
||||
--disable-xen \
|
||||
--disable-slirp \
|
||||
--disable-vnc \
|
||||
--disable-virtfs \
|
||||
--disable-brlapi \
|
||||
--disable-curses \
|
||||
--disable-curl \
|
||||
--disable-bluez \
|
||||
--disable-uuid \
|
||||
--disable-vde \
|
||||
--disable-linux-aio \
|
||||
--disable-cap-ng \
|
||||
--disable-docs \
|
||||
--disable-spice \
|
||||
--disable-rbd \
|
||||
--disable-libiscsi \
|
||||
--disable-usb-redir \
|
||||
--disable-strip \
|
||||
--disable-seccomp \
|
||||
--disable-sparse \
|
||||
$(QEMU_OPTS) \
|
||||
)
|
||||
endef
|
||||
|
||||
define QEMU_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)
|
||||
endef
|
||||
|
||||
define QEMU_INSTALL_TARGET_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(QEMU_MAKE_ENV) DESTDIR=$(TARGET_DIR) install
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
Reference in New Issue
Block a user