Subject: [meson][PATCH] meson: Allow for llvm-native tools to be used To: yocto@lists.yoctoproject.org From: fdk17@ftml.net X-Originating-Location: Ann Arbor, Michigan, US (68.40.190.43) X-Originating-Platform: Linux Firefox 71 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Wed, 25 Dec 2019 03:24:27 -0800 Message-ID: Content-Type: multipart/alternative; boundary="f1SWVKlXfJaZymc3wzl8" --f1SWVKlXfJaZymc3wzl8 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I created a bbappend to build the LLVM recipe so that all the libraries wer= e available for use on the host. These libraries are then used by a host/sdk tool to prepare binary files f= or 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 Date:=C2=A0=C2=A0 Tue Dec 24 20:38:47 2019 -0500 meson: Allow for llvm-native tools to be used Signed-off-by: Fred Baksik 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 =3D " ${PACKAGECONFIG_CONFARGS}" MESON_CROSS_FILE =3D "" MESON_CROSS_FILE_class-target =3D "--cross-file ${WORKDIR}/meson.cross" MESON_CROSS_FILE_class-nativesdk =3D "--cross-file ${WORKDIR}/meson.cross" +MESON_CROSS_FILE_class-native =3D "--native-file ${WORKDIR}/meson.native" def meson_array(var, d): items =3D d.getVar(var).split() @@ -110,6 +111,14 @@ endian =3D '${@meson_endian('TARGET', d)}' EOF } +do_write_config_class-native() { +=C2=A0=C2=A0=C2=A0 # This needs to be Py to split the args into single-el= ement lists +=C2=A0=C2=A0=C2=A0 cat >${WORKDIR}/meson.native <These libraries are then used by a ho= st/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@mrcy.com&g= t;
Date:   Tue Dec 24 20:38:47 2019 -0500

 &= nbsp;  meson: Allow for llvm-native tools to be used
  =  
    Signed-off-by: Fred Baksik <fred.baksik@= mrcy.com>

diff --git a/meta/classes/meson.bbclass b/meta/clas= ses/meson.bbclass
index e1a13bbbf7..b5cd2ee8c4 100644
--- a/meta/= classes/meson.bbclass
+++ b/meta/classes/meson.bbclass
@@ -33,6 += 33,7 @@ EXTRA_OEMESON_append =3D " ${PACKAGECONFIG_CONFARGS}"
 ME= SON_CROSS_FILE =3D ""
 MESON_CROSS_FILE_class-target =3D "--cross= -file ${WORKDIR}/meson.cross"
 MESON_CROSS_FILE_class-nativesdk = =3D "--cross-file ${WORKDIR}/meson.cross"
+MESON_CROSS_FILE_class-nat= ive =3D "--native-file ${WORKDIR}/meson.native"
 
 def = meson_array(var, d):
     items =3D d.getVar(var).= split()
@@ -110,6 +111,14 @@ endian =3D '${@meson_endian('TARGET', d)}= '
 EOF
 }
 
+do_write_config_class-nativ= e() {
+    # This needs to be Py to split the args into= single-element lists
+    cat >${WORKDIR}/meson.nat= ive <<EOF
+[binaries]
+llvm-config =3D 'llvm-config${LLVMVE= RSION}'
+EOF
+}
+
 CONFIGURE_FILES =3D "meson.buil= d"
 
 meson_do_configure() { --f1SWVKlXfJaZymc3wzl8--