[PATCH] devel/qemu: Update QEMU to 5.2.0-rc1

chrisj at rtems.org chrisj at rtems.org
Thu Nov 12 22:19:56 UTC 2020


From: Chris Johns <chrisj at rtems.org>

- This version of qemu uses meson and ninja to build. You will need
  to install ninja to build. No checks are made until meson run
---
 .../{qemu4-git-1.cfg => qemu-5.2.0-1.cfg}     |  16 +-
 bare/config/devel/qemu.bset                   |   2 +-
 bare/config/devel/qemu4.bset                  |  25 ---
 rtems/config/tools/rtems-kernel-common.cfg    | 104 ++++---------
 source-builder/config/qemu-5-1.cfg            |   9 ++
 source-builder/config/qemu-common-2.cfg       | 145 ++++++++++++++++++
 6 files changed, 189 insertions(+), 112 deletions(-)
 rename bare/config/devel/{qemu4-git-1.cfg => qemu-5.2.0-1.cfg} (65%)
 delete mode 100644 bare/config/devel/qemu4.bset
 create mode 100644 source-builder/config/qemu-5-1.cfg
 create mode 100644 source-builder/config/qemu-common-2.cfg

diff --git a/bare/config/devel/qemu4-git-1.cfg b/bare/config/devel/qemu-5.2.0-1.cfg
similarity index 65%
rename from bare/config/devel/qemu4-git-1.cfg
rename to bare/config/devel/qemu-5.2.0-1.cfg
index ff241bb..380a953 100644
--- a/bare/config/devel/qemu4-git-1.cfg
+++ b/bare/config/devel/qemu-5.2.0-1.cfg
@@ -13,14 +13,14 @@
 #
 # Stable version. Qemu is fast moving.
 #
-%define qemu_version 4.1.0
+%define qemu_version 5.2.0-rc1
 
 #
 # Use release sources.
 #
 %source set qemu https://download.qemu.org/qemu-%{qemu_version}.tar.xz
-%hash sha512 qemu-%{qemu_version}.tar.xz \
-        gv1RcCp7mxsAsvG9O0qDK4AkkBjbuhrdCwpz59S+5FKv1FV0tNjffORHfYcR872kygcqGm3iWJXJPrIc94/Esg==
+#%hash sha512 qemu-%{qemu_version}.tar.xz \
+#        gv1RcCp7mxsAsvG9O0qDK4AkkBjbuhrdCwpz59S+5FKv1FV0tNjffORHfYcR872kygcqGm3iWJXJPrIc94/Esg==
 
 #
 # Patches from Qemu's patchworks site.
@@ -30,13 +30,13 @@
          40399fcedb44b2c1bfa1a95af482f7f335f42d713967ed2f34980a7a940c3740
 
 #
-# Patches to build qemu-4.1.0-sparc with Leon3 support
+# Patches to build qemu sparc with Leon3 support
 #
-%patch add qemu https://gaisler.se/qemu/qemu-4.1.0-leon3.patch
-%hash sha256 qemu-4.1.0-leon3.patch \
+%patch add qemu https://gaisler.se/qemu/qemu-5.2.0-leon3.patch
+%hash sha512 qemu-5.2.0-leon3.patch \
          d62ff3418903f1c5eb7f6d727af0400caeb250e23cc120111930601c9ecce02a
 
 #
-# The Qemu build instructions. We use 4.x.x Release 1.
+# The Qemu build instructions. We use 5.x.x Release 1.
 #
-%include %{_configdir}/qemu-4-1.cfg
+%include %{_configdir}/qemu-5-1.cfg
diff --git a/bare/config/devel/qemu.bset b/bare/config/devel/qemu.bset
index a8b1ebf..3a9b0d5 100644
--- a/bare/config/devel/qemu.bset
+++ b/bare/config/devel/qemu.bset
@@ -21,4 +21,4 @@ devel/gettext-0.18.3.1-1
 devel/libffi-3.0.13-1
 devel/pixman-0.40.0-1
 devel/glib-2.48.2-1
-devel/qemu-git-1
+devel/qemu-5.2.0-1
diff --git a/bare/config/devel/qemu4.bset b/bare/config/devel/qemu4.bset
deleted file mode 100644
index fa52084..0000000
--- a/bare/config/devel/qemu4.bset
+++ /dev/null
@@ -1,25 +0,0 @@
-#
-# Build set for QEMU
-#
-
-%define release 1
-
-#
-# Name of the package.
-#
-package: qemu-%{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}
-
-# I don't think these are needed anymore ...?
-#devel/autotools-internal
-devel/libiconv-1.14-1
-devel/gettext-0.18.3.1-1
-devel/libffi-3.0.13-1
-devel/pixman-0.40.0-1
-devel/glib-2.46.2-1
-devel/qemu4-git-1
diff --git a/rtems/config/tools/rtems-kernel-common.cfg b/rtems/config/tools/rtems-kernel-common.cfg
index 157c7a4..c34e181 100644
--- a/rtems/config/tools/rtems-kernel-common.cfg
+++ b/rtems/config/tools/rtems-kernel-common.cfg
@@ -9,7 +9,7 @@
 # and BSPs. Only after the source to download.
 #
 %if %{_dry_run} && %{defined with_download}
