Skip to contentSkip to conversation

libsdl: support native compilation

PATCH In review Dmitry Eremin-Solenikov 3 participants 6 messages Oct 19, 2015 – Oct 22, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 libsdl: support native compilation

qemu-native can use SDL backend for graphical output. Currently it is expected to use libsdl provided by the host. However this can lead to library incompatibilities between host and target. Make libsdl recipe support native compilation.

---
 meta/recipes-graphics/libsdl/libsdl_1.2.15.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-graphics/libsdl/libsdl_1.2.15.bb +2 -1
index c0d5c6a..c9f3e00 100644
@@ -17,6 +17,7 @@ DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d
            ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11 libxext libxrandr libxrender', '', d)} \
            ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'libglu', '', d)} \
            tslib"
+DEPENDS_class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11-native libxrandr-native libxrender-native libxext-native', '', d)}"
 DEPENDS_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11 nativesdk-libxrandr nativesdk-libxrender nativesdk-libxext', '', d)}"
 
 PR = "r3"
@@ -65,4 +66,4 @@ do_configure_prepend() {
         export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
 }
 
-BBCLASSEXTEND = "nativesdk"
+BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.6.1
#1 lore raw

PATCH 2/3 qemu: drop hooking of libsdl from the host

Now as libsdl recipe provides libsdl-native, there is no need to hook in extra library paths from host to compile qemu-native.

---
 meta/recipes-devtools/qemu/qemu.inc | 8 --------
 1 file changed, 8 deletions(-)
meta/recipes-devtools/qemu/qemu.inc +0 -8
index abbace8..4320031 100644
@@ -35,14 +35,6 @@ EXTRA_OECONF_class-nativesdk = "--target-list=${@get_qemu_target_list(d)} --disa
 				"
 export LIBTOOL="${HOST_SYS}-libtool"
 
-do_configure_prepend_class-native() {
-	# Append build host pkg-config paths for native target since the host may provide sdl
-	BHOST_PKGCONFIG_PATH=$(PATH=/usr/bin:/bin pkg-config --variable pc_path pkg-config || echo "")
-	if [ ! -z "$BHOST_PKGCONFIG_PATH" ]; then
-		export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$BHOST_PKGCONFIG_PATH
-	fi
-}
-
 KVMENABLE = "--enable-kvm"
 KVMENABLE_darwin = "--disable-kvm"
 KVMENABLE_mingw32 = "--disable-kvm"
Signature · 1 line
2.6.1
#2 lore raw

PATCH 3/3 local.conf.sample: stop adding libsdl-native to ASSUME_PROVIDED

In reply to Dmitry Eremin-Solenikov
---
 meta/conf/local.conf.sample | 1 -
 1 file changed, 1 deletion(-)
meta/conf/local.conf.sample +0 -1
index 3ae24ab..dfdb912 100644
@@ -205,7 +205,6 @@ BB_DISKMON_DIRS = "\
 # libsdl library available on your build system.
 PACKAGECONFIG_append_pn-qemu-native = " sdl"
 PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"
-ASSUME_PROVIDED += "libsdl-native"
 
 
 # CONF_VERSION is increased each time build/conf/ changes incompatibly and is used to
Signature · 1 line
2.6.1
#3 lore raw
In reply to Dmitry Eremin-Solenikov
Quoted 4 lines · Dmitry Eremin-Solenikov

qemu-native can use SDL backend for graphical output. Currently it is expected to use libsdl provided by the host. However this can lead to library incompatibilities between host and target. Make libsdl recipe support native compilation.

I don't object to the patch.. but we did have multiple problems in the past where libsdl (native) did not work with the host systems X11 or what-ever.

Various failure conditions about not linking, linking to the wrong libsdl, or execution failing are what made us prefer the host system's libsdl -- or simply disabling libsdl altogether.

--Mark

Quoted 24 lines
---
 meta/recipes-graphics/libsdl/libsdl_1.2.15.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-graphics/libsdl/libsdl_1.2.15.bb +2 -1
