Bug 8553 - qemu-native to build on Ubuntu 15.10
Summary: qemu-native to build on Ubuntu 15.10
Status: VERIFIED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 2.0
Hardware: All Multiple
: Medium+ normal
Target Milestone: 2.1
Assignee: Ross Burton
QA Contact: Mihail Stanciu
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2015-10-21 10:35 UTC by Mihail Stanciu
Modified: 2016-04-22 10:03 UTC (History)
14 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: Regression (Found by QA test)
Verified:
Documentation change: Yes (doc changes required)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mihail Stanciu 2015-10-21 10:35:44 UTC
Tested with master: 8578bc17b54da97d42b257b3c8f398ac52b91a9f
OS: Ubuntu 15.10 beta

Building a core-image-minimal fails with error:

| ERROR: User requested feature sdl
|        configure was not able to find it.
|        Install SDL devel


List of installed sdl packages:

libsdl1.2-dbg:amd64
libsdl1.2-dev
libsdl1.2debian:amd64
Comment 1 Ross Burton 2015-10-21 17:32:18 UTC
Workaround: add BUILD_LDFLAGS_prepend_pn-qemu-native = "-Wl,-rpath-link,/lib/x86_64-linux-gnu " to local.conf.
Comment 2 Ed Bartosh 2015-10-28 09:38:56 UTC
I'll take it. Please let me know if you already working on it.
Comment 3 Ross Burton 2015-10-28 17:15:25 UTC
For anyone not able to replicate, this is what happens:

libpulsecommon-6.0.so: undefined reference to `dbus_watch_get_enabled@LIBDBUS_1_3'
Comment 4 Ed Bartosh 2015-10-29 09:03:37 UTC
The strange thing is that when I run the same configure command manually it works just fine. It must be something in the environment.
Comment 5 Ed Bartosh 2015-10-29 09:35:38 UTC
unset LDFLAGS before running configure made it working. I'll dig further.
Comment 6 Ed Bartosh 2015-10-29 10:30:03 UTC
The reason is this part of LDFLAGS: -Wl,-rpath-link,/home/ed/yocto/poky/build/tmp/sysroots/i686-linux/lib

Because of above rpath option linker takes yocto dbus libraries instead of host ones and breaks as some symbols required by pulseaudio are not provided by yocto dbus.
Comment 7 Ed Bartosh 2015-10-29 13:22:30 UTC
Both qemu and qemu-native builds worked for me on Ubuntu 15.10 and OpenSUSE 12.3 with this patch: https://gist.github.com/bartosh/b589e457a9fe60640fe1

The patch just clears up LDFLAGS and CFLAGS, making the build to use only host libraries. Mixing yocto native libraries with host libraries can and will cause similar build issues from my point of view.


Thoughts?
Comment 8 Richard Purdie 2015-10-30 07:09:13 UTC
(In reply to comment #7)
> Both qemu and qemu-native builds worked for me on Ubuntu 15.10 and OpenSUSE
> 12.3 with this patch: https://gist.github.com/bartosh/b589e457a9fe60640fe1
> 
> The patch just clears up LDFLAGS and CFLAGS, making the build to use only
> host libraries. Mixing yocto native libraries with host libraries can and
> will cause similar build issues from my point of view.
> 
> 
> Thoughts?

If you look at the qemu recipe, there are a number of DEPENDS which it expects to find built by the OE build process. I tried your patch and saw:

| ERROR: User requested feature uuid
|        configure was not able to find it.
|        Install libuuid devel

for example (since the util-linux-native dependency is now masked out. We'd also have similar issues if the host didn't have glib-2.0-devel, zlib-devel and so on.

Its therefore not this simple unfortunately, you just have a lot of -devel packages installed on the machine you tested on.
Comment 9 Richard Purdie 2015-10-30 07:09:36 UTC
I suspect upgrading dbus to the newer version will "fix" this btw.
Comment 10 Ed Bartosh 2015-10-30 09:25:00 UTC
I agree that upgrading dbus might fix this issue for Ubuntu. However it might break it for other distro(s). My point was that we should choose one way(link qemu with yocto libs) or another(link with system libs) instead of balancing on the edge as we do now.

I can try to upgrade dbus, but it can potentially break qemu build on other distros. Are you sure we want that now?
Comment 11 Ed Bartosh 2015-10-31 22:22:00 UTC
Upgraded dbus: http://lists.openembedded.org/pipermail/openembedded-core/2015-October/112168.html
Tested on Ubuntu 15.10 and OpenSUSE 13.2 by building core-image-minimal and running it with runqemu script. It worked just fine.


Tried an idea of running configure several times until it succeeds:
 - first time without any additional options
 - second time with adding output of pkg-config --libs sdl to LDFLAGS
 - third time with adding output of pkg-config --libs dbus-1 to LDFLAGS
Does this make sense for you?
Comment 12 Ed Bartosh 2015-11-02 08:57:14 UTC
dbus upgrade has been rejected: http://lists.openembedded.org/pipermail/openembedded-core/2015-November/112173.html

Any other ideas how to fix it? Does it make sense to try running configure several times?
Comment 13 Ed Bartosh 2015-11-03 13:02:07 UTC
Moved to 2.1 as upgrading dbus just before a release is too dangerous.
Comment 14 Ed Bartosh 2015-11-04 08:31:10 UTC
Sent workaround for review: http://lists.openembedded.org/pipermail/openembedded-core/2015-November/112207.html
Comment 15 Alexander Kanavin 2015-11-23 16:11:51 UTC
This happens on Debian testing/stretch/sid as well, for the same reason.
Comment 16 Ed Bartosh 2015-11-24 09:27:44 UTC
Do you want me to update a workaround to work for Debian?
Comment 17 Ed Bartosh 2015-11-24 10:22:49 UTC
Robert, Chen: Any plans for dbus upgrade?
My attempt to upgrade to 1.10 was rejected http://lists.openembedded.org/pipermail/openembedded-core/2015-November/112173.html as I tried to do it just before a release.

I'm just wondering if you can help with this?
Comment 18 Ross Burton 2015-11-24 10:32:31 UTC
Can you rework the workaround to remove the distro check and just do it all the time, and submit it to the list?
Comment 19 Ricardo Ribalda 2015-11-24 10:34:05 UTC
Probably a stupid question, but why dont we want to compile a host version of libsdl? if I got it right, it is the root of the problem.
Comment 20 Ross Burton 2015-11-24 10:39:40 UTC
Because that means building pulseaudio-native mesa-native gtk-native and more.
Comment 21 Ed Bartosh 2015-11-24 11:09:41 UTC
Sent updated patch: http://lists.openembedded.org/pipermail/openembedded-core/2015-November/113264.html

please review
Comment 22 Ross Burton 2015-11-26 17:26:20 UTC
Ed's patch appears to break on older systems with our friend the libx11/libext _XEatDataWords error.  Testing my patch on the autobuilder now.
Comment 23 Ed Bartosh 2015-12-03 14:59:05 UTC
How it went with your patch? Did it work?
Comment 24 Ross Burton 2015-12-07 12:25:07 UTC
After spending too long looking at this I decided we should build a libsdl-native after all.

I've a patch which adds libsdl-native support with a minimal PACKAGECONFIG so it doesn't massively pull in build dependencies.
Comment 25 Francisco Pedraza 2015-12-08 23:19:44 UTC
Thanks a lot for the help :)
Comment 26 Jan-Simon Moeller 2015-12-15 10:43:32 UTC
(In reply to comment #24)
> After spending too long looking at this I decided we should build a
> libsdl-native after all.
> 
> I've a patch which adds libsdl-native support with a minimal PACKAGECONFIG
> so it doesn't massively pull in build dependencies.


Can we do a backport to 2.0 for this then as it breaks with current distros like 15.10 ?

I agree on the "either native or target" linking - just no mix.
Comment 27 Ross Burton 2016-01-26 14:26:00 UTC
Poky switched over to building libsdl-native in 685daeb6e265ddbd28be0ef44dcc356727b99375.  oe-core was fixed in 3d6c31c3a4ff34376e17005a981bb55fc6f7a38f.
Comment 28 Mihail Stanciu 2016-02-11 13:48:58 UTC
Verified for 2.1_M2: 3d2c0f5902cacf9d8544bf263b51ef0dd1a7218c
Comment 29 Mihail Stanciu 2016-02-15 09:07:02 UTC
Still present in 2.0.1_rc6: 5b12268f6e17574999f91628a60e21711cf62ee4
Comment 30 Alexandru Georgescu 2016-03-02 08:31:01 UTC
(In reply to comment #29)
> Still present in 2.0.1_rc6: 5b12268f6e17574999f91628a60e21711cf62ee4

present in 2.0.1.rc7 as well
Comment 31 Tracy Graydon 2016-03-08 22:00:30 UTC
Incidentally, I just ran into this same issue with Debian 8 last night. I installed libsdl-dev to fix it, but I will try to reproduce it and add the particulars. Essentially the same error message as above.
Comment 32 Ross Burton 2016-03-08 22:44:42 UTC
If installing libsdl-dev works then that isn't the problem.  The problem is that on some distributions after installing libsdl-dev it still won't build.
Comment 33 Alexander 2016-04-21 20:13:54 UTC
I have remove the whitespace in build/conf/local.conf from the rows

PACKAGECONFIG_append_pn-qemu-native = "<here>sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = "<here>sdl" 

and add the line below to my local.conf file
BUILD_LDFLAGS_prepend_pn-qemu-native = "-Wl,-rpath-link,/lib/x86_64-linux-gnu"
now it works well.

here my currently local.conf

MACHINE ??= 'cgtimx6'
DISTRO ?= 'poky'
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES = "debug-tweaks"
USER_CLASSES ?= "buildstats image-mklibs"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"
PACKAGECONFIG_append_pn-qemu-native = "sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = "sdl"
ASSUME_PROVIDED += "libsdl-native"
CONF_VERSION = "1"

DL_DIR ?= "${BSPDIR}/downloads/"
ACCEPT_FSL_EULA = "1"
BUILD_LDFLAGS_prepend_pn-qemu-native = "-Wl,-rpath-link,/lib/x86_64-linux-gnu"



regards,

alex
Comment 34 Ross Burton 2016-04-21 21:34:28 UTC
That whitespace is actually important.  If you want to disable sdl the comment out those lines.

There's a series of patches to fix this properly in the jethro branch, which should be released as 2.0.2 shortly.
Comment 35 Alexander 2016-04-21 22:08:58 UTC
I don't understand, why is the whitespaces important actually?
Please explain this, to get more comprehension.
I just beginning to work with yocto.
Comment 36 Francisco Pedraza 2016-04-22 01:02:09 UTC
(In reply to comment #35)
> I don't understand, why is the whitespaces important actually?
> Please explain this, to get more comprehension.
> I just beginning to work with yocto.

Hi
In the latest versions of ubuntu this fix is not neede anymore.
Are you facing it?
Comment 37 Ross Burton 2016-04-22 07:57:38 UTC
_append doesn't insert whitespace so if the value is a whitespace separated list then you need to add your own whitespace.  If you are disabling SDL (which is likely what your packageconfig changes were doing) then you don't need any further changes to the qemu build, the linker flag changes were an attempt to make the build work when SDL is enabled.

Repeating that this is fixed in master and jethro branches, and will be released in 2.0.2 shortly.
Comment 38 Mihail Stanciu 2016-04-22 10:03:18 UTC
Marking as verified.