DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 1/2] mk: get correct clang version
@ 2016-07-25 12:55 Ferruh Yigit
  2016-07-25 12:55 ` [dpdk-dev] [PATCH 2/2] mk: fix FreeBSD clang compile error Ferruh Yigit
  2016-07-25 15:21 ` [dpdk-dev] [PATCH 1/2] mk: get correct clang version Bruce Richardson
  0 siblings, 2 replies; 4+ messages in thread
From: Ferruh Yigit @ 2016-07-25 12:55 UTC (permalink / raw)
  To: dev; +Cc: Thomas Monjalon

-dumpversion is for gcc compatibility and doesn't return actual clang
version. -dumpversion only returns 4.2.1 for a long time.

Fixes: 2ef6eea891e5 ("mk: add clang toolchain")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 mk/toolchain/clang/rte.toolchain-compat.mk | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mk/toolchain/clang/rte.toolchain-compat.mk b/mk/toolchain/clang/rte.toolchain-compat.mk
index f995b0b..03e5a97 100644
--- a/mk/toolchain/clang/rte.toolchain-compat.mk
+++ b/mk/toolchain/clang/rte.toolchain-compat.mk
@@ -38,6 +38,8 @@
 
 # find out CLANG version
 
-CLANG_MAJOR_VERSION = $(shell $(CC) -dumpversion | cut -f1 -d.)
+CLANG_VERSION := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/")
 
-CLANG_MINOR_VERSION = $(shell $(CC) -dumpversion | cut -f2 -d.)
+CLANG_MAJOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f1 -d.)
+
+CLANG_MINOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f2 -d.)
-- 
2.7.4

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

* [dpdk-dev] [PATCH 2/2] mk: fix FreeBSD clang compile error
  2016-07-25 12:55 [dpdk-dev] [PATCH 1/2] mk: get correct clang version Ferruh Yigit
@ 2016-07-25 12:55 ` Ferruh Yigit
  2016-07-25 15:21 ` [dpdk-dev] [PATCH 1/2] mk: get correct clang version Bruce Richardson
  1 sibling, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2016-07-25 12:55 UTC (permalink / raw)
  To: dev; +Cc: Thomas Monjalon

clang version < 3.5 doesn't support -z linker option,
and some FreeBSD box still has clang versions < 3.5 as default version.

compile error:
clang: error: unknown argument: '-z'

Fixes: fd591c4c4e35 ("mk: check shared library dependencies")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 mk/rte.lib.mk                              | 6 +++++-
 mk/toolchain/clang/rte.toolchain-compat.mk | 4 ++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/mk/rte.lib.mk b/mk/rte.lib.mk
index 0187ae8..830f81a 100644
--- a/mk/rte.lib.mk
+++ b/mk/rte.lib.mk
@@ -93,8 +93,12 @@ O_TO_A_DO = @set -e; \
 	$(O_TO_A) && \
 	echo $(O_TO_A_CMD) > $(call exe2cmd,$(@))
 
+ifneq ($(CC_SUPPORTS_Z),false)
+NO_UNDEFINED := -z defs
+endif
+
 O_TO_S = $(LD) -L$(RTE_SDK_BIN)/lib $(_CPU_LDFLAGS) $(EXTRA_LDFLAGS) \
-	  -shared $(OBJS-y) -z defs $(LDLIBS) -Wl,-soname,$(LIB) -o $(LIB)
+	  -shared $(OBJS-y) $(NO_UNDEFINED) $(LDLIBS) -Wl,-soname,$(LIB) -o $(LIB)
 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_DO = @set -e; \
diff --git a/mk/toolchain/clang/rte.toolchain-compat.mk b/mk/toolchain/clang/rte.toolchain-compat.mk
index 03e5a97..b734413 100644
--- a/mk/toolchain/clang/rte.toolchain-compat.mk
+++ b/mk/toolchain/clang/rte.toolchain-compat.mk
@@ -43,3 +43,7 @@ CLANG_VERSION := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]
 CLANG_MAJOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f1 -d.)
 
 CLANG_MINOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f2 -d.)
+
+ifeq ($(shell test $(CLANG_MAJOR_VERSION)$(CLANG_MINOR_VERSION) -lt 35 && echo 1), 1)
+	CC_SUPPORTS_Z := false
+endif
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH 1/2] mk: get correct clang version
  2016-07-25 12:55 [dpdk-dev] [PATCH 1/2] mk: get correct clang version Ferruh Yigit
  2016-07-25 12:55 ` [dpdk-dev] [PATCH 2/2] mk: fix FreeBSD clang compile error Ferruh Yigit
@ 2016-07-25 15:21 ` Bruce Richardson
  2016-07-25 15:48   ` Thomas Monjalon
  1 sibling, 1 reply; 4+ messages in thread
From: Bruce Richardson @ 2016-07-25 15:21 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: dev, Thomas Monjalon

On Mon, Jul 25, 2016 at 01:55:48PM +0100, Ferruh Yigit wrote:
> -dumpversion is for gcc compatibility and doesn't return actual clang
> version. -dumpversion only returns 4.2.1 for a long time.
> 
> Fixes: 2ef6eea891e5 ("mk: add clang toolchain")
> 
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>

Confirm this set fixes the issues with shared lib compile on FreeBSD.

Tested-by: Bruce Richardson <bruce.richardson@intel.com>

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

* Re: [dpdk-dev] [PATCH 1/2] mk: get correct clang version
  2016-07-25 15:21 ` [dpdk-dev] [PATCH 1/2] mk: get correct clang version Bruce Richardson
@ 2016-07-25 15:48   ` Thomas Monjalon
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Monjalon @ 2016-07-25 15:48 UTC (permalink / raw)
  To: Ferruh Yigit; +Cc: Bruce Richardson, dev

2016-07-25 16:21, Bruce Richardson:
> On Mon, Jul 25, 2016 at 01:55:48PM +0100, Ferruh Yigit wrote:
> > -dumpversion is for gcc compatibility and doesn't return actual clang
> > version. -dumpversion only returns 4.2.1 for a long time.
> > 
> > Fixes: 2ef6eea891e5 ("mk: add clang toolchain")
> > 
> > Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Confirm this set fixes the issues with shared lib compile on FreeBSD.
> 
> Tested-by: Bruce Richardson <bruce.richardson@intel.com>

Applied, thanks

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

end of thread, other threads:[~2016-07-25 15:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-25 12:55 [dpdk-dev] [PATCH 1/2] mk: get correct clang version Ferruh Yigit
2016-07-25 12:55 ` [dpdk-dev] [PATCH 2/2] mk: fix FreeBSD clang compile error Ferruh Yigit
2016-07-25 15:21 ` [dpdk-dev] [PATCH 1/2] mk: get correct clang version Bruce Richardson
2016-07-25 15:48   ` 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).