Skip to contentSkip to conversation

mlx: fix warnings for unused compiler arguments

PATCH Applied Bruce Richardson 3 participants 3 messages Mar 29, 2018 – Apr 1, 2018 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mlx: fix warnings for unused compiler arguments

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")
---
 drivers/net/mlx4/Makefile | 7 ++++++-
 drivers/net/mlx5/Makefile | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)
drivers/net/mlx4/Makefile +6 -1
index cc800493b..b6c05ed42 100644
@@ -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
 
drivers/net/mlx5/Makefile +6 -1
index 3bc9736c9..011335757 100644
@@ -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
 
Signature · 1 line
2.14.3
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · 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'

Quoted 8 lines

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")

---

Thanks

#2 lore raw

Thursday, March 29, 2018 11:54 PM, Yongseok Koh:

Quoted 14 lines
Quoted 2 lines

On Mar 29, 2018, at 6:36 AM, Bruce Richardson

Quoted 6 lines · <[email protected]> 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'

Quoted 4 lines

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

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

---

Applied to next-net-mlx, thanks.

Quoted 2 lines

Thanks