<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Tue, 1 May 2018, 00:52 Chris Johns, <<a href="mailto:chrisj@rtems.org" target="_blank" rel="noreferrer">chrisj@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 28/04/2018 20:18, Cillian O'Donnell wrote:<br>
> ---<br>
> source-builder/config/couverture-qemu-2-1.cfg | 104 ++++++++++++++++++++++++++<br>
<br>
Why a new file? Could the existing qemu config be used?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">We were thinking at the time that this would eventually replace the qemu that's there so it was best if it was self contained. They are identical in places so yes a lot of overlap.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
I would prefer to have as few of the global configs as possible and share them<br>
as much as possible.<br>
<br>
> 1 file changed, 104 insertions(+)<br>
> create mode 100644 source-builder/config/couverture-qemu-2-1.cfg<br>
> <br>
> diff --git a/source-builder/config/couverture-qemu-2-1.cfg b/source-builder/config/couverture-qemu-2-1.cfg<br>
> new file mode 100644<br>
> index 0000000..b0a31bb<br>
> --- /dev/null<br>
> +++ b/source-builder/config/couverture-qemu-2-1.cfg<br>
> @@ -0,0 +1,104 @@<br>
> +#<br>
> +# This configuration file configure's, make's and install's Couverture-QEMU.<br>
> +#<br>
> +<br>
> +%if %{release} == %{nil}<br>
> + %define release 1<br>
> +%endif<br>
> +<br>
> +#<br>
> +# The description.<br>
> +#<br>
> +Name: couverture-qemu-%{qemu_version}-%{_host}-%{release}<br>
> +Summary: Couverture-Qemu is a processor simulator with extra trace ability.<br>
<br>
I do not mind we have just the QEMU name and summary.<br>
<br>
> +Version: %{qemu_version}<br>
> +Release: %{release}<br>
> +URL: <a href="https://github.com/AdaCore/qemu" rel="noreferrer noreferrer noreferrer" target="_blank">https://github.com/AdaCore/qemu</a><br>
> +BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)<br>
> +<br>
> +#<br>
> +# List of architectures to be built<br>
> +#<br>
> +%define qemu_archs arm-softmmu,i386-softmmu,lm32-softmmu,mips-softmmu<br>
> +%define qemu_archs %{qemu_archs},ppc-softmmu,sparc-softmmu<br>
<br>
Why limit the archs?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">These are the ones I tested that produced same results with rtems tester to the existing qemu. I think there is also ones that aren't relevant to rtems.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> +<br>
> +#<br>
> +# Prepare the source code.<br>
> +#<br>
> +%prep<br>
> + build_top=$(pwd)<br>
> +<br>
> + source_dir_qemu="qemu-%{qemu_version}"<br>
> + %source setup qemu -n qemu-%{qemu_version}<br>
<br>
Why remove the -q?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">From our discussion last year</div><div dir="auto"><div style="color:purple;font-family:sans-serif;font-size:12.8px" dir="auto">> 3. What does the -q option do in the %prep section of the build, this<br>> option shows up in examples in the docs but there is no description of<br>> what it does?<br>> <br>> %source setup qemu -q -n qemu-%{qemu_version}<br><br></div><span style="font-family:sans-serif;font-size:12.8px">It is a spec file compatible option that is not used. You can remove the -q.</span><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
> + %patch setup qemu -p1<br>
> +<br>
> + cd ${build_top}<br>
> +<br>
> +%build<br>
> + build_top=$(pwd)<br>
> +<br>
> + %{build_directory}<br>
> +<br>
> + mkdir -p ${build_dir}<br>
> + cd ${build_dir}<br>
> +<br>
> + %if %{pkgconfig check vdeplug}<br>
> + VDE_CONFIG="--enable-vde"<br>
> + VDE_CFLAGS="%{pkgconfig cflags vdeplug}"<br>
> + VDE_LDFLAGS="%{pkgconfig ldflags vdeplug} %{pkgconfig libs vdeplug}"<br>
> + %endif<br>
> +<br>
> + %{host_build_flags}<br>
> +<br>
> + if test "%{_build}" != "%{_host}" ; then<br>
> + CROSS_PREFIX_OPTION="--cross-prefix=%{_host}-"<br>
> + fi<br>
> +<br>
> + SYSROOT=$SB_TMPPREFIX<br>
> +<br>
> + #<br>
> + # The --extra-cflags and --extra-ldflags do not work as expected.<br>
> + #<br>
> + # Hack warning: MSYS2 does not seem to convert the path to<br>
> + # a shell path from Windows so we keep them<br>
> + # separate and handle it in the pkgconfig tool.<br>
> + #<br>
> + PKG_CONFIG_DEFAULT_PATH=${PKG_CONFIG_PATH} \<br>
> + PKG_CONFIG_PATH=$SYSROOT/lib/pkgconfig \<br>
> + PKG_CONFIG_BUILD_TOP_DIR=$SB_TMPROOT \<br>
> + %{_ld_library_path}=$SYSROOT/lib \<br>
> + LDFLAGS="-Wl,-rpath -Wl,/$SB_PREFIX_CLEAN/lib ${VDE_LDFLAGS}" \<br>
> + CFLAGS="${CFLAGS} ${VDE_CFLAGS}" \<br>
> + ../${source_dir_qemu}/configure \<br>
> + --prefix=%{_prefix} \<br>
> + ${CROSS_PREFIX_OPTION} \<br>
> + --make=%{__make} \<br>
> + --target-list=%{?with_qemu_archs:%{with_qemu_archs}}\<br>
> + %{!?with_qemu_archs:%{qemu_archs}} \<br>
> + ${VDE_CONFIG} \<br>
> + --disable-smartcard-nss \<br>
> + --disable-tools \ <br>
> + --disable-pie \ <br>
> + --disable-vnc \ <br>
> + --disable-sdl \ <br>
> + --disable-gtk \ <br>
> + --disable-opengl \ <br>
> + --disable-netmap \ <br>
> + --disable-werror \<br>
<br>
Some of these lines have white space at the end which seems wrong.<br>
<br>
> + --disable-virtfs \<br>
> + --disable-docs<br>
<br>
Does the standard qemu build with these added?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div><div dir="auto">Not sure, didn't test that.</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Chris<br>
<br>
> +<br>
> + %{_ld_library_path}=$SYSROOT/lib \<br>
> + %{__make} %{?_smp_mflags} all<br>
> +<br>
> + cd ${build_top}<br>
> +<br>
> +%install<br>
> + build_top=$(pwd)<br>
> +<br>
> + %{__rmdir} $SB_BUILD_ROOT<br>
> +<br>
> + cd ${build_dir}<br>
> + %{_ld_library_path}=$SYSROOT/lib \<br>
> + %{__make} DESTDIR=$SB_BUILD_ROOT install<br>
> + cd ${build_top}<br>
> <br>
</blockquote></div></div></div>