<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>15284</bug_id>
          
          <creation_ts>2023-11-17 11:04:51 +0000</creation_ts>
          <short_desc>qemu-system-native build fails depending on packages installed on build host</short_desc>
          <delta_ts>2024-02-01 16:07:46 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>4.2.3</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>minor</bug_severity>
          <target_milestone>5.0 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Christian Thießen">christian.thiessen</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>97274</commentid>
    <comment_count>0</comment_count>
    <who name="Christian Thießen">christian.thiessen</who>
    <bug_when>2023-11-17 11:04:51 +0000</bug_when>
    <thetext>On a Debian 12/bookworm build machine that happened to have libsndio-dev installed, a Yocto build of qemu-system-native fails with

| ../qemu-7.2.0/audio/sndioaudio.c:18:10: fatal error: sndio.h: No such file or directory                                                                                                                                                                      
|    18 | #include &lt;sndio.h&gt;                                                                                                                                                                                                                                   

It seems this happens due to poky/meta/recipes-devtools/qemu/qemu.inc setting BHOST_PKGCONFIG_PATH and thereby including the host pkg-config path. pkg-config thus finds the host sndio (as can be verified in log.do_configure), but
pkg-config --cflags sndio
returns an empty line because sndio.h is located in the standard path /usr/include. This path is then not searched during the build, causing the error.
The same problem would probably happen for other qemu dependencies that have headers directly in /usr/include, not in a subdirectory.

Possible solutions:
- If BHOST_PKGCONFIG_PATH is really only for finding sdl, we could implement a way to limit the search in the host path to only that package.
- If it is intended that pkg-config should also find other dependencies in the host path, pkg-config could be called with the --keep-system-cflags option so it emits a -I/usr/include (but that may lead to more headers being taken from there than we intended...)
- If we now always build libsdl2-native instead of using the host library, the whole mechanism might also be removed.
- If we keep everything as it is, the documentation could also be extended to list &quot;negative system requirements&quot;, i.e. removing all libraries qemu might depend on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97322</commentid>
    <comment_count>1</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2023-11-23 16:25:56 +0000</bug_when>
    <thetext>qemu-system-native is special in that its one of the few packages allowed to look on the build host for libraries.  I&apos;m guessing we don&apos;t want to enable sndio by default, so the easiest thing would be to explicitly add -Dsndio=disabled to EXTRA_OECMAKE.

Would you be able to test that and send a patch?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97926</commentid>
    <comment_count>2</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2024-01-19 12:58:25 +0000</bug_when>
    <thetext>Patch on the list.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98095</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2024-02-01 16:07:46 +0000</bug_when>
    <thetext>Merged in e746182638aeb9bdd1bbb7430de214d8d847a8b6.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>