- %log Kenrel configuration errors ignored
+ %log Kernel configuration errors ignored
  %define rtems_kernel_error 0
 %else
  %define rtems_kernel_error 1
@@ -44,11 +44,6 @@
  %define with_tools %{_prefix}
 %endif
 
-#
-# Set the path to the tools.
-#
-%{path prepend %{with_tools}/bin}
-
 #
 # Define the package.
 #
@@ -67,62 +62,13 @@ URL: 	 https://www.rtems.org/
 %include %{_configdir}/base.cfg
 %include %{_configdir}/versions.cfg
 
-#
-# 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}
-
-#
-# Check the version of autoconf. Check autoreconf as it is used.
-#
-%if %{__autoreconf_ver} <= 2.68
- %if %{__autoreconf_bindir_ver} <= 2.68
-  %if %{__autoreconf_path_ver} <= 2.68
-   %error Autoconf (autoreconf) version 2.69 or higher is needed.
-  %endif
- %endif
-%endif
-
-#
-# If no tools provided use the prefix.
-#
-%ifn %{defined with_tools}
- %define with_tools %{_prefix}
-%endif
-
-#
-# Check options.
-#
-%if %{defined without_rtems_posix}
- %define rtems_posix 0
-%endif
-
-%if %{defined with_rtems_legacy_network}
- %define rtems_networking 1
-%endif
-
-%if %{defined with_rtems_cxx}
- %define rtems_cxx 1
-%endif
-
-%if %{defined with_rtems_bspopts}
- %define bspopts %{with_rtems_bspopts}
-%endif
-
 #
 # Source
 #
 %if %{rsb_released}
  %define rtems_kernel_file rtems-%{rtems_kernel_version}.tar.xz
- %define rtems_bootstrap 0
 %else
  %define rtems_kernel_file rtems-kernel-%{rtems_kernel_version}.tar.bz2
- #
- # The code in git needs to be bootstrapped. Do each build because we have
- # no way to change what changes may have happened in the code.
- #
- %define rtems_bootstrap 1
 %endif
 
 %if ! %{defined rtems_kernel_version}
@@ -130,7 +76,7 @@ URL: 	 https://www.rtems.org/
 %endif
 
 %source set rtems_kernel --rsb-file=%{rtems_kernel_file} \
-              https://git.rtems.org/rtems/snapshot/rtems-%{rtems_kernel_version}.tar.bz2
+  https://git.rtems.org/rtems/snapshot/rtems-%{rtems_kernel_version}.tar.bz2
 
 #
 # Check the various --with/--without options we support. These are
@@ -140,36 +86,45 @@ URL: 	 https://www.rtems.org/
 # --with-rtems-bsp               : The BSP
 # --without-rtems-bsp            : Not supported
 # --with-rtems-tests             : Supported, samples/yes/no
-# --without-rtems-tests          : Supported, forced to no
+# --without-rtems-tests          : Supported, forced to False
 # --with-rtems-smp               : Supported
 # --without-rtems-smp            : Don't care
 # --with-rtems-legacy-network    : Supported
 # --without-rtems-legacy-network : Don't care
-# --with-rtems-bspopts           : Supported, quote for a list
+# --with-rtems-bspopts           : Supported, quote for a list, INI file fragment
 # --without-rtems-bspopts        : Don't care
 #
 %if %{defined without_rtemsbsp}
  %error Option --without-rtemsbsp is not supported.
 %endif
+
 %if %{defined without_rtems_tests}
- %define with_rtems_tests no
+ %define rtems_tests "BUILD_TESTS = False"
 %endif
 %if %{defined with_rtems_tests}
- %if %{with_rtems_tests} == 1
-  %define with_rtems_tests yes
- %endif
- %if %{with_rtems_tests} == yes || \
-     %{with_rtems_tests} == no || \
-     %{with_rtems_tests} == samples
-  %define rtems_tests %{with_rtems_tests}
+ %if %{with_rtems_tests} == 1 || \
+     %{with_rtems_tests} == yes
+  %define rtems_tests "BUILD_TESTS = True"
+ %else
+  %if %{with_rtems_tests} == 0 || \
+      %{with_rtems_tests} == no
+   %define rtems_tests "BUILD_TESTS = False"
+  %else
+   %define rtems_tests echo "BUILD_$(echo "%{with_rtems_tests}" \
+                | sed -e 's/,/ = True,BUILD_/g') = True" | \
+		tr '[:lower:]' '[:upper:]' | tr ',' '\n'
+  %endif
  %endif
 %endif
+
 %if %{defined with_rtems_smp}
- %define rtems_smp 1
+ %define rtems_smp "RTEMS_SMP = True"
 %endif
+
 %if %{defined with_rtems_legacy_network}
- %define rtems_networking 1
+ %define rtems_networking "RTEMS_NETWORKING = True"
 %endif
