From patchwork Tue Jul 3 13:04:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ross Burton X-Patchwork-Id: 140961 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1202024ljj; Tue, 3 Jul 2018 07:01:01 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfYPFEhBW9moz+w+aNPTxy821hz6HvR5o2bySbcYRmKHAe5KJt98yD8s5RnQT5EIjU0q16I X-Received: by 2002:a17:902:18a:: with SMTP id b10-v6mr18683977plb.62.1530626461186; Tue, 03 Jul 2018 07:01:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530626461; cv=none; d=google.com; s=arc-20160816; b=HeBxYwtnkF85vcnLhXZLFM+NPSt9W3p4uoGGjuSjPU2CEPxMfeXXWLqgEWAVZ62vCL JqrJZfk9KtjdBTH9NOj02jgktDywtSv2faR9INpf3RLBWhS9fpOgK+QMeK77qYeT6urT PdinkhBN/5HIUYoTbhpM3hjQOfIVyZ8G1B0lxVe73cpJ4tyRRYeFWW8JK9gM0iy69xuG u7oLq3YcbdlmNJt1c7JZSPrbzg7aWQ4l8CffBJtRV2gfMr0ota3tYAkKLvy8t2hu7/jP VNLwoe78HHg0GPxHAI3ybyD1TrRvNuRs4sYxZfi6g5MP4PWc7MdewEofDL2089gjZKLo LHUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:dkim-signature:delivered-to:arc-authentication-results; bh=6KCFpeZlSXfw35OIkNWVqwRJshTiARnTzjp8w4V4zUA=; b=QIWgtTuaK+GGh/4wtDq8rYkeHWVs4BBnvb95D40K2NL6jrMZep9vs7Jle2tBxNgYzI oBpykeGch8Wxd91I5nU3/Mv28+0MnwWyqs07HdIFgQcfRbdZQ2pUIJlEdTN4dzryNXRE 0/0Jh5oih2ohrE0LT6c1wzuIks7/FcO6RE1rrtdlKhJqdYO24lgpZMjpmFTjyvcz+G82 zJz3v6q/zRYv/dKekFoymcEXUrH/GhrIYIjzvMrlQRVSwkliYnlX7o0RXe0z0ZDdwB7o X9oD1QPgmRRlym7Fd7ZdxkJpSFBuwG6DOGKfu1F97Ys/V2RLWnrtaXJ6yoiI4aEwksfx aNuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=IJaM9GNf; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id bb12-v6si1102473plb.328.2018.07.03.07.01.00; Tue, 03 Jul 2018 07:01:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=IJaM9GNf; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 754E578B03; Tue, 3 Jul 2018 14:00:58 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-wm0-f52.google.com (mail-wm0-f52.google.com [74.125.82.52]) by mail.openembedded.org (Postfix) with ESMTP id 95F327889F for ; Tue, 3 Jul 2018 13:04:18 +0000 (UTC) Received: by mail-wm0-f52.google.com with SMTP id n17-v6so2212423wmh.2 for ; Tue, 03 Jul 2018 06:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=KmuSQY2Muzs1YcL0rmDm3MqbS00CZ0FRGQ4KqrDwpq4=; b=IJaM9GNfNmXlppgL8d3Am4wEziKF41zYogA2h8bOsXU83AwWQvry5W5H1sGVAf86yY mbpp7dBCQHa6lPe5lrTDkYtod9tM2DCk0yjyL3TtzVEDY3Rq60qzuRg6WqpUuvrNhEEs nWXA6H6cVspckgXTVc4WAgL0VqHJfRWSfA85OrDcXy2nvD7I78WGHBdslGpCR7stQZ4B 2brdlJrjzu/20w4KElbHIDs2j3uBqBnMKMsME+chbegYNUFd2idtv5bEyjPLrs4jgLgG ae3qDlE5ktqu667tB0ndqH9kGlRqTZaPb0VeOAHsoPyA/2ONkxlMXtNbW0EgaMZLyfBq BzPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=KmuSQY2Muzs1YcL0rmDm3MqbS00CZ0FRGQ4KqrDwpq4=; b=ZVaGlx3bVh0cX39fdd87bYgvMyraYdN1zKBY0HAKW4IWdgayzNebNsM24IpNzKRgZJ rLc+DhpUhMmJtvpjJKCHNOB7hKjvf8Epb6RwMvuxn+z85dxRVVmRUsVqCKIpzAgVNhCI WZC8v9Yf6X+LMzYscqivt83Q+t7W/RFT00jInSIQOjrgE++w2uC77Q1LMSJLFJvxtLhJ T+5JPD8+HbKAGIYEfSRweS8c1qcyzG15p/9zXepUoKcntLgDaEBZjZBnlEZIJnmUVhLD jpQ3Rh+wAESf1feJh9U7xDfA+l3eqR9tjnoxMrtgL8mLgINkKcbc+z0tnUsXUk4gzzwq Z/ow== X-Gm-Message-State: APt69E3FSoRut9EWEOkVQUEUfS1Ozbuv/BJuqTkL2go4/N0mfsRXbGGm yBsq7NZv3cYqw2kH6NDfnl2kC9P3 X-Received: by 2002:a1c:69c6:: with SMTP id z67-v6mr8444194wmh.159.1530623058994; Tue, 03 Jul 2018 06:04:18 -0700 (PDT) Received: from flashheart.burtonini.com (35.106.2.81.in-addr.arpa. [81.2.106.35]) by smtp.gmail.com with ESMTPSA id j9-v6sm1863006wrr.52.2018.07.03.06.04.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Jul 2018 06:04:18 -0700 (PDT) From: Ross Burton To: openembedded-core@lists.openembedded.org Date: Tue, 3 Jul 2018 14:04:10 +0100 Message-Id: <20180703130412.26102-2-ross.burton@intel.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180703130412.26102-1-ross.burton@intel.com> References: <20180703130412.26102-1-ross.burton@intel.com> Subject: [OE-core] [PATCH 2/4] meson: map architecture to correct values in cross file X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org The cross file specifies the host/target cpu_family, which should be one of a defined set of values[1] but if it isn't Meson won't complain and instead recipes may behave unexpectedly. [1] http://mesonbuild.com/Reference-tables.html#cpu-families Signed-off-by: Ross Burton --- meta/classes/meson.bbclass | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) -- 2.11.0 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass index c36b634b43d..d615a84cfb0 100644 --- a/meta/classes/meson.bbclass +++ b/meta/classes/meson.bbclass @@ -45,6 +45,18 @@ def meson_array(var, d): items = d.getVar(var).split() return repr(items[0] if len(items) == 1 else items) +# Map our ARCH values to what Meson expects: +# http://mesonbuild.com/Reference-tables.html#cpu-families +def meson_cpu_family(var, d): + import re + arch = d.getVar(var) + if arch == 'powerpc': + return 'ppc' + elif re.match(r"i[3-6]86", arch): + return "x86" + else: + return arch + addtask write_config before do_configure do_write_config[vardeps] += "MESON_C_ARGS MESON_CPP_ARGS MESON_LINK_ARGS CC CXX LD AR NM STRIP READELF" do_write_config() { @@ -70,13 +82,13 @@ gtkdoc_exe_wrapper = '${B}/gtkdoc-qemuwrapper' [host_machine] system = '${HOST_OS}' -cpu_family = '${HOST_ARCH}' +cpu_family = '${@meson_cpu_family('HOST_ARCH', d)}' cpu = '${HOST_ARCH}' endian = '${MESON_HOST_ENDIAN}' [target_machine] system = '${TARGET_OS}' -cpu_family = '${TARGET_ARCH}' +cpu_family = '${@meson_cpu_family('TARGET_ARCH', d)}' cpu = '${TARGET_ARCH}' endian = '${MESON_TARGET_ENDIAN}' EOF