From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [PATCH] net/mlx5: fix linkage error for glue lib Date: Tue, 24 Jul 2018 14:00:48 +0200 Message-ID: <20180724120048.GQ5211@6wind.com> References: <20180724085445.52206-1-shahafs@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: yskoh@mellanox.com, dev@dpdk.org, Yaroslav Brustinov , stable@dpdk.org, nelio.laranjeiro@6wind.com To: Shahaf Shuler Return-path: Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by dpdk.org (Postfix) with ESMTP id AB4CD1DA4 for ; Tue, 24 Jul 2018 14:01:05 +0200 (CEST) Received: by mail-wm0-f66.google.com with SMTP id s9-v6so2262103wmh.3 for ; Tue, 24 Jul 2018 05:01:05 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20180724085445.52206-1-shahafs@mellanox.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Tue, Jul 24, 2018 at 11:54:45AM +0300, Shahaf Shuler wrote: > From: Yaroslav Brustinov > > Compiling with gcc 4.7.2 introduced the linkage error > > "bin/ld: Warning: alignment 8 of symbol `mlx5_glue' in > src/dpdk/drivers/net/mlx5/mlx5_glue.c.21.o is smaller than 16 in > src/dpdk/drivers/net/mlx5/mlx5_rxq.c.21.o" > > Fix it be forcing the alignment of the glue lib. > > Fixes: 0e83b8e536c1 ("net/mlx5: move rdma-core calls to separate file") > Cc: stable@dpdk.org > Cc: nelio.laranjeiro@6wind.com > Cc: adrien.mazarguil@6wind.com > > Signed-off-by: Yaroslav Brustinov > Signed-off-by: Shahaf Shuler Odd, how could this happen assuming both files are compiled during the same run using identical flags? Looks like a compiler issue. Anyway, may I suggest an alignment constraint on the structure type in mlx5_glue.h instead, so that all users inherit it. E.g. using C11 syntax: #include #include [...] alignas(max_align_t) struct mlx5_glue { [...] }; > --- > drivers/net/mlx5/mlx5_glue.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/mlx5/mlx5_glue.c b/drivers/net/mlx5/mlx5_glue.c > index c7965e51fe..c56c69bb13 100644 > --- a/drivers/net/mlx5/mlx5_glue.c > +++ b/drivers/net/mlx5/mlx5_glue.c > @@ -343,7 +343,9 @@ mlx5_glue_dv_create_qp(struct ibv_context *context, > #endif > } > > -const struct mlx5_glue *mlx5_glue = &(const struct mlx5_glue){ > +const struct mlx5_glue *mlx5_glue __attribute__((__aligned__(64))) = > + &(const struct mlx5_glue) > +{ > .version = MLX5_GLUE_VERSION, > .fork_init = mlx5_glue_fork_init, > .alloc_pd = mlx5_glue_alloc_pd, > -- > 2.12.0 > -- Adrien Mazarguil 6WIND