Adding support for building QEMU for Windows
cover Adding support for building QEMU for Windows
This series is paired with a series that is sent for the oe-core meta layer. That series depends on changes in this series and vice-versa. The oe-core meta series can be reviewed via:
https://patchwork.openembedded.org/series/4800/
Additional information about this work can be read in the cover letter of the above linked series.
The following series fixes a number of issues with compilation of certain components that are required to build and distribute QEMU. This series includes:
* Enabling 'secure-api' for mingw-w64-headers
* Allow building of shared libraries for gettext
* Work around to avoid dependency on bash for glib-2.0, and clean up of glib-2.0 appends which are resolved in oe-core meta
* Better packaging of libgcc for easy use on Windows (deploy dll to bindir)
* Enabling build of libfdt in the dtc the recipe, but skipping dtc itself
Additionally this series includes an un-merged patch from Juro which is required for functional building with master of oe-core.
The goal of these changes is to allow for building of QEMU for mingw32 and generating a deployable archive for use on the target.
For convenience this series is also available in the git repository:
https://github.com/nathanrossi/meta-mingw nrossi/mingw-qemu-v1
Juro Bystricky (1):
mingw-64-runtime_3.1.bb: Adapt to SDK_ARCH -> SDK_SYS chanages for
crosssdk
Nathan Rossi (6):
mingw-w64-headers: Add 'secure-api' PACKAGECONFIG
gettext: Enabling building shared libs/dlls glib-2.0_%.bbappend: Prevent a bash dependency via bash-completion glib-2.0: Clean up unnecessary appends that are resolved in oe-core libgcc_%.bbappend: Relocate and package dll's in bindir dtc_%.bbappend: Only build libfdt for mingw32
recipes-core/dtc/dtc_%.bbappend | 16 ++++++++++++++++ recipes-core/gettext/gettext_0.19.%.bbappend | 2 +- recipes-core/glib-2.0/glib-2.0_%.bbappend | 5 +++-- recipes-devtools/gcc/libgcc_%.bbappend | 8 +++++++- .../mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb | 4 ++++ .../mingw-w64/nativesdk-mingw-w64-runtime_3.1.0.bb | 2 +- 6 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 recipes-core/dtc/dtc_%.bbappend
Signature · 1 line
2.11.0
PATCH 1/7 mingw-64-runtime_3.1.bb: Adapt to SDK_ARCH -> SDK_SYS chanages for crosssdk
From: Juro Bystricky <[email protected]>
With the change of crosssdk to use SDK_SYS instead of SDK_ARCH, we need to update the recipe to match the changes in master.
[YOCTO #9281]
--- recipes-devtools/mingw-w64/nativesdk-mingw-w64-runtime_3.1.0.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-devtools/mingw-w64/nativesdk-mingw-w64-runtime_3.1.0.bb +1 -1
@@ -24,7 +24,7 @@ PROVIDES += "virtual/nativesdk-${SDK_PREFIX}libc-for-gcc" PROVIDES += "virtual/nativesdk-libintl" STAGINGCC = "gcc-cross-initial-${TARGET_ARCH}" -STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${TARGET_ARCH}" +STAGINGCC_class-nativesdk = "gcc-crosssdk-initial-${SDK_SYS}" TOOLCHAIN_OPTIONS = " --sysroot=${STAGING_DIR_TARGET}" PATH_prepend = "${STAGING_BINDIR_TOOLCHAIN}.${STAGINGCC}:"
Signature · 1 line
2.11.0
PATCH 2/7 mingw-w64-headers: Add 'secure-api' PACKAGECONFIG
In reply to Nathan RossiAdd the 'secure-api' PACKAGECONFIG and enable it by default. The 'secure-api' feature enables the secure string functions that are provided in the MS C Runtime e.g. "strerror_s".
These functions are needed for glib-2.0 compilation.
--- recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb | 4 ++++ 1 file changed, 4 insertions(+)
recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_3.1.0.bb +4 -0
@@ -18,6 +18,10 @@ inherit autotools nativesdk INHIBIT_DEFAULT_DEPS = "1" DEPENDS = "" +PACKAGECONFIG ??= "secure-api" + +PACKAGECONFIG[secure-api] = "--enable-secure-api,--disable-secure-api" + do_configure() { oe_runconf }
Signature · 1 line
2.11.0
PATCH 3/7 gettext: Enabling building shared libs/dlls
In reply to Nathan RossiEnable building of shared libs/dlls for gettext.
--- recipes-core/gettext/gettext_0.19.%.bbappend | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-core/gettext/gettext_0.19.%.bbappend +1 -1
@@ -2,5 +2,5 @@ DEPENDS_append_mingw32 = " pthreads-win32" LDFLAGS_prepend_mingw32 = " -lpthread " CFLAGS_append_mingw32 = " -DLIBXML_STATIC" -EXTRA_OECONF_append_mingw32 = " --enable-threads=windows --enable-static --disable-shared " +EXTRA_OECONF_append_mingw32 = " --enable-threads=windows --enable-static"
Signature · 1 line
2.11.0
PATCH 4/7 glib-2.0_%.bbappend: Prevent a bash dependency via bash-completion
In reply to Nathan RossiPrevent glib-2.0 depending on bash indirectly due to the RDEPEND on bash-completion. The bash dependency is undesirable due to bash depending on POSIX compatibility (fork, etc) which is not provided by MinGW but instead MSYS or CYGWIN.
The glib-2.0 configure does not allow for disabling of bash-completion output, so instead of disabling the bash-completion bbclass entirely allow the output to be packaged but remove the RDEPENDS_${PN}-bash-completion on bash-completion.
--- recipes-core/glib-2.0/glib-2.0_%.bbappend | 4 ++++ 1 file changed, 4 insertions(+)
recipes-core/glib-2.0/glib-2.0_%.bbappend +4 -0
@@ -1,2 +1,6 @@ EXTRA_OECONF_mingw32 = "--enable-included-printf=yes ${CORECONF}" FILES_${PN}_append_mingw32 = " ${libdir}/charset.alias ${libdir}/gthread-2.0.def" + +# glib always provides bash-completion output, package the output but prevent +# the dependency chain on bash (via bash-completion) for mingw32 targets only. +RDEPENDS_${PN}-bash-completion_remove_mingw32 = "bash-completion"
Signature · 1 line
2.11.0
PATCH 5/7 glib-2.0: Clean up unnecessary appends that are resolved in oe-core
In reply to Nathan RossiThe changes that are appended for '--enable-include=printf=yes' and packaging of charset.alias and gthread-2.0.def are handled in oe-core. Clean up these appends.
--- recipes-core/glib-2.0/glib-2.0_%.bbappend | 3 --- 1 file changed, 3 deletions(-)
recipes-core/glib-2.0/glib-2.0_%.bbappend +0 -3
@@ -1,6 +1,3 @@ -EXTRA_OECONF_mingw32 = "--enable-included-printf=yes ${CORECONF}" -FILES_${PN}_append_mingw32 = " ${libdir}/charset.alias ${libdir}/gthread-2.0.def" - # glib always provides bash-completion output, package the output but prevent # the dependency chain on bash (via bash-completion) for mingw32 targets only. RDEPENDS_${PN}-bash-completion_remove_mingw32 = "bash-completion"
Signature · 1 line
2.11.0
PATCH 6/7 libgcc_%.bbappend: Relocate and package dll's in bindir
In reply to Nathan RossiRelocate and package the dll's provided by libgcc in bindir. It is convention that on mingw/windows dll files are installed into the bindir, this is done to avoid issues with search paths and allows for execution of binaries without the need to point at a libdir.
--- recipes-devtools/gcc/libgcc_%.bbappend | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
recipes-devtools/gcc/libgcc_%.bbappend +7 -1
@@ -1,2 +1,8 @@ -FILES_${PN}_append_mingw32 = " ${base_libdir}/libgcc*.dll" +FILES_${PN}_append_mingw32 = " ${bindir}/libgcc*.dll" FILES_${PN}-dev_append_mingw32 = " ${base_libdir}/libgcc*.a" + +do_install_append_mingw32 () { + # move the .dll files into bindir + install -d ${D}${bindir} + mv ${D}${base_libdir}/libgcc*.dll ${D}${bindir}/ +}
Signature · 1 line
2.11.0
PATCH 7/7 dtc_%.bbappend: Only build libfdt for mingw32
In reply to Nathan RossiWhilst building libfdt on mingw32 is functional, building dtc for minw32 is not. This is due to dtc relying on certain POSIX functions as well as not handling the MSVCRT printf formatting.
This change enables building and installing libfdt only for mingw32, disabling the build of device-tree-compiler itself.
--- recipes-core/dtc/dtc_%.bbappend | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 recipes-core/dtc/dtc_%.bbappend
recipes-core/dtc/dtc_%.bbappend new file +16 -0
@@ -0,0 +1,16 @@ + +do_configure_append_mingw32 () { + # don't try to build the other dtc components when installing libs + sed -i 's/install-lib: all/install-lib: libfdt/g' ${S}/Makefile +} + +do_compile_mingw32 () { + oe_runmake libfdt +} + +do_install_mingw32 () { + oe_runmake install-lib install-includes +} + +RDEPENDS_${PN}-misc_remove_mingw32 = "bash" +
Signature · 1 line
2.11.0