From: Ross Burton <ross.burton@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 3/6] meson: pass correct endian in the cross file
Date: Tue, 25 Sep 2018 14:43:45 +0100 [thread overview]
Message-ID: <20180925134348.5562-3-ross.burton@intel.com> (raw)
In-Reply-To: <20180925134348.5562-1-ross.burton@intel.com>
Meson doesn't care for the value of the endian field, but packages may want to
use it and Meson master now validates the value.
Use siteinfo to obtain the endianism and write the correct value.
Signed-off-by: Ross Burton <ross.burton@intel.com>
---
meta/classes/meson.bbclass | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index e3b452786d8..07322cf7865 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -1,4 +1,4 @@
-inherit python3native
+inherit siteinfo python3native
DEPENDS_append = " meson-native ninja-native"
@@ -31,10 +31,6 @@ MESON_C_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CFLAGS}"
MESON_CPP_ARGS = "${MESON_TOOLCHAIN_ARGS} ${CXXFLAGS}"
MESON_LINK_ARGS = "${MESON_TOOLCHAIN_ARGS} ${LDFLAGS}"
-# both are required but not used by meson
-MESON_HOST_ENDIAN = "bogus-endian"
-MESON_TARGET_ENDIAN = "bogus-endian"
-
EXTRA_OEMESON_append = " ${PACKAGECONFIG_CONFARGS}"
MESON_CROSS_FILE = ""
@@ -59,6 +55,16 @@ def meson_cpu_family(var, d):
else:
return arch
+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))
+
addtask write_config before do_configure
do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF"
do_write_config() {
@@ -86,13 +92,13 @@ gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper'
system = '${HOST_OS}'
cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}'
cpu = '${HOST_ARCH}'
-endian = '${MESON_HOST_ENDIAN}'
+endian = '${@meson_endian('HOST', d)}'
[target_machine]
system = '${TARGET_OS}'
cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}'
cpu = '${TARGET_ARCH}'
-endian = '${MESON_TARGET_ENDIAN}'
+endian = '${@meson_endian('TARGET', d)}'
EOF
}
--
2.11.0
next prev parent reply other threads:[~2018-09-25 13:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-25 13:43 [PATCH 1/6] siteinfo: generalise siteinfo Ross Burton
2018-09-25 13:43 ` [PATCH 2/6] meson: squash the architecture warning patches together Ross Burton
2018-09-25 13:43 ` Ross Burton [this message]
2018-09-25 13:43 ` [PATCH 4/6] meson: stop Meson using target CFLAGS in native builds Ross Burton
2018-09-25 13:43 ` [PATCH 5/6] meson: respect target/native flag distinction in G-I and gtk-doc Ross Burton
2018-09-25 13:43 ` [PATCH 6/6] meson: make native-specific patches native-specific Ross Burton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180925134348.5562-3-ross.burton@intel.com \
--to=ross.burton@intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox