OSDN Git Service

Fix compile errors with clang android-x86-7.1-r4 android-x86-8.1-r5
authorChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 12 May 2020 11:55:22 +0000 (19:55 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Tue, 12 May 2020 11:55:22 +0000 (19:55 +0800)
Define the flag -Wno-date-time as gcc 4.9+.

rtl8812au/Makefile
rtl8821ce/Makefile
wl/wl.patch

index b61f198..b422223 100644 (file)
@@ -15,7 +15,7 @@ EXTRA_CFLAGS += -Wno-unused-function
 EXTRA_CFLAGS += -Wno-unused
 #EXTRA_CFLAGS += -Wno-uninitialized
 
-GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )
+GCC_VER_49 := $(if $(CONFIG_CC_IS_CLANG),1,$(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc ))
 ifeq ($(GCC_VER_49),1)
 EXTRA_CFLAGS += -Wno-date-time # Fix compile error && warning on gcc 4.9 and later
 endif
index 50c4b92..2c42081 100644 (file)
@@ -16,7 +16,7 @@ EXTRA_CFLAGS += -Wno-unused-function
 EXTRA_CFLAGS += -Wno-unused
 #EXTRA_CFLAGS += -Wno-uninitialized
 
-GCC_VER_49 := $(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc )
+GCC_VER_49 := $(if $(CONFIG_CC_IS_CLANG),1,$(shell echo `$(CC) -dumpversion | cut -f1-2 -d.` \>= 4.9 | bc ))
 ifeq ($(GCC_VER_49),1)
 EXTRA_CFLAGS += -Wno-date-time # Fix compile error && warning on gcc 4.9 and later
 endif
index 8468394..f53d03c 100644 (file)
@@ -1,5 +1,14 @@
 --- a/Makefile
 +++ b/Makefile
+@@ -115,7 +115,7 @@
+ GCCVERSION := $(subst $(space),$(empty),$(GCCVERSION))
+ # Crop the version number to 3 decimals.
+ GCCVERSION := $(shell expr `echo $(GCCVERSION)` | cut -b1-3)
+-GE_49 := $(shell expr `echo $(GCCVERSION)` \>= 490)
++GE_49 := $(if $(CONFIG_CC_IS_CLANG),1,$(shell expr `echo $(GCCVERSION)` \>= 490))
+ EXTRA_CFLAGS :=
 @@ -145,7 +145,7 @@
  EXTRA_CFLAGS       += -Wno-date-time
  endif