+
 %if %{defined with_rtems_bspopts}
  %define rtems_bspopts %{with_rtems_bspopts}
 %endif
@@ -188,12 +143,12 @@ URL: 	 https://www.rtems.org/
 %ifn %{defined rtems_posix}
  %define rtems_posix 1
 %endif
-%ifn %{defined rtems_networking}
- %define rtems_networking 0
-%endif
 %ifn %{defined rtems_cxx}
  %define rtems_cxx 1
 %endif
+%ifn %{defined rtems_networking}
+ %define rtems_networking 0
+%endif
 %ifn %{defined rtems_tests}
  %define rtems_tests samples
 %endif
@@ -209,13 +164,6 @@ URL: 	 https://www.rtems.org/
   %source setup rtems_kernel -q -c -n %{name}-%{version}
   cd ${source_dir_rtems}
   %patch setup rtems_kernel -p1
-  %if %{rtems_bootstrap}
-    %if %{defined _internal_autotools_path}
-      export PATH="%{_internal_autotools_path}/bin:${PATH}"
-    %endif
-    ./bootstrap -c
-    ./rtems-bootstrap
-  %endif
   cd ..
 
 %build
diff --git a/source-builder/config/qemu-5-1.cfg b/source-builder/config/qemu-5-1.cfg
new file mode 100644
index 0000000..7ca58b8
--- /dev/null
+++ b/source-builder/config/qemu-5-1.cfg
@@ -0,0 +1,9 @@
+#
+# QEMU 5 Version 1.
+#
+# This configuration file configure's, make's and install's QEMU.
+#
+
+%define qemu_disables --disable-nettle
+
+%include %{_configdir}/qemu-common-2.cfg
diff --git a/source-builder/config/qemu-common-2.cfg b/source-builder/config/qemu-common-2.cfg
new file mode 100644
index 0000000..1dbaf05
--- /dev/null
+++ b/source-builder/config/qemu-common-2.cfg
@@ -0,0 +1,145 @@
+#
+# QEMU Common Version 1.
+#
+# This configuration file configure's, make's and install's QEMU.
+#
+
+%if %{release} == %{nil}
+%define release 1
+%endif
+
+#
+# Select Snapshot Macro Maps
+#
+%select qemu-snapshot
+
+#
+# The description.
+#
+Name:      qemu-%{qemu_version}-%{_host}-%{release}
+Summary:   Qemu is a simulator of various processors.
+Version:   %{qemu_version}
+Release:   %{release}
+URL: 	   http://www.qemu.org/
+
+#
+# Source
+#
+%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-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
+
+#
+# Clear the path to SB, meson does not like the python pkg-config
+#
+%define _extra_path %{nil}
+
+#
+# Prepare the source code.
+#
+%prep
+  build_top=$(pwd)
+
+  source_dir_qemu="qemu-%{qemu_version}"
+  %source setup qemu -q -n qemu-%{qemu_version}
+  %patch setup qemu -p1
+
+  cd ${build_top}
+
+%build
+  build_top=$(pwd)
+
+  %{build_directory}
+
+  mkdir -p ${build_dir}
+  cd ${build_dir}
+
+  %if %{pkgconfig check vdeplug}
+    VDE_CONFIG="--enable-vde"
+    VDE_CFLAGS="%{pkgconfig cflags vdeplug}"
+    VDE_LDFLAGS="%{pkgconfig ldflags vdeplug} %{pkgconfig libs vdeplug}"
+  %endif
+
+  %{host_build_flags}
+
+  if test "%{_build}" != "%{_host}" ; then
+    CROSS_PREFIX_OPTION="--cross-prefix=%{_host}-"
+  fi
+
+  SYSROOT=$SB_TMPPREFIX
+
+  STAGED_GLIB="-I${SB_TMPPREFIX}/include/glib-2.0 -I${SB_TMPPREFIX}/lib/glib-2.0/include"
+  STAGED_PIXMAN=" -I${SB_TMPPREFIX}/include/pixman-1"
+  STAGED_INCLUDES="${STAGED_GLIB} ${STAGED_PIXMAN}"
+
+  CC="${CC} ${STAGED_INCLUDES}"
+  CXX="${CXX} ${STAGED_INCLUDES}"
+
+  #
+  # Hack warning: MSYS2 does not seem to convert the path to
+  #               a shell path from Windows so we keep them
+  #               separate and handle it in the pkgconfig tool.
+  #
+  PKG_CONFIG_DEFAULT_PATH=${PKG_CONFIG_PATH} \
+  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 -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} \
+    %{qemu_disables}
+
+  %{_ld_library_path}=$SYSROOT/lib \
+  %{__make} %{?_smp_mflags} all
+
+  cd ${build_top}
+
+%install
+  build_top=$(pwd)
+
+  %{__rmdir} $SB_BUILD_ROOT
+
+  cd ${build_dir}
+  %{_ld_library_path}=$SYSROOT/lib \
+  %{__make} DESTDIR=$SB_BUILD_ROOT install
+  cd ${build_top}
-- 
2.24.1



More information about the devel mailing list