DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] mk: link combined lib using CC
@ 2014-10-23 15:35 Sergio Gonzalez Monroy
  2014-10-28 11:45 ` De Lara Guarch, Pablo
  2014-10-28 15:48 ` [dpdk-dev] [PATCH v2] mk: link combined shared " Sergio Gonzalez Monroy
  0 siblings, 2 replies; 17+ messages in thread
From: Sergio Gonzalez Monroy @ 2014-10-23 15:35 UTC (permalink / raw)
  To: dev

Building combined shared libs fails if we set EXTRA_CFLAGS=-O0.

/usr/bin/ld: test: hidden symbol `mknod' in /usr/lib64/libc_nonshared.a(mknod.oS) is referenced by DSO
/usr/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

Fix: link combined shared lib using CC if LINK_USING_CC is enabled.

Signed-off-by: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>
---
 mk/rte.lib.mk      |  1 -
 mk/rte.sharelib.mk | 12 +++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index d83e808..a6abd6d 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -63,7 +63,6 @@ ifeq ($(LINK_USING_CC),1)
 # Override the definition of LD here, since we're linking with CC
 LD := $(CC) $(CPU_CFLAGS)
 LD_MULDEFS := $(call linkerprefix,-z$(comma)muldefs)
-CPU_LDFLAGS := $(call linkerprefix,$(CPU_LDFLAGS))
 endif
 
 O_TO_A = $(AR) crus $(LIB) $(OBJS-y)
diff --git a/mk/rte.sharelib.mk b/mk/rte.sharelib.mk
index c0a811a..1fac0ad 100644
--- a/mk/rte.sharelib.mk
+++ b/mk/rte.sharelib.mk
@@ -29,6 +29,8 @@
 #   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 #   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
+include $(RTE_SDK)/mk/internal/rte.build-pre.mk
+
 # VPATH contains at least SRCDIR
 VPATH += $(SRCDIR)
 
@@ -45,7 +47,15 @@ sharelib: $(LIB_ONE) FORCE
 
 OBJS = $(wildcard $(RTE_OUTPUT)/build/lib/*.o)
 
-O_TO_S = $(LD) $(CPU_LDFLAGS) -shared $(OBJS) -o $(RTE_OUTPUT)/lib/$(LIB_ONE)
+ifeq ($(LINK_USING_CC),1)
+# Override the definition of LD here, since we're linking with CC
+LD := $(CC) $(CPU_CFLAGS)
+LD_MULDEFS := $(call linkerprefix,-z$(comma)muldefs)
+CPU_LDFLAGS := $(call linkerprefix,$(CPU_LDFLAGS))
+endif
+
+O_TO_S = $(LD) $(CPU_LDFLAGS) $(LD_MULDEFS) -shared $(OBJS)\
+	-o $(RTE_OUTPUT)/lib/$(LIB_ONE)
 O_TO_S_STR = $(subst ','\'',$(O_TO_S)) #'# fix syntax highlight
 O_TO_S_DISP = $(if $(V),"$(O_TO_S_STR)","  LD $(@)")
 O_TO_S_CMD = "cmd_$@ = $(O_TO_S_STR)"
-- 
1.9.3

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

end of thread, other threads:[~2014-12-17 23:36 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-23 15:35 [dpdk-dev] [PATCH] mk: link combined lib using CC Sergio Gonzalez Monroy
2014-10-28 11:45 ` De Lara Guarch, Pablo
2014-10-28 14:51   ` Sergio Gonzalez Monroy
2014-10-28 15:33     ` Thomas Monjalon
2014-10-28 15:39       ` Sergio Gonzalez Monroy
2014-10-28 15:48 ` [dpdk-dev] [PATCH v2] mk: link combined shared " Sergio Gonzalez Monroy
2014-10-28 16:09   ` De Lara Guarch, Pablo
2014-12-16 18:48   ` Thomas Monjalon
2014-12-16 23:42     ` Thomas Monjalon
2014-12-17 10:41       ` Gonzalez Monroy, Sergio
2014-12-17 14:01         ` Thomas Monjalon
2014-12-17 18:49           ` Thomas Monjalon
2014-12-17 21:59             ` [dpdk-dev] [PATCH 0/3] mk: fix link options Thomas Monjalon
2014-12-17 21:59               ` [dpdk-dev] [PATCH 1/3] mk: fix link examples to combined library Thomas Monjalon
2014-12-17 21:59               ` [dpdk-dev] [PATCH 2/3] mk: forbid multiple definitions Thomas Monjalon
2014-12-17 21:59               ` [dpdk-dev] [PATCH 3/3] mk: fix link with CC Thomas Monjalon
2014-12-17 23:35               ` [dpdk-dev] [PATCH 0/3] mk: fix link options Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).