[dpdk-dev] Compiling DPDK is not working on Red Hat 6.7

Message ID HE1PR05MB15789C92E14BE78168B2BD1BC2310@HE1PR05MB1578.eurprd05.prod.outlook.com (mailing list archive)
State Not Applicable, archived
Headers

Commit Message

Raslan Darawsheh July 13, 2016, 6:01 a.m. UTC
  It seems that the patch fixed the issue. 

Kindest regards 
Raslan Darawsheh


-----Original Message-----
From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] 
Sent: Tuesday, July 12, 2016 3:16 PM
To: Raslan Darawsheh
Cc: dev@dpdk.org; Christian Ehrhardt
Subject: Re: [dpdk-dev] Compiling DPDK is not working on Red Hat 6.7

Hi,

2016-07-12 11:35, Raslan Darawsheh:
> I think the option is there as you see:
> 
[...]
> -Wl,--as-needed  -Wl,-lrt -Wl,-lm |...] -Wl,-lrte_eal
[...]
> eal_timer.c:(.text+0x152): undefined reference to `clock_gettime'

I suspect we need -lrt after -lrte_eal.

Please could you try the following patch?
  

Comments

Thomas Monjalon July 13, 2016, 7:45 a.m. UTC | #1
2016-07-13 06:01, Raslan Darawsheh:
> It seems that the patch fixed the issue.

Thanks, I've sent the patches:
	http://dpdk.org/ml/archives/dev/2016-July/043917.html

> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] 
> 2016-07-12 11:35, Raslan Darawsheh:
> > I think the option is there as you see:
> > 
> [...]
> > -Wl,--as-needed  -Wl,-lrt -Wl,-lm |...] -Wl,-lrte_eal
> [...]
> > eal_timer.c:(.text+0x152): undefined reference to `clock_gettime'
> 
> I suspect we need -lrt after -lrte_eal.

Do you know where the flag -lrt is set?
Is it in your environment LDFLAGS? (it is my guess for the fix).
  

Patch

--- a/mk/rte.app.mk
+++ b/mk/rte.app.mk
@@ -176,6 +176,8 @@  ifeq ($(RTE_DEVEL_BUILD)$(CONFIG_RTE_BUILD_SHARED_LIB),yy)
 LDFLAGS += -rpath=$(RTE_SDK_BIN)/lib
 endif
 
+MAPFLAGS = -Map=$@.map --cref
+
 .PHONY: all
 all: install
 
@@ -190,15 +192,13 @@  build: _postbuild
 exe2cmd = $(strip $(call dotfile,$(patsubst %,%.cmd,$(1))))
 
 ifeq ($(LINK_USING_CC),1)
-override EXTRA_LDFLAGS := $(call linkerprefix,$(EXTRA_LDFLAGS)) -O_TO_EXE = $(CC) $(CFLAGS) \
-	$(call linkerprefix,$(LDLIBS)) \
-	$(call linkerprefix,$(LDFLAGS)) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
-	-Wl,-Map=$(@).map,--cref -o $@ $(OBJS-y)
+O_TO_EXE = $(CC) -o $@ $(CFLAGS) $(OBJS-y) $(call linkerprefix, \
+	$(LDLIBS) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
+	$(MAPFLAGS))
 else
-O_TO_EXE = $(LD) $(LDLIBS) \
-	$(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
-	-Map=$(@).map --cref -o $@ $(OBJS-y)
+O_TO_EXE = $(LD) -o $@ $(OBJS-y)
+	$(LDLIBS) $(LDFLAGS) $(LDFLAGS_$(@)) $(EXTRA_LDFLAGS) \
+	$(MAPFLAGS)
 endif
 O_TO_EXE_STR = $(subst ','\'',$(O_TO_EXE)) #'# fix syntax highlight  O_TO_EXE_DISP = $(if $(V),"$(O_TO_EXE_STR)","  LD $(@)")