diff mbox series

[4/7] meson: write correct host endian into SDK cross file

Message ID 20190107163823.31816-4-ross.burton@intel.com
State Accepted
Commit 1239157805a4c363da853de6db05c53083b01189
Headers show
Series [1/7] toolchain-scripts: run post-relocate scripts for every environment | expand

Commit Message

Ross Burton Jan. 7, 2019, 4:38 p.m. UTC
Meson doesn't ignore this but will emit a warning, so write the correct value.

Signed-off-by: Ross Burton <ross.burton@intel.com>

---
 meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

-- 
2.11.0

-- 
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
diff mbox series

Patch

diff --git a/meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb b/meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb
index 55c57775e06..1549357a554 100644
--- a/meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb
+++ b/meta/recipes-devtools/meson/nativesdk-meson_0.49.0.bb
@@ -1,13 +1,20 @@ 
 include meson.inc
 
 inherit nativesdk
+inherit siteinfo
 
 SRC_URI += "file://meson-setup.py \
             file://meson-wrapper"
 
-# both are required but not used by meson
-MESON_SDK_ENDIAN = "bogus-endian"
-MESON_TARGET_ENDIAN = "bogus-endian"
+def meson_endian(prefix, d):
+    arch, os = d.getVar(prefix + "_ARCH"), d.getVar(prefix + "_OS")
+    sitedata = siteinfo_data_for_machine(arch, os, d)
+    if "endian-little" in sitedata:
+        return "little"
+    elif "endian-big" in sitedata:
+        return "big"
+    else:
+        bb.fatal("Cannot determine endianism for %s-%s" % (arch, os))
 
 MESON_TOOLCHAIN_ARGS = "${BUILDSDK_CC_ARCH}${TOOLCHAIN_OPTIONS}"
 MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${BUILDSDK_CFLAGS}"
@@ -44,7 +51,7 @@  cpp_link_args = @LDFLAGS
 system = '${SDK_OS}'
 cpu_family = '${SDK_ARCH}'
 cpu = '${SDK_ARCH}'
-endian = '${MESON_SDK_ENDIAN}'
+endian = '${@meson_endian("SDK", d)}'
 EOF
 
     install -d ${D}${SDKPATHNATIVE}/post-relocate-setup.d