[dpdk-dev,1/2] mk: get correct clang version
Commit Message
-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(-)
Comments
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>
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
@@ -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.)