external/kernel-drivers
修订版 | e168c53bfab9bb20103b10773c66fd79ce28b631 (tree) |
---|---|
时间 | 2020-05-12 20:55:22 |
作者 | Chih-Wei Huang <cwhuang@linu...> |
Commiter | Chih-Wei Huang |
Fix compile errors with clang
Define the flag -Wno-date-time as gcc 4.9+.
@@ -15,7 +15,7 @@ EXTRA_CFLAGS += -Wno-unused-function | ||
15 | 15 | EXTRA_CFLAGS += -Wno-unused |
16 | 16 | #EXTRA_CFLAGS += -Wno-uninitialized |
17 | 17 | |
18 | -GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc ) | |
18 | +GCC_VER_49 := $(if $(CONFIG_CC_IS_CLANG),1,$(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )) | |
19 | 19 | ifeq ($(GCC_VER_49),1) |
20 | 20 | EXTRA_CFLAGS += -Wno-date-time # Fix compile error && warning on gcc 4.9 and later |
21 | 21 | endif |
@@ -16,7 +16,7 @@ EXTRA_CFLAGS += -Wno-unused-function | ||
16 | 16 | EXTRA_CFLAGS += -Wno-unused |
17 | 17 | #EXTRA_CFLAGS += -Wno-uninitialized |
18 | 18 | |
19 | -GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc ) | |
19 | +GCC_VER_49 := $(if $(CONFIG_CC_IS_CLANG),1,$(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )) | |
20 | 20 | ifeq ($(GCC_VER_49),1) |
21 | 21 | EXTRA_CFLAGS += -Wno-date-time # Fix compile error && warning on gcc 4.9 and later |
22 | 22 | endif |
@@ -1,5 +1,14 @@ | ||
1 | 1 | --- a/Makefile |
2 | 2 | +++ b/Makefile |
3 | +@@ -115,7 +115,7 @@ | |
4 | + GCCVERSION := $(subst $(space),$(empty),$(GCCVERSION)) | |
5 | + # Crop the version number to 3 decimals. | |
6 | + GCCVERSION := $(shell expr `echo $(GCCVERSION)` | cut -b1-3) | |
7 | +-GE_49 := $(shell expr `echo $(GCCVERSION)` \>= 490) | |
8 | ++GE_49 := $(if $(CONFIG_CC_IS_CLANG),1,$(shell expr `echo $(GCCVERSION)` \>= 490)) | |
9 | + | |
10 | + EXTRA_CFLAGS := | |
11 | + | |
3 | 12 | @@ -145,7 +145,7 @@ |
4 | 13 | EXTRA_CFLAGS += -Wno-date-time |
5 | 14 | endif |