[dpdk-stable] patch 'mk: fix shell errors when building with clang' has been queued to stable release 17.02.1

Yuanhan Liu yuanhan.liu at linux.intel.com
Thu May 25 11:48:39 CEST 2017


Hi,

FYI, your patch has been queued to stable release 17.02.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/28/17. So please
shout if anyone has objections.

Thanks.

	--yliu

---
>From 88077a0d6baf274a5050d77e474ef805f765275c Mon Sep 17 00:00:00 2001
From: Olivier Matz <olivier.matz at 6wind.com>
Date: Thu, 6 Apr 2017 16:12:41 +0200
Subject: [PATCH] mk: fix shell errors when building with clang

[ upstream commit e629b8dbd9b38259e5fe32475fdf3e56176d8f39 ]

On my system, the version of the compiler is not properly retrieved,
resulting in strange logs when building the dpdk:
  /bin/sh: line 0: test: too many arguments

This happens when mk/toolchain/clang/rte.toolchain-compat.mk is included
from a directory that use gcc to build (ex: kernel modules). In that
case, the CLANG_VERSION variable contains spaces that breaks some shell
calls to the test program.

The error is because the output of "gcc -v" on my system contains 2 lines
that matches the "version" string:

  Configured with: ../src/configure -v \
    --with-pkgversion='Debian 6.3.0-6' [...]
  gcc version 6.3.0 20170205 (Debian 6.3.0-6)

This may be specific to Debian. Fix it by specializing the grep.

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

Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
Acked-by: Thomas Monjalon <thomas.monjalon at 6wind.com>
---
 mk/toolchain/clang/rte.toolchain-compat.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mk/toolchain/clang/rte.toolchain-compat.mk b/mk/toolchain/clang/rte.toolchain-compat.mk
index b734413..9e095d3 100644
--- a/mk/toolchain/clang/rte.toolchain-compat.mk
+++ b/mk/toolchain/clang/rte.toolchain-compat.mk
@@ -38,7 +38,8 @@
 
 # find out CLANG version
 
-CLANG_VERSION := $(shell $(CC) -v 2>&1 | grep version | sed "s/.*version \([0-9]*\.[0-9]*\).*/\1/")
+CLANG_VERSION := $(shell $(CC) -v 2>&1 | \
+	sed -n "s/.*version \([0-9]*\.[0-9]*\).*/\1/p")
 
 CLANG_MAJOR_VERSION := $(shell echo $(CLANG_VERSION) | cut -f1 -d.)
 
-- 
1.9.0



More information about the stable mailing list