[OE-core] [PATCH 1/4] meson.bbclass: fix to build for more projects

ChenQi Qi.Chen at windriver.com
Wed Feb 28 08:55:56 UTC 2018


On 02/28/2018 04:25 PM, Khem Raj wrote:
> On Tue, Feb 27, 2018 at 9:56 PM, Chen Qi <Qi.Chen at windriver.com> wrote:
>> We should use the value of CC for the c compiler setting in cross
>> compilation configuration file for meson. For example, if we only
>> use ${HOST_PREFIX}gcc instead of ${CC}, we would meet the following
>> do_compile failure for systemd.
>>
>>    cc1: fatal error: linux/capability.h: No such file or directory
>>
>> Signed-off-by: Chen Qi <Qi.Chen at windriver.com>
>> ---
>>   meta/classes/meson.bbclass | 13 ++++---------
>>   1 file changed, 4 insertions(+), 9 deletions(-)
>>
>> diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass
>> index 31d32a5..97dcf81 100644
>> --- a/meta/classes/meson.bbclass
>> +++ b/meta/classes/meson.bbclass
>> @@ -41,24 +41,19 @@ MESON_CROSS_FILE = ""
>>   MESON_CROSS_FILE_class-target = "--cross-file ${WORKDIR}/meson.cross"
>>   MESON_CROSS_FILE_class-nativesdk = "--cross-file ${WORKDIR}/meson.cross"
>>
>> -CCOMPILER ?= "gcc"
>> -CXXCOMPILER ?= "g++"
>> -CCOMPILER_toolchain-clang = "clang"
>> -CXXCOMPILER_toolchain-clang = "clang++"
>> -
>>   def meson_array(var, d):
>>       return "', '".join(d.getVar(var).split()).join(("'", "'"))
>>
>>   addtask write_config before do_configure
>> -do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS"
>> +do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD"
>>   do_write_config() {
>>       # This needs to be Py to split the args into single-element lists
>>       cat >${WORKDIR}/meson.cross <<EOF
>>   [binaries]
>> -c = '${HOST_PREFIX}${CCOMPILER}'
>> -cpp = '${HOST_PREFIX}${CXXCOMPILER}'
>> +c = [${@meson_array('CC', d)}]
>> +cpp = [${@meson_array('CXX', d)}]
>>   ar = '${HOST_PREFIX}ar'
>> -ld = '${HOST_PREFIX}ld'
>> +ld = [${@meson_array('LD', d)}]
>
> we should do same for ar and nm atleast.
>

Hi Khem,

As AR is set to be "${HOST_PREFIX}ar" and NM is set to be 
"${HOST_PREFIX}nm" in bitbake.conf, I chose not to change it.

Given it a second thinking, considering the meta-clang layer, I think 
you are right.

I'll fix it in V2.

Best Regards,
Chen Qi

>>   strip = '${HOST_PREFIX}strip'
>>   readelf = '${HOST_PREFIX}readelf'
>>   pkgconfig = 'pkg-config'
>> --
>> 1.9.1
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core at lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core





More information about the Openembedded-core mailing list