Patchwork [2/2] qemu: Make qemu buildable inside qemux86/qemuppc target

login
register
mail settings
Submitter Zhai, Edwin
Date Aug. 15, 2011, 12:40 p.m.
Message ID <edd51def7cc31eaa3d67f7cc73bf5fded2351f5f.1313411859.git.edwin.zhai@intel.com>
Download mbox | patch
Permalink /patch/9859/
State New, archived
Headers show

Comments

Zhai, Edwin - Aug. 15, 2011, 12:40 p.m.
From: Zhai Edwin <edwin.zhai@intel.com>

It requires libx11 and libGL(if enabled GL) for building, which introduce extra
dependence in qemuppc target. Futhermore, qemu's GL code is x86-oriented, thus
some hacks needed for building in qemupcc. For simplicity, just make qemu GL's
code for native only, so that qemu building is okay in world build.

[YOCTO #1011] got fixed.

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
---
 meta/recipes-devtools/qemu/qemu.inc       |    5 ++---
 meta/recipes-devtools/qemu/qemu_0.14.0.bb |   27 ++++++++++++++++++++++-----
 2 files changed, 24 insertions(+), 8 deletions(-)
Richard Purdie - Aug. 15, 2011, 2:25 p.m.
On Mon, 2011-08-15 at 20:40 +0800, edwin.zhai@intel.com wrote:
> From: Zhai Edwin <edwin.zhai@intel.com>
> 
> It requires libx11 and libGL(if enabled GL) for building, which introduce extra
> dependence in qemuppc target. Futhermore, qemu's GL code is x86-oriented, thus
> some hacks needed for building in qemupcc. For simplicity, just make qemu GL's
> code for native only, so that qemu building is okay in world build.
> 
> [YOCTO #1011] got fixed.
> 
> Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
> ---
>  meta/recipes-devtools/qemu/qemu.inc       |    5 ++---
>  meta/recipes-devtools/qemu/qemu_0.14.0.bb |   27 ++++++++++++++++++++++-----
>  2 files changed, 24 insertions(+), 8 deletions(-)
> 
> diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
> index 85476d6..e5414ff 100644
> --- a/meta/recipes-devtools/qemu/qemu.inc
> +++ b/meta/recipes-devtools/qemu/qemu.inc
> @@ -1,7 +1,7 @@
>  DESCRIPTION = "open source processor emulator"
>  HOMEPAGE = "http://qemu.org"
>  LICENSE = "GPLv2 & LGPLv2.1"
> -DEPENDS = "zlib alsa-lib qemugl"
> +DEPENDS = "zlib alsa-lib virtual/libx11"
>  
>  # QEMU_TARGETS is overridable variable
>  QEMU_TARGETS ?= "arm i386 mips mipsel mips64 mips64el ppc sh4 x86_64"
> @@ -40,7 +40,7 @@ do_configure_prepend_virtclass-native() {
>  
>  do_configure() {
>      ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --disable-strip ${EXTRA_OECONF}
> -    chmod a+x ${S}/target-i386/beginend_funcs.sh
> +    test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
>  }
>  
>  do_install () {
> @@ -50,7 +50,6 @@ do_install () {
>  	install -m 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
>  }
>  
> -SRC_URI_append_virtclass-nativesdk = " file://glflags.patch"
>  DEPENDS_virtclass-native = "zlib-native alsa-lib-native"
>  DEPENDS_virtclass-nativesdk = "zlib-nativesdk libsdl-nativesdk qemugl-nativesdk"
>  RDEPENDS_virtclass-nativesdk = "libsdl-nativesdk"
> diff --git a/meta/recipes-devtools/qemu/qemu_0.14.0.bb b/meta/recipes-devtools/qemu/qemu_0.14.0.bb
> index de12f62..dc9b695 100644
> --- a/meta/recipes-devtools/qemu/qemu_0.14.0.bb
> +++ b/meta/recipes-devtools/qemu/qemu_0.14.0.bb
> @@ -11,22 +11,39 @@ FILESDIR = "${WORKDIR}"
>  SRC_URI = "\
>      http://download.savannah.gnu.org/releases/qemu/qemu-${PV}.tar.gz \
>      file://powerpc_rom.bin \
> -    file://qemu-git-qemugl-host.patch \
>      file://no-strip.patch \
> -    file://fix-nogl.patch \
> -    file://qemugl-allow-glxcontext-release.patch \
>      file://linker-flags.patch \
> -    file://init-info.patch \
>      file://qemu-vmware-vga-depth.patch \
> -    file://enable-i386-linux-user.patch \
>      file://fix-configure-checks.patch \
>      file://fallback-to-safe-mmap_min_addr.patch \
>      file://spice-qxl-locking-fix-for-qemu-kvm.patch \
>      file://Detect-and-use-GCC-atomic-builtins-for-locking.patch \
>      file://larger_default_ram_size.patch \
> +    "
> +
> +SRC_URI_append_virtclass-native = "\
> +    file://qemu-git-qemugl-host.patch \
> +    file://fix-nogl.patch \
> +    file://qemugl-allow-glxcontext-release.patch \
> +    file://init-info.patch \
> +    file://enable-i386-linux-user.patch \
>      file://qemugl-fix.patch \
>      file://opengl-sdl-fix.patch \
>      "
> +
> +SRC_URI_append_virtclass-nativesdk = "\
> +    file://qemu-git-qemugl-host.patch \
> +    file://fix-nogl.patch \
> +    file://qemugl-allow-glxcontext-release.patch \
> +    file://init-info.patch \
> +    file://enable-i386-linux-user.patch \
> +    file://qemugl-fix.patch \
> +    file://opengl-sdl-fix.patch \
> +    file://glflags.patch \
> +    "
> +
> +#SRC_URI_append_virtclass-nativesdk = " file://glflags.patch"
> +
>  SRC_URI[md5sum] = "f9d145d5c09de9f0984ffe9bd1229970"
>  SRC_URI[sha256sum] = "ba21e84d7853217830e167dae9999cdbff481189c6a0bb600ac7fb7201453108"

The patch is fine but could we change this to something like:

# Only use the GL passthrough patches for native/nativesdk versions
$QEMUGLPATCHES = "\
    file://qemu-git-qemugl-host.patch \
    file://fix-nogl.patch \
    file://qemugl-allow-glxcontext-release.patch \
    file://init-info.patch \
    file://enable-i386-linux-user.patch \
    file://qemugl-fix.patch \
    file://opengl-sdl-fix.patch \
    "

SRC_URI_append_virtclass-native = "\
    ${QEMUGLPATCHES} \
    "

SRC_URI_append_virtclass-nativesdk = "\
    ${QEMUGLPATCHES} \
    file://glflags.patch \
    "

which is just a little bit neater. Also, no need for the commented out
line.

Cheers,

Richard
Zhai, Edwin - Aug. 16, 2011, 6:32 a.m.
On Mon, Aug 15, 2011 at 10:25:49PM +0800, Richard Purdie wrote:
> 
> The patch is fine but could we change this to something like:
> 
> # Only use the GL passthrough patches for native/nativesdk versions
> $QEMUGLPATCHES = "\
>     file://qemu-git-qemugl-host.patch \
>     file://fix-nogl.patch \
>     file://qemugl-allow-glxcontext-release.patch \
>     file://init-info.patch \
>     file://enable-i386-linux-user.patch \
>     file://qemugl-fix.patch \
>     file://opengl-sdl-fix.patch \
>     "
> 
> SRC_URI_append_virtclass-native = "\
>     ${QEMUGLPATCHES} \
>     "
> 
> SRC_URI_append_virtclass-nativesdk = "\
>     ${QEMUGLPATCHES} \
>     file://glflags.patch \
>     "
> 
> which is just a little bit neater. Also, no need for the commented out
> line.

RP,
Thanks for your comments. I have modified it. Pls. pull @ same branch:

git://git.pokylinux.org/poky-contrib gzhai/master2
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=gzhai/master2

BTW, I saw qemugl_git.bb is extended as "nativesdk", and was curious about it as 
qemugl is hacked libgl inside qemu guest, thus should not be related to "native" 
case. Any reason? Meet the dependency requirement?

Thanks,
Edwin


> 
> Cheers,
> 
> Richard
> 
>  
> 
> 
> 
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core
Richard Purdie - Aug. 17, 2011, 2:54 p.m.
On Tue, 2011-08-16 at 14:32 +0800, Zhai, Edwin wrote:
> On Mon, Aug 15, 2011 at 10:25:49PM +0800, Richard Purdie wrote:
> > 
> > The patch is fine but could we change this to something like:
> > 
> > # Only use the GL passthrough patches for native/nativesdk versions
> > $QEMUGLPATCHES = "\
> >     file://qemu-git-qemugl-host.patch \
> >     file://fix-nogl.patch \
> >     file://qemugl-allow-glxcontext-release.patch \
> >     file://init-info.patch \
> >     file://enable-i386-linux-user.patch \
> >     file://qemugl-fix.patch \
> >     file://opengl-sdl-fix.patch \
> >     "
> > 
> > SRC_URI_append_virtclass-native = "\
> >     ${QEMUGLPATCHES} \
> >     "
> > 
> > SRC_URI_append_virtclass-nativesdk = "\
> >     ${QEMUGLPATCHES} \
> >     file://glflags.patch \
> >     "
> > 
> > which is just a little bit neater. Also, no need for the commented out
> > line.
> 
> RP,
> Thanks for your comments. I have modified it. Pls. pull @ same branch:
> 
> git://git.pokylinux.org/poky-contrib gzhai/master2
> http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=gzhai/master2
> 
> BTW, I saw qemugl_git.bb is extended as "nativesdk", and was curious about it as 
> qemugl is hacked libgl inside qemu guest, thus should not be related to "native" 
> case. Any reason? Meet the dependency requirement?

I've merged this, thanks.

We need the GL code in nativesdk since this ships as part of the SDK/ADT
toolchain and we want the GL pass through support there.

Cheers,

Richard

Patch

diff --git a/meta/recipes-devtools/qemu/qemu.inc b/meta/recipes-devtools/qemu/qemu.inc
index 85476d6..e5414ff 100644
--- a/meta/recipes-devtools/qemu/qemu.inc
+++ b/meta/recipes-devtools/qemu/qemu.inc
@@ -1,7 +1,7 @@ 
 DESCRIPTION = "open source processor emulator"
 HOMEPAGE = "http://qemu.org"
 LICENSE = "GPLv2 & LGPLv2.1"
-DEPENDS = "zlib alsa-lib qemugl"
+DEPENDS = "zlib alsa-lib virtual/libx11"
 
 # QEMU_TARGETS is overridable variable
 QEMU_TARGETS ?= "arm i386 mips mipsel mips64 mips64el ppc sh4 x86_64"
@@ -40,7 +40,7 @@  do_configure_prepend_virtclass-native() {
 
 do_configure() {
     ${S}/configure --prefix=${prefix} --sysconfdir=${sysconfdir} --disable-strip ${EXTRA_OECONF}
-    chmod a+x ${S}/target-i386/beginend_funcs.sh
+    test ! -e ${S}/target-i386/beginend_funcs.sh || chmod a+x ${S}/target-i386/beginend_funcs.sh
 }
 
 do_install () {
@@ -50,7 +50,6 @@  do_install () {
 	install -m 0755 ${WORKDIR}/powerpc_rom.bin ${D}${datadir}/qemu
 }
 
-SRC_URI_append_virtclass-nativesdk = " file://glflags.patch"
 DEPENDS_virtclass-native = "zlib-native alsa-lib-native"
 DEPENDS_virtclass-nativesdk = "zlib-nativesdk libsdl-nativesdk qemugl-nativesdk"
 RDEPENDS_virtclass-nativesdk = "libsdl-nativesdk"
diff --git a/meta/recipes-devtools/qemu/qemu_0.14.0.bb b/meta/recipes-devtools/qemu/qemu_0.14.0.bb
index de12f62..dc9b695 100644
--- a/meta/recipes-devtools/qemu/qemu_0.14.0.bb
+++ b/meta/recipes-devtools/qemu/qemu_0.14.0.bb
@@ -11,22 +11,39 @@  FILESDIR = "${WORKDIR}"
 SRC_URI = "\
     http://download.savannah.gnu.org/releases/qemu/qemu-${PV}.tar.gz \
     file://powerpc_rom.bin \
-    file://qemu-git-qemugl-host.patch \
     file://no-strip.patch \
-    file://fix-nogl.patch \
-    file://qemugl-allow-glxcontext-release.patch \
     file://linker-flags.patch \
-    file://init-info.patch \
     file://qemu-vmware-vga-depth.patch \
-    file://enable-i386-linux-user.patch \
     file://fix-configure-checks.patch \
     file://fallback-to-safe-mmap_min_addr.patch \
     file://spice-qxl-locking-fix-for-qemu-kvm.patch \
     file://Detect-and-use-GCC-atomic-builtins-for-locking.patch \
     file://larger_default_ram_size.patch \
+    "
+
+SRC_URI_append_virtclass-native = "\
+    file://qemu-git-qemugl-host.patch \
+    file://fix-nogl.patch \
+    file://qemugl-allow-glxcontext-release.patch \
+    file://init-info.patch \
+    file://enable-i386-linux-user.patch \
     file://qemugl-fix.patch \
     file://opengl-sdl-fix.patch \
     "
+
+SRC_URI_append_virtclass-nativesdk = "\
+    file://qemu-git-qemugl-host.patch \
+    file://fix-nogl.patch \
+    file://qemugl-allow-glxcontext-release.patch \
+    file://init-info.patch \
+    file://enable-i386-linux-user.patch \
+    file://qemugl-fix.patch \
+    file://opengl-sdl-fix.patch \
+    file://glflags.patch \
+    "
+
+#SRC_URI_append_virtclass-nativesdk = " file://glflags.patch"
+
 SRC_URI[md5sum] = "f9d145d5c09de9f0984ffe9bd1229970"
 SRC_URI[sha256sum] = "ba21e84d7853217830e167dae9999cdbff481189c6a0bb600ac7fb7201453108"