index c0d5c6a..c9f3e00 100644
@@ -17,6 +17,7 @@ DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d
            ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11 libxext libxrandr libxrender', '', d)} \
            ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'libglu', '', d)} \
            tslib"
+DEPENDS_class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11-native libxrandr-native libxrender-native libxext-native', '', d)}"
 DEPENDS_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11 nativesdk-libxrandr nativesdk-libxrender nativesdk-libxext', '', d)}"
 
 PR = "r3"
@@ -65,4 +66,4 @@ do_configure_prepend() {
         export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
 }
 
-BBCLASSEXTEND = "nativesdk"
+BBCLASSEXTEND = "native nativesdk"
#4 lore raw
Quoted 6 lines · Mark Hatle
Quoted 4 lines · Dmitry Eremin-Solenikov

qemu-native can use SDL backend for graphical output. Currently it is expected to use libsdl provided by the host. However this can lead to library incompatibilities between host and target. Make libsdl recipe support native compilation.

Quoted 6 lines

I don't object to the patch.. but we did have multiple problems in the past where libsdl (native) did not work with the host systems X11 or what-ever.

Various failure conditions about not linking, linking to the wrong libsdl, or execution failing are what made us prefer the host system's libsdl -- or simply disabling libsdl altogether.

This is my big worry too. I remember a lot of problems trying to build a libsdl that worked on all of the different linux distros someone might run on. Previously we found that assuming a working libsdl or disabling it was much easier.

How wide has the testing if this patch series been?

Cheers,

Richard

#5 lore raw
In reply to Mark Hatle

Hello,

2015-10-19 17:44 GMT+03:00 Mark Hatle <[email protected]>:

Quoted 6 lines · Dmitry Eremin-Solenikov
Quoted 4 lines

qemu-native can use SDL backend for graphical output. Currently it is expected to use libsdl provided by the host. However this can lead to library incompatibilities between host and target. Make libsdl recipe support native compilation.

Quoted 6 lines

I don't object to the patch.. but we did have multiple problems in the past where libsdl (native) did not work with the host systems X11 or what-ever.

Various failure conditions about not linking, linking to the wrong libsdl, or execution failing are what made us prefer the host system's libsdl -- or simply disabling libsdl altogether.

The issue that get me to this patch was an issue with linking of qemu. Debian provides versioned symbols in libdbus, OE does not. Libdbus from sysroot overrode system one. So system libsdl which used system-wide libpulse* (which expected libdbus with versioned symbols) could not be linked to the qemu.

Richard: this was tested on my system only. If you don't want to break things before release, what about merging them after next Yocto/OE-Core release?

Quoted 28 lines

--Mark

Quoted 24 lines
---
 meta/recipes-graphics/libsdl/libsdl_1.2.15.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-graphics/libsdl/libsdl_1.2.15.bb +2 -1
index c0d5c6a..c9f3e00 100644
@@ -17,6 +17,7 @@ DEPENDS = "${@bb.utils.contains('DISTRO_FEATURES', 'directfb', 'directfb', '', d
            ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11 libxext libxrandr libxrender', '', d)} \
            ${@bb.utils.contains('DISTRO_FEATURES', 'x11 opengl', 'libglu', '', d)} \
            tslib"
+DEPENDS_class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/libx11-native libxrandr-native libxrender-native libxext-native', '', d)}"
 DEPENDS_class-nativesdk = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'virtual/nativesdk-libx11 nativesdk-libxrandr nativesdk-libxrender nativesdk-libxext', '', d)}"
 
 PR = "r3"
@@ -65,4 +66,4 @@ do_configure_prepend() {
         export SYSROOT=$PKG_CONFIG_SYSROOT_DIR
 }
 
-BBCLASSEXTEND = "nativesdk"
+BBCLASSEXTEND = "native nativesdk"
Signature · 2 lines
With best wishes
Dmitry