[OE-core] [meson][PATCH] meson: Allow for llvm-native tools to be used

Peter Kjellerstedt peter.kjellerstedt at axis.com
Fri Dec 27 12:03:17 UTC 2019


If we're adding a --native-file, shouldn't it always be specified, regardless of --cross-file?
Also, it looks as most of what is currently done in override_native_tools() and meson_do_configure_prepend_class-native() could be moved to the native-file (the exception seems to be the unsetting of CPPFLAGS, CFLAGS, CXXFLAGS and LDFLAGS).

//Peter

From: openembedded-core-bounces at lists.openembedded.org <openembedded-core-bounces at lists.openembedded.org> On Behalf Of fdk17
Sent: den 25 december 2019 12:49
To: openembedded-core at lists.openembedded.org
Subject: [OE-core] [meson][PATCH] meson: Allow for llvm-native tools to be used

I created a bbappend to build the LLVM recipe so that all the libraries were available for use on the host.
These libraries are then used by a host/sdk tool to prepare binary files for use by an application on the target.
When building our tool using meson it wasn't able to find the Yocto built LLLVM libraries.
This fixes the issue so meson uses the correct llvm-config tool.

Author: Fred Baksik <fred.baksik at mrcy.com<mailto:fred.baksik at mrcy.com>>
Date:   Tue Dec 24 20:38:47 2019 -0500

    meson: Allow for llvm-native tools to be used

    Signed-off-by: Fred Baksik <fred.baksik at mrcy.com<mailto:fred.baksik at mrcy.com>>

diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
index e1a13bbbf7..b5cd2ee8c4 100644
--- a/meta/classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -33,6 +33,7 @@ EXTRA_OEMESON_append = " ${PACKAGECONFIG_CONFARGS}"
 MESON_CROSS_FILE = ""
 MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
 MESON_CROSS_FILE_class-nativesdk = "--cross-file ${WORKDIR}/meson.cross"
+MESON_CROSS_FILE_class-native = "--native-file ${WORKDIR}/meson.native"

 def meson_array(var, d):
     items = d.getVar(var).split()
@@ -110,6 +111,14 @@ endian = '${@meson_endian('TARGET', d)}'
 EOF
 }

+do_write_config_class-native() {
+    # This needs to be Py to split the args into single-element lists
+    cat >${WORKDIR}/meson.native <<EOF
+[binaries]
+llvm-config = 'llvm-config${LLVMVERSION}'
+EOF
+}
+
 CONFIGURE_FILES = "meson.build"

 meson_do_configure() {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20191227/ed6dc563/attachment.html>


More information about the Openembedded-core mailing list