[dpdk-dev,v3] e1000: fix build with clang

Message ID 1464262599-28717-1-git-send-email-h.mikita89@gmail.com (mailing list archive)
State Accepted, archived
Delegated to: Bruce Richardson
Headers

Commit Message

Hiroyuki Mikita May 26, 2016, 11:36 a.m. UTC
  GCC_VERSION is empty in case of clang:
	/bin/sh: line 0: test: -ge: unary operator expected

It is the same issue as http://dpdk.org/dev/patchwork/patch/5994/

Fixes: 366113dbfb69 ("e1000: suppress misleading indentation warning")

Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com>
---
v3:
* use CONFIG_RTE_TOOLCHAIN_GCC

v2:
* fix for cross compier

 drivers/net/e1000/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
  

Comments

Bruce Richardson June 10, 2016, 9:50 a.m. UTC | #1
On Thu, May 26, 2016 at 08:36:39PM +0900, Hiroyuki Mikita wrote:
> GCC_VERSION is empty in case of clang:
> 	/bin/sh: line 0: test: -ge: unary operator expected
> 
> It is the same issue as http://dpdk.org/dev/patchwork/patch/5994/
> 
> Fixes: 366113dbfb69 ("e1000: suppress misleading indentation warning")
> 
> Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com>

Acked-by: Bruce Richardson <bruce.richardson@intel.com>
  
Bruce Richardson June 10, 2016, 9:55 a.m. UTC | #2
On Fri, Jun 10, 2016 at 10:50:50AM +0100, Bruce Richardson wrote:
> On Thu, May 26, 2016 at 08:36:39PM +0900, Hiroyuki Mikita wrote:
> > GCC_VERSION is empty in case of clang:
> > 	/bin/sh: line 0: test: -ge: unary operator expected
> > 
> > It is the same issue as http://dpdk.org/dev/patchwork/patch/5994/
> > 
> > Fixes: 366113dbfb69 ("e1000: suppress misleading indentation warning")
> > 
> > Signed-off-by: Hiroyuki Mikita <h.mikita89@gmail.com>
> 
> Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied to dpdk-next-net/rel_16_07

/Bruce
  

Patch

diff --git a/drivers/net/e1000/Makefile b/drivers/net/e1000/Makefile
index f4879e6..b5b803e 100644
--- a/drivers/net/e1000/Makefile
+++ b/drivers/net/e1000/Makefile
@@ -50,14 +50,16 @@  ifeq ($(CC), icc)
 CFLAGS_BASE_DRIVER = -wd177 -wd181 -wd188 -wd869 -wd2259
 else
 #
-# CFLAGS for gcc
+# CFLAGS for gcc/clang
 #
 CFLAGS_BASE_DRIVER = -Wno-uninitialized -Wno-unused-parameter
 CFLAGS_BASE_DRIVER += -Wno-unused-variable
+ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
 ifeq ($(shell test $(GCC_VERSION) -ge 60 && echo 1), 1)
 CFLAGS_BASE_DRIVER += -Wno-misleading-indentation
 endif
 endif
+endif
 
 #
 # Add extra flags for base driver files (also known as shared code)