meson: Allow for llvm-native tools to be used
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 +9 -0
@@ -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() {
✗ patchtest: failure for meson: Allow for llvm-native tools to be used
== Series Details ==
Series: meson: Allow for llvm-native tools to be used
Revision: 1
URL : https://patchwork.openembedded.org/series/21757/
State : failure
== Summary ==
Thank you for submitting this patch series to OpenEmbedded Core. This is an automated response. Several tests have been executed on the proposed series by patchtest resulting in the following failures:
* Issue Series does not apply on top of target branch [test_series_merge_on_head]
Suggested fix Rebase your series on top of targeted branch
Targeted branch master (currently at d6c62cc030)
If you believe any of these test results are incorrect, please reply to the mailing list ([email protected]) raising your concerns. Otherwise we would appreciate you correcting the issues and submitting a new version of the patchset if applicable. Please ensure you add/increment the version number when sending the new version (i.e. [PATCH] -> [PATCH v2] -> [PATCH v3] -> ...).
---
Guidelines: https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest Test suite: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe
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: [email protected] <[email protected]> On Behalf Of fdk17
Sent: den 25 december 2019 12:49
To: [email protected]
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 <[email protected]<mailto:[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
@@ -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() {
Quoted 1 line · Peter Kjellerstedt
If we’re adding a --native-file, shouldn’t it always be specified, regardless of --cross-file?
I don't think so. It seems to me that it should be one or the other. If you are building a -native package then you don't need a native file and vice versa.
Quoted 1 line
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).
It could be but I didn't want to make unnecessary changes just to get llvm-native working. I think few people even attempt to use a native-llvm for anything other than building llvm. If anyone else needed this I would think that the llvm-native recipe would have been updated by now by others. In that regards this patch just not important. I was just putting it out there as this tripped me up for a few hours before understanding what was happening.
Quoted 7 lines · On Fri, Dec 27, 2019, at 9:25 AM, fdk17 wrote:
Quoted 1 line · Peter Kjellerstedt
If we’re adding a --native-file, shouldn’t it always be specified, regardless of --cross-file?
I don't think so. It seems to me that it should be one or the other. If you are building a -native package then you don't need a native file and vice versa.
Sorry I meant to write: If you are building a -native package then you don't need a cross file and vice versa.
I guess this change is not needed unless you have the updates to build a full llvm-native install. Those changes probably should be part of this. If there is any interest then I could make a new version for a working llvm-native with meson patch.
--
fdk17
Quoted 3 lines · Peter Kjellerstedt
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).
Right, I've had a mental TODO for this for some time but haven't got around to it.
Ross