From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by dpdk.org (Postfix) with ESMTP id BABEA2BF1 for ; Tue, 21 Aug 2018 16:20:21 +0200 (CEST) Received: from mail-oi0-f71.google.com ([209.85.218.71]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1fs7W9-0007b1-Ct for dev@dpdk.org; Tue, 21 Aug 2018 14:20:21 +0000 Received: by mail-oi0-f71.google.com with SMTP id l191-v6so1507655oig.23 for ; Tue, 21 Aug 2018 07:20:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=Wq129/eRfO7ivylOD7WS4aaoVpk6CZxpwlcVkPeZA1A=; b=sjXZ6NBvyrm570lzNS1QGMwHNrwl/tabibxxvtpgjERnqlebOveGPAKnK/MMb1Joij Htu7YLPw5gppeWReFHviOVmqpwGMx5UgNy4pO82SvpTi3CQ5Z+L+GbHPJlJ451iW+DTY NPnjj7h0Y8yHlzsDLNFjRjoCjFJ7Uq+e7LF18pGUMHq7mZ1ZxKu9e3DqPbXm4HpOkUvZ gg/fgjGKziIsN24tgB4lGQVFCmUwSa+/RTgA09V7Grvn6m7g/KQ0kIBVVz9PdiGGqSiP HqoxHihiBU7/mn6uwTGi5zngVVUELpsWaDu4DNN6JLRS8F778wTz3vWy3loiYGlzskBo G/lQ== X-Gm-Message-State: AOUpUlEwmwP7MyLgDl3DH9rqflPC9D7bReNw0xxwUnf47C/Tc4/mt8X+ quq56Oks+59HYNApYowm3X//4iHirNnjTvA74Z2iOHhiWrI747+e0VD+y9xMIG9UI0Zwj+qTmYL C2KspY1g02r0u30hejN0Z0SThm5rDeOlFt6fr X-Received: by 2002:aca:a8c1:: with SMTP id r184-v6mr19138840oie.215.1534861220260; Tue, 21 Aug 2018 07:20:20 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyUWnmUBoSiXC/ZdcAYS+mTgVhztjYJIIoCORutdX9D7QsIvMUTGpeFA+XiocQuGYYdTkyYrdPx06F8U9zH+qc= X-Received: by 2002:aca:a8c1:: with SMTP id r184-v6mr19138820oie.215.1534861220053; Tue, 21 Aug 2018 07:20:20 -0700 (PDT) MIME-Version: 1.0 From: Christian Ehrhardt Date: Tue, 21 Aug 2018 16:19:54 +0200 Message-ID: To: dev , Gowrishankar Muthukrishnan , Chao Zhu Cc: Luca Boccassi , Thomas Monjalon Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: [dpdk-dev] 18.08 build error on ppc64el - bool as vector type X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Aug 2018 14:20:21 -0000 Hi, Debian and Ubuntu face a build error with 18.08 on ppc64el. It looks like that: Full log: https://buildd.debian.org/status/fetch.php?pkg=dpdk&arch=ppc64el&ver=18.08-1&stamp=1534520196&raw=0 /<>/drivers/net/mlx5/mlx5_nl.c: In function 'mlx5_nl_switch_info_cb': /<>/drivers/net/mlx5/mlx5_nl.c:837:23: error: incompatible types when initializing type '__vector __bool int' {aka '__vector(4) __bool int'} using type 'int' bool port_name_set = false; ^~~~~ /<>/drivers/net/mlx5/mlx5_nl.c:838:23: error: incompatible types when initializing type '__vector __bool int' {aka '__vector(4) __bool int'} using type 'int' bool switch_id_set = false; ^~~~~ /<>/drivers/net/mlx5/mlx5_nl.c:857:18: error: incompatible types when assigning to type '__vector __bool int' {aka '__vector(4) __bool int'} from type 'int' port_name_set = true; ^ /<>/drivers/net/mlx5/mlx5_nl.c:865:18: error: incompatible types when assigning to type '__vector __bool int' {aka '__vector(4) __bool int'} from type 'int' switch_id_set = true; ^ /<>/drivers/net/mlx5/mlx5_nl.c:870:16: error: used vector type where scalar is required info.master = switch_id_set && !port_name_set; ^~~~~~~~~~~~~ /<>/drivers/net/mlx5/mlx5_nl.c:870:33: error: wrong type argument to unary exclamation mark info.master = switch_id_set && !port_name_set; ^ /<>/drivers/net/mlx5/mlx5_nl.c:871:21: error: used vector type where scalar is required info.representor = switch_id_set && port_name_set; Now I checked and the reason seems to be some combination of altivec and MLX headers and the use of bool - probably stdbool vs altivec bool. If built with gcc -E I see it the bool variables become: __attribute__((altivec(bool__))) unsigned port_name_set = I have found a strawmans approach to it, but I'm sure people with experience on the matter will come up with something better. My current change looks like that and would work: $ git diff diff --git a/drivers/net/mlx5/mlx5_nl.c b/drivers/net/mlx5/mlx5_nl.c index d61826aea..2cc8f49c5 100644 --- a/drivers/net/mlx5/mlx5_nl.c +++ b/drivers/net/mlx5/mlx5_nl.c @@ -834,8 +834,8 @@ mlx5_nl_switch_info_cb(struct nlmsghdr *nh, void *arg) .switch_id = 0, }; size_t off = NLMSG_LENGTH(sizeof(struct ifinfomsg)); - bool port_name_set = false; - bool switch_id_set = false; + int port_name_set = 0; + int switch_id_set = 0; if (nh->nlmsg_type != RTM_NEWLINK) goto error; @@ -854,7 +854,7 @@ mlx5_nl_switch_info_cb(struct nlmsghdr *nh, void *arg) if (errno || (size_t)(end - (char *)payload) != strlen(payload)) goto error; - port_name_set = true; + port_name_set = 1; break; case IFLA_PHYS_SWITCH_ID: info.switch_id = 0; @@ -862,7 +862,7 @@ mlx5_nl_switch_info_cb(struct nlmsghdr *nh, void *arg) info.switch_id <<= 8; info.switch_id |= ((uint8_t *)payload)[i]; } - switch_id_set = true; + switch_id_set = 1; break; } off += RTA_ALIGN(ra->rta_len); -- Christian Ehrhardt Software Engineer, Ubuntu Server Canonical Ltd