Bug 13571 - Meson cross detection is broken
Summary: Meson cross detection is broken
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: devtools / tool chain (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 2.8 M4
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2019-10-04 00:26 UTC by Ross Burton
Modified: 2019-10-17 14:54 UTC (History)
2 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ross Burton 2019-10-04 00:26:16 UTC
Upstream Meson fails to detect cross if host and target are compatible (x86->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've filed https://github.com/mesonbuild/meson/issues/5993 upstream to track this but we need to fix this for M4 I think.
Comment 1 Alexander Kanavin 2019-10-04 09:26:52 UTC
How can I reproduce this?
Comment 2 Alexander Kanavin 2019-10-04 09:29:53 UTC
Maybe we can simply apply this patch only for native and nativesdk but not for target? Meanwhile hopefully upstream will sort this out.
Comment 3 Ross Burton 2019-10-07 09:46:22 UTC
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've a patch which does this:

      def is_cross_build(self) -> bool:
-        return self.need_exe_wrapper()
+        return bool(self.coredata.cross_files)

Appears to work.
Comment 4 Ross Burton 2019-10-07 09:51:34 UTC
Good news is that over the weekend Jussi merged a fix upstream.
Comment 5 Ross Burton 2019-10-17 14:54:07 UTC
Fixed in oe-core 9aa543aa9bd78c63343ae28fc85113ca2c9e0094.