Skip to contentSkip to conversation

mk: fix extra options when linking lib through compiler

PATCH In review Thomas Monjalon 2 participants 3 messages Nov 20, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mk: fix extra options when linking lib through compiler

When using a linker option not known by the compiler like -rpath, the library linkage was failing.
It is fixed by prefixing the option with -Wl, as it is done in other makefiles.

---
 mk/rte.lib.mk | 1 +
 1 file changed, 1 insertion(+)
mk/rte.lib.mk +1 -0
index fcc8e20..06a1519 100644
@@ -68,6 +68,7 @@ ifeq ($(LINK_USING_CC),1)
 # Override the definition of LD here, since we're linking with CC
 LD := $(CC) $(CPU_CFLAGS)
 _CPU_LDFLAGS := $(call linkerprefix,$(CPU_LDFLAGS))
+override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS))
 else
 _CPU_LDFLAGS := $(CPU_LDFLAGS)
 endif
Signature · 1 line
2.5.2
Acked-by on v1 1/1
#1 lore raw

Hi,

Quoted 16 lines · Thomas Monjalon

When using a linker option not known by the compiler like -rpath, the library linkage was failing.
It is fixed by prefixing the option with -Wl, as it is done in other makefiles.

---
 mk/rte.lib.mk | 1 +
 1 file changed, 1 insertion(+)
mk/rte.lib.mk +0 -0
index fcc8e20..06a1519 100644

mk/rte.lib.mk ifeq ($(LINK_USING_CC),1) · line 74

Quoted 7 lines
mk/rte.lib.mk +1 -0
@@ -68,6 +68,7 @@ ifeq ($(LINK_USING_CC),1)
 # Override the definition of LD here, since we're linking with CC
 LD := $(CC) $(CPU_CFLAGS)
 _CPU_LDFLAGS := $(call linkerprefix,$(CPU_LDFLAGS))
+override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS))
 else
 _CPU_LDFLAGS := $(CPU_LDFLAGS)
 endif