From 6ac3ed87d3b52f59e94997b8b134e2dd48c3e66c Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Tue, 1 May 2018 11:58:43 +1000 Subject: [PATCH] bare/devel: Add qemu-couverture support. Add a build set and configuration to build a QEMU we can use for coverage testing. --- bare/config/devel/qemu-couverture-git-1.cfg | 43 +++++++++++++++++ bare/config/devel/qemu-couverture.bset | 25 ++++++++++ source-builder/config/qemu-1-1.cfg | 51 +++++++++++++++++---- 3 files changed, 109 insertions(+), 10 deletions(-) create mode 100644 bare/config/devel/qemu-couverture-git-1.cfg create mode 100644 bare/config/devel/qemu-couverture.bset diff --git a/bare/config/devel/qemu-couverture-git-1.cfg b/bare/config/devel/qemu-couverture-git-1.cfg new file mode 100644 index 0000000..fc8daab --- /dev/null +++ b/bare/config/devel/qemu-couverture-git-1.cfg @@ -0,0 +1,43 @@ +# +# Qemu from git +# + +%if %{release} == %{nil} + %define release 1 +%endif + +%include %{_configdir}/base.cfg + +%include %{_configdir}/bare-config.cfg + +# +# Couverture QEMU Version. +# +%define qemu_version e9299f7591c8ecf3389922f4e7672b6bc5deae71 +%hash sha512 e9299f7591c8ecf3389922f4e7672b6bc5deae71.tar.gz b0479eefb8f067b97828b411b89c6b4ba4097477425a83b7ae439a3c0980c52cdbbbd2b7c85edb412ffe7f20b1822b65be008a989c815ceff72a493e551bbb78 + +# +# Couverture QEMU disables for this version. +# +%define qemu_disables --disable-virtfs --disable-gnutls --disable-docs + +# +# Couverture QEMU architectures for this version. +# +%define qemu_archs arm-softmmu,i386-softmmu,lm32-softmmu,mips-softmmu,ppc-softmmu,sparc-softmmu + +# +# Set Couverture-Qemu source from github. +# +%source set qemu https://github.com/AdaCore/qemu/archive/%{qemu_version}.tar.gz + +# +# Patch to send halt signal to qemu-system-or32 process when RTEMS terminates +# +%patch add qemu %{rtems_http_git}/rtems-tools/plain/tools/qemu/0001-openrisc-terminate-qemu-process-upon-receiving-a-hal.patch +%hash sha256 0001-openrisc-terminate-qemu-process-upon-receiving-a-hal.patch 88cd5c9e6e2a6bab23bf049a6f4212ff00083b002b73dbe63b2fe9832717f19e + +# +# The Qemu build instructions. We use 1.x.x Release 1. +# +%include %{_configdir}/qemu-1-1.cfg diff --git a/bare/config/devel/qemu-couverture.bset b/bare/config/devel/qemu-couverture.bset new file mode 100644 index 0000000..64024a1 --- /dev/null +++ b/bare/config/devel/qemu-couverture.bset @@ -0,0 +1,25 @@ +# +# Build set for QEMU-Couverture +# + +%define release 1 + +# +# Name of the package. +# +package: qemu-couverture-%{qemu_version}-%{_host}-%{release} + +# +# A magic internal path that would break if changes in the defaults.mc +# macro file are made. +# +%define _internal_autotools_path %{_tmppath}/sb-%{_uid}/${SB_PREFIX_CLEAN} + +devel/autotools-internal +devel/libiconv-1.14-1 +devel/gettext-0.18.3.1-1 +devel/libffi-3.0.13-1 +devel/pixman-0.32.4-1 +devel/glib-2.39.3-1 +devel/dtc-1.4.1-1 +devel/qemu-couverture-git-1 diff --git a/source-builder/config/qemu-1-1.cfg b/source-builder/config/qemu-1-1.cfg index c19419f..43af72e 100644 --- a/source-builder/config/qemu-1-1.cfg +++ b/source-builder/config/qemu-1-1.cfg @@ -28,6 +28,44 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) # %source set qemu http://wiki.qemu-project.org/download/qemu-%{qemu_version}.tar.bz2 + +# +# QEMU Disable component list. +# +# We are not interested in the VM use case for qemu and most of that +# functionality carries host platform baggage which complicates building on a +# range of host platforms. +# +# You can specialise before including this config file. +# +# +%define qemu_std_disables --disable-werror +%define qemu_std_disables %{qemu_std_disables} --disable-smartcard-nss +%define qemu_std_disables %{qemu_std_disables} --disable-tools +%define qemu_std_disables %{qemu_std_disables} --disable-pie +%define qemu_std_disables %{qemu_std_disables} --disable-vnc +%define qemu_std_disables %{qemu_std_disables} --disable-sdl +%define qemu_std_disables %{qemu_std_disables} --disable-gtk +%define qemu_std_disables %{qemu_std_disables} --disable-opengl +%define qemu_std_disables %{qemu_std_disables} --disable-netmap +%ifn %{defined qemu_disables} + %define qemu_disables %{nil} +%endif +%define qemu_disables %{qemu_std_disables} %{qemu_disables} + +# +# QEMU Targets to build. +# +%if %{!defined qemu_archs} && %{!defined with_qemu_archs} + %define qemu_target_list %{nil} +%else + %if %{defined with_qemu_archs} + %define qemu_target_list --target-list=%{with_qemu_archs} + %else + %define qemu_target_list --target-list=%{qemu_archs} + %endif +%endif + # # Prepare the source code. # @@ -73,22 +111,15 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n) PKG_CONFIG_PATH=$SYSROOT/lib/pkgconfig \ PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \ %{_ld_library_path}=$SYSROOT/lib \ - LDFLAGS="-Wl,-rpath -Wl,/$SB_PREFIX_CLEAN/lib ${VDE_LDFLAGS}" \ + LDFLAGS="-Wl,-rpath -Wl,/$SB_PREFIX_CLEAN/lib -L$SYSROOT/lib ${VDE_LDFLAGS}" \ CFLAGS="${CFLAGS} ${VDE_CFLAGS}" \ ../${source_dir_qemu}/configure \ --prefix=%{_prefix} \ ${CROSS_PREFIX_OPTION} \ --make=%{__make} \ + %{qemu_target_list} \ ${VDE_CONFIG} \ - --disable-smartcard-nss \ - --disable-werror \ - --disable-tools \ - --disable-pie \ - --disable-vnc \ - --disable-sdl \ - --disable-gtk \ - --disable-opengl \ - --disable-netmap + %{qemu_disables} %{_ld_library_path}=$SYSROOT/lib \ %{__make} %{?_smp_mflags} all