From e168c53bfab9bb20103b10773c66fd79ce28b631 Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Tue, 12 May 2020 19:55:22 +0800 Subject: [PATCH] Fix compile errors with clang Define the flag -Wno-date-time as gcc 4.9+. --- rtl8812au/Makefile | 2 +- rtl8821ce/Makefile | 2 +- wl/wl.patch | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/rtl8812au/Makefile b/rtl8812au/Makefile index b61f198..b422223 100644 --- a/rtl8812au/Makefile +++ b/rtl8812au/Makefile @@ -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 diff --git a/rtl8821ce/Makefile b/rtl8821ce/Makefile index 50c4b92..2c42081 100644 --- a/rtl8821ce/Makefile +++ b/rtl8821ce/Makefile @@ -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 diff --git a/wl/wl.patch b/wl/wl.patch index 8468394..f53d03c 100644 --- a/wl/wl.patch +++ b/wl/wl.patch @@ -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 -- 2.11.0