Skip to contentSkip to conversation

qemu: OpenSUSE 13.2 configure error

PATCH Superseded Juro Bystricky 4 participants 7 messages Jun 30, 2015 – Oct 12, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 qemu: OpenSUSE 13.2 configure error

Under some circumstances, on OpenSUSE 13.2 qemu-native configure can fail with the error:

ERROR: User requested feature sdl
configure was not able to find it

The following sequence can reproduce the build error:

$ bitbake libgpg-error-native
$ bitbake qemu-native

Qemu configure tests for the presence/existance of SDL by trying to link against libSDL. libSDL in turn attempts to load libcrypt which will then attempt to load libgpg-error. The bitbaked libgpg-error will be built with ABI incompatible with the one required by libcrypt.
The remedy is to force qemu configure to use the host's libgpg-error instead. This is achieved by modifying the linker library search order.

[YOCTO#7469]

---
 .../qemu/files/qemu-libcrypt-search-path-fix.patch | 37 ++++++++++++++++++++++
 meta/recipes-devtools/qemu/qemu_1.7.0.bb           |  4 ++-
 2 files changed, 40 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/qemu/files/qemu-libcrypt-search-path-fix.patch
meta/recipes-devtools/qemu/files/qemu-libcrypt-search-path-fix.patch new file +37 -0
new file mode 100644
index 0000000..e44d883
@@ -0,0 +1,37 @@
+--- a/configure
++++ b/configure
+@@ -1802,6 +1802,8 @@ if test -n "$cross_prefix" && test "$(ba
+ fi
+ 
+ sdl_too_old=no
++sdl_cflags_ex="-L/usr/lib  -L/usr/lib64 -Wl,-rpath-link,/usr/lib  -Wl,-rpath-link,/usr/lib64"
++ 
+ if test "$sdl" != "no" ; then
+   cat > $TMPC << EOF
+ #include <SDL.h>
+@@ -1814,7 +1816,7 @@ EOF
+   else
+     sdl_libs=`$sdlconfig --libs 2> /dev/null`
+   fi
+-  if compile_prog "$sdl_cflags" "$sdl_libs" ; then
++  if compile_prog "$sdl_cflags $sdl_cflags_ex" "$sdl_libs" ; then
+     if test "$_sdlversion" -lt 121 ; then
+       sdl_too_old=yes
+     else
+@@ -1853,7 +1855,7 @@ if test "$sdl" = "yes" ; then
+ #endif
+ int main(void) { return 0; }
+ EOF
+-  if compile_prog "$sdl_cflags" "$sdl_libs" ; then
++  if compile_prog "$sdl_cflags $sdl_cflags_ex" "$sdl_libs" ; then
+     sdl_libs="$sdl_libs -lX11"
+   fi
+   libs_softmmu="$sdl_libs $libs_softmmu"
+@@ -4287,6 +4289,7 @@ echo "OBJCOPY=$objcopy" >> $config_host_
+ echo "LD=$ld" >> $config_host_mak
+ echo "WINDRES=$windres" >> $config_host_mak
+ echo "LIBTOOL=$libtool" >> $config_host_mak
++CFLAGS="$CFLAGS $sdl_cflags_ex"
+ echo "CFLAGS=$CFLAGS" >> $config_host_mak
+ echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
+ echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
meta/recipes-devtools/qemu/qemu_1.7.0.bb +3 -1
index a519645..a44a6f7 100644
@@ -6,7 +6,9 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=441c28d2cf86e15a37fa47e15a72fbac \
 SRC_URI += "file://fxrstorssefix.patch \
             file://qemu-enlarge-env-entry-size.patch \
             file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
-            file://ide-CVE-2014-2894.patch"
+            file://ide-CVE-2014-2894.patch \
+            file://qemu-libcrypt-search-path-fix.patch \
+            "
 
 SRC_URI_prepend = "http://wiki.qemu.org/download/qemu-${PV}.tar.bz2"
 SRC_URI[md5sum] = "32893941d40d052a5e649efcf06aca06"
Signature · 1 line
2.1.4
#1 lore raw
Quoted 9 lines · Juro Bystricky

Qemu configure tests for the presence/existance of SDL by trying to link against libSDL. libSDL in turn attempts to load libcrypt which will then attempt to load libgpg-error. The bitbaked libgpg-error will be built with ABI incompatible with the one required by libcrypt.
The remedy is to force qemu configure to use the host's libgpg-error instead. This is achieved by modifying the linker library search order.

I think seeing this summary will send Saul into a quivering wreck as this was a massive source of pain in the previous release. Interesting solution but I'd like Saul's opinion.

The patch should probably only be applied for native and nativesdk builds, as I suspect that's going to break a target build quite badly. Also, it needs signed-of-by and upstream-status (inappropriate, I imagine) tags in the patch header.

Ross

#2 lore raw
Quoted 5 lines · Ross

The patch should probably only be applied for native and nativesdk builds, as I suspect that's going to break a target build quite badly. Also, it needs signed-of-by and upstream-status (inappropriate, I imagine) tags in the patch header

Richard just pointed out I'm wrong here - apply to just native and not nativesdk.

Ross

#3 lore raw
In reply to Burton, Ross
Quoted 12 lines · Ross

On 30 June 2015 at 01:16, Juro Bystricky <[email protected]> wrote:
Qemu configure tests for the presence/existance of SDL by trying to link against libSDL. libSDL in turn attempts to load libcrypt which will then attempt to load libgpg-error. The bitbaked libgpg-error will be built with ABI incompatible with the one required by libcrypt.
The remedy is to force qemu configure to use the host's libgpg-error instead. This is achieved by modifying the linker library search order.

Quoted 4 lines

I think seeing this summary will send Saul into a quivering wreck as this was a massive source of pain in the previous release. Interesting solution but I'd like Saul's opinion.

If backporting this means we don't have to reconfigure the autobuilder to run old releases, Saul, Beth and I are likely all in favour.

Quoted 5 lines

The patch should probably only be applied for native and nativesdk builds, as I suspect that's going to break a target build quite badly. Also, it needs signed-of-by and upstream-status (inappropriate, I imagine) tags in the patch header.

It needs a description and the patch should be native only, not nativesdk which should link against the sysroot.

Cheers,

Richard

#4 lore raw
Quoted 13 lines · Richard Purdie
Quoted 12 lines · Ross

On 30 June 2015 at 01:16, Juro Bystricky <[email protected]> wrote:
Qemu configure tests for the presence/existance of SDL by trying to link against libSDL. libSDL in turn attempts to load libcrypt which will then attempt to load libgpg-error. The bitbaked libgpg-error will be built with ABI incompatible with the one required by libcrypt.
The remedy is to force qemu configure to use the host's libgpg-error instead. This is achieved by modifying the linker library search order.

Quoted 6 lines
Quoted 4 lines

I think seeing this summary will send Saul into a quivering wreck as this was a massive source of pain in the previous release. Interesting solution but I'd like Saul's opinion.

If backporting this means we don't have to reconfigure the autobuilder to run old releases, Saul, Beth and I are likely all in favour.

The quivering stop long ago when I handed this off to Juro! I am all in favor of this patch and a backport.

Thanks Juro for figuring this out.

Sau!

Quoted 15 lines
Quoted 5 lines

The patch should probably only be applied for native and nativesdk builds, as I suspect that's going to break a target build quite badly. Also, it needs signed-of-by and upstream-status (inappropriate, I imagine) tags in the patch header.

It needs a description and the patch should be native only, not nativesdk which should link against the sysroot.

Cheers,

Richard

#5 lore raw

v2 cover OpenSUSE 13.2 qemu configuration

In reply to Richard Purdie

Modified patch to fix
https://bugzilla.yoctoproject.org/show_bug.cgi?id=7469

Juro Bystricky (1):
qemu: OpenSUSE 13.2 configure error

 .../qemu/files/qemu-libcrypt-search-path-fix.patch | 37 ++++++++++++++++++++++
 meta/recipes-devtools/qemu/qemu_1.7.0.bb           |  2 ++
 2 files changed, 39 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/files/qemu-libcrypt-search-path-fix.patch
Signature · 1 line
2.1.4
#6 lore raw

PATCH v2 1/1 qemu: OpenSUSE 13.2 configure error

Under some circumstances, on OpenSUSE 13.2 qemu-native configure can fail with the error:

ERROR: User requested feature sdl
configure was not able to find it

The following sequence can reproduce the build error:

$ bitbake libgpg-error-native
$ bitbake qemu-native

Qemu configure tests for the presence/existance of SDL by trying to link against libSDL. libSDL in turn attempts to load libcrypt which will then attempt to load libgpg-error. The bitbaked libgpg-error will be built with ABI incompatible with the one required by libcrypt.
The remedy is to force qemu configure to use the host's libgpg-error instead. This is achieved by modifying the linker library search order.

[YOCTO#7469]

Upstream-Status: Inappropriate [configuration]

---
 .../qemu/files/qemu-libcrypt-search-path-fix.patch | 37 ++++++++++++++++++++++
 meta/recipes-devtools/qemu/qemu_1.7.0.bb           |  2 ++
 2 files changed, 39 insertions(+)
 create mode 100644 meta/recipes-devtools/qemu/files/qemu-libcrypt-search-path-fix.patch
meta/recipes-devtools/qemu/files/qemu-libcrypt-search-path-fix.patch new file +37 -0
new file mode 100644
index 0000000..e44d883
@@ -0,0 +1,37 @@
+--- a/configure
++++ b/configure
+@@ -1802,6 +1802,8 @@ if test -n "$cross_prefix" && test "$(ba
+ fi
+ 
+ sdl_too_old=no
++sdl_cflags_ex="-L/usr/lib  -L/usr/lib64 -Wl,-rpath-link,/usr/lib  -Wl,-rpath-link,/usr/lib64"
++ 
+ if test "$sdl" != "no" ; then
+   cat > $TMPC << EOF
+ #include <SDL.h>
+@@ -1814,7 +1816,7 @@ EOF
+   else
+     sdl_libs=`$sdlconfig --libs 2> /dev/null`
+   fi
+-  if compile_prog "$sdl_cflags" "$sdl_libs" ; then
++  if compile_prog "$sdl_cflags $sdl_cflags_ex" "$sdl_libs" ; then
+     if test "$_sdlversion" -lt 121 ; then
+       sdl_too_old=yes
+     else
+@@ -1853,7 +1855,7 @@ if test "$sdl" = "yes" ; then
+ #endif
+ int main(void) { return 0; }
+ EOF
+-  if compile_prog "$sdl_cflags" "$sdl_libs" ; then
++  if compile_prog "$sdl_cflags $sdl_cflags_ex" "$sdl_libs" ; then
+     sdl_libs="$sdl_libs -lX11"
+   fi
+   libs_softmmu="$sdl_libs $libs_softmmu"
+@@ -4287,6 +4289,7 @@ echo "OBJCOPY=$objcopy" >> $config_host_
+ echo "LD=$ld" >> $config_host_mak
+ echo "WINDRES=$windres" >> $config_host_mak
+ echo "LIBTOOL=$libtool" >> $config_host_mak
++CFLAGS="$CFLAGS $sdl_cflags_ex"
+ echo "CFLAGS=$CFLAGS" >> $config_host_mak
+ echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
+ echo "QEMU_INCLUDES=$QEMU_INCLUDES" >> $config_host_mak
meta/recipes-devtools/qemu/qemu_1.7.0.bb +2 -0
index a519645..812d372 100644
@@ -7,6 +7,8 @@ SRC_URI += "file://fxrstorssefix.patch \
             file://qemu-enlarge-env-entry-size.patch \
             file://Qemu-Arm-versatilepb-Add-memory-size-checking.patch \
             file://ide-CVE-2014-2894.patch"
+            
+SRC_URI_append_virtclass-native = " file://qemu-libcrypt-search-path-fix.patch"
 
 SRC_URI_prepend = "http://wiki.qemu.org/download/qemu-${PV}.tar.bz2"
 SRC_URI[md5sum] = "32893941d40d052a5e649efcf06aca06"
Signature · 1 line
2.1.4