All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mlx: fix warnings for unused compiler arguments
@ 2018-03-29 13:36 Bruce Richardson
  2018-03-29 20:53 ` Yongseok Koh
  0 siblings, 1 reply; 3+ messages in thread
From: Bruce Richardson @ 2018-03-29 13:36 UTC (permalink / raw)
  To: Adrien Mazarguil, Nelio Laranjeiro, Yongseok Koh; +Cc: dev, Bruce Richardson

When linking the mlx glue code libraries using CC, the linker arguments in
LDFLAGS are not prefixed with -Wl. [The EXTRA_LDFLAGS are though.] This
leads to warning messages on build:

clang-5.0: warning: argument unused during compilation: '-e xport-dynamic'

Fix this by checking for $LINK_USING_CC in the Makefiles and prefixing the
LDFLAGS appropriately if set.

Fixes: 27cea11686ff ("net/mlx4: spawn rdma-core dependency plug-in")
Fixes: 59b91bec12c6 ("net/mlx5: spawn rdma-core dependency plug-in")

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 drivers/net/mlx4/Makefile | 7 ++++++-
 drivers/net/mlx5/Makefile | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx4/Makefile b/drivers/net/mlx4/Makefile
index cc800493b..b6c05ed42 100644
--- a/drivers/net/mlx4/Makefile
+++ b/drivers/net/mlx4/Makefile
@@ -132,8 +132,13 @@ ifeq ($(CONFIG_RTE_LIBRTE_MLX4_DLOPEN_DEPS),y)
 
 $(LIB): $(LIB_GLUE)
 
+ifeq ($(LINK_USING_CC),1)
+GLUE_LDFLAGS := $(call linkerprefix,$(LDFLAGS))
+else
+GLUE_LDFLAGS := $(LDFLAGS)
+endif
 $(LIB_GLUE): mlx4_glue.o
-	$Q $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) \
+	$Q $(LD) $(GLUE_LDFLAGS) $(EXTRA_LDFLAGS) \
 		-Wl,-h,$(LIB_GLUE) \
 		-s -shared -o $@ $< -libverbs -lmlx4
 
diff --git a/drivers/net/mlx5/Makefile b/drivers/net/mlx5/Makefile
index 3bc9736c9..011335757 100644
--- a/drivers/net/mlx5/Makefile
+++ b/drivers/net/mlx5/Makefile
@@ -181,8 +181,13 @@ ifeq ($(CONFIG_RTE_LIBRTE_MLX5_DLOPEN_DEPS),y)
 
 $(LIB): $(LIB_GLUE)
 
+ifeq ($(LINK_USING_CC),1)
+GLUE_LDFLAGS := $(call linkerprefix,$(LDFLAGS))
+else
+GLUE_LDFLAGS := $(LDFLAGS)
+endif
 $(LIB_GLUE): mlx5_glue.o
-	$Q $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) \
+	$Q $(LD) $(GLUE_LDFLAGS) $(EXTRA_LDFLAGS) \
 		-Wl,-h,$(LIB_GLUE) \
 		-s -shared -o $@ $< -libverbs -lmlx5
 
-- 
2.14.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mlx: fix warnings for unused compiler arguments
  2018-03-29 13:36 [PATCH] mlx: fix warnings for unused compiler arguments Bruce Richardson
@ 2018-03-29 20:53 ` Yongseok Koh
  2018-04-01  7:39   ` Shahaf Shuler
  0 siblings, 1 reply; 3+ messages in thread
From: Yongseok Koh @ 2018-03-29 20:53 UTC (permalink / raw)
  To: Bruce Richardson; +Cc: Adrien Mazarguil, Nélio Laranjeiro, dev


> On Mar 29, 2018, at 6:36 AM, Bruce Richardson <bruce.richardson@intel.com> wrote:
> 
> When linking the mlx glue code libraries using CC, the linker arguments in
> LDFLAGS are not prefixed with -Wl. [The EXTRA_LDFLAGS are though.] This
> leads to warning messages on build:
> 
> clang-5.0: warning: argument unused during compilation: '-e xport-dynamic'
> 
> Fix this by checking for $LINK_USING_CC in the Makefiles and prefixing the
> LDFLAGS appropriately if set.
> 
> Fixes: 27cea11686ff ("net/mlx4: spawn rdma-core dependency plug-in")
> Fixes: 59b91bec12c6 ("net/mlx5: spawn rdma-core dependency plug-in")
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---
Acked-by: Yongseok Koh <yskoh@mellanox.com>
 
Thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mlx: fix warnings for unused compiler arguments
  2018-03-29 20:53 ` Yongseok Koh
@ 2018-04-01  7:39   ` Shahaf Shuler
  0 siblings, 0 replies; 3+ messages in thread
From: Shahaf Shuler @ 2018-04-01  7:39 UTC (permalink / raw)
  To: Yongseok Koh, Bruce Richardson
  Cc: Adrien Mazarguil, Nélio Laranjeiro, dev

Thursday, March 29, 2018 11:54 PM, Yongseok Koh:
> 
> > On Mar 29, 2018, at 6:36 AM, Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> >
> > When linking the mlx glue code libraries using CC, the linker
> > arguments in LDFLAGS are not prefixed with -Wl. [The EXTRA_LDFLAGS are
> > though.] This leads to warning messages on build:
> >
> > clang-5.0: warning: argument unused during compilation: '-e xport-
> dynamic'
> >
> > Fix this by checking for $LINK_USING_CC in the Makefiles and prefixing
> > the LDFLAGS appropriately if set.
> >
> > Fixes: 27cea11686ff ("net/mlx4: spawn rdma-core dependency plug-in")
> > Fixes: 59b91bec12c6 ("net/mlx5: spawn rdma-core dependency plug-in")
> >
> > Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> > ---
> Acked-by: Yongseok Koh <yskoh@mellanox.com>

Applied to next-net-mlx, thanks. 

> 
> Thanks

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-01  7:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-29 13:36 [PATCH] mlx: fix warnings for unused compiler arguments Bruce Richardson
2018-03-29 20:53 ` Yongseok Koh
2018-04-01  7:39   ` Shahaf Shuler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.