<?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>13571</bug_id>
          
          <creation_ts>2019-10-04 00:26:16 +0000</creation_ts>
          <short_desc>Meson cross detection is broken</short_desc>
          <delta_ts>2019-10-17 14:54:07 +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>unspecified</version>
          <rep_platform>x86</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>normal</bug_severity>
          <target_milestone>2.8 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>85206</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-10-04 00:26:16 +0000</bug_when>
    <thetext>Upstream Meson fails to detect cross if host and target are compatible (x86-&gt;x86).

We patch Meson to check if an exe_wrapper is needed instead (0001-mesonbuild-environment.py-do-not-determine-whether-a.patch).  This appears to work for cross builds but the same patch breaks builds on target where it believes that an exe wrapper is needed and believes that a native build is cross.

I&apos;ve filed https://github.com/mesonbuild/meson/issues/5993 upstream to track this but we need to fix this for M4 I think.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85211</commentid>
    <comment_count>1</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2019-10-04 09:26:52 +0000</bug_when>
    <thetext>How can I reproduce this?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85212</commentid>
    <comment_count>2</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2019-10-04 09:29:53 +0000</bug_when>
    <thetext>Maybe we can simply apply this patch only for native and nativesdk but not for target? Meanwhile hopefully upstream will sort this out.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85243</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-10-07 09:46:22 +0000</bug_when>
    <thetext>The reproducer is to try a build on target using Meson: it will detect as cross due to the change in 0001-mesonbuild-environment.py-do-not-determine-whether-a.patch.

Removing the patch will break cross builds if the machines match.

I&apos;ve a patch which does this:

      def is_cross_build(self) -&gt; bool:
-        return self.need_exe_wrapper()
+        return bool(self.coredata.cross_files)

Appears to work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85244</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-10-07 09:51:34 +0000</bug_when>
    <thetext>Good news is that over the weekend Jussi merged a fix upstream.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85370</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2019-10-17 14:54:07 +0000</bug_when>
    <thetext>Fixed in oe-core 9aa543aa9bd78c63343ae28fc85113ca2c9e0094.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>