Skip to contentSkip to conversation

meson: Allow for llvm-native tools to be used

PATCH In review [email protected] 2 participants 2 messages Dec 25, 2019 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 <[email protected]>
Date:   Tue Dec 24 20:38:47 2019 -0500

meson: Allow for llvm-native tools to be used

meta/classes/meson.bbclass +0 -0
index e1a13bbbf7..b5cd2ee8c4 100644
@@ -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() {

#1 lore raw

This should be going to the oe-core list.

Alex

Quoted 52 lines · On Wed, 25 Dec 2019 at 12:24, <[email protected]> wrote:

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 <[email protected]>
Date:   Tue Dec 24 20:38:47 2019 -0500

meson: Allow for llvm-native tools to be used

meta/classes/meson.bbclass +9 -0
index e1a13bbbf7..b5cd2ee8c4 100644
@@ -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() { -=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.

View/Reply Online (#47821):
https://lists.yoctoproject.org/g/yocto/message/47821
Mute This Topic: https://lists.yoctoproject.org/mt/69260511/1686489
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-