]> granicus.if.org Git - esp-idf/commitdiff
build system: Add a compatible old GCC flag
authorAnton Maklakov <anton@espressif.com>
Thu, 30 Aug 2018 03:24:34 +0000 (11:24 +0800)
committerAnton Maklakov <anton@espressif.com>
Thu, 20 Sep 2018 10:53:14 +0000 (18:53 +0800)
components/bt/component.mk
components/coap/component.mk
components/expat/component.mk
components/libsodium/component.mk
components/lwip/component.mk
examples/bluetooth/ble_hid_device_demo/main/component.mk
make/project.mk
tools/ci/build_examples.sh
tools/unit-test-app/components/unity/component.mk

index 327e9a9f37410a99148099bb1d0bfa7c2d385957..eb9b39c02d4bff7128cefdfd412f48823edcd9bb 100644 (file)
@@ -17,8 +17,10 @@ COMPONENT_ADD_LINKER_DEPS := $(patsubst %,$(COMPONENT_PATH)/lib/lib%.a,$(LIBS))
 
 COMPONENT_SUBMODULES += lib
 
+ifeq ($(GCC_NOT_5_2_0), 1)
 # TODO: annotate fallthroughs in Bluedroid code with comments
 CFLAGS += -Wno-implicit-fallthrough
+endif
 
 endif
 
@@ -118,9 +120,11 @@ COMPONENT_SRCDIRS +=    bluedroid/bta/dm                      \
                         bluedroid/api                         \
                         bluedroid
 
+ifeq ($(GCC_NOT_5_2_0), 1)
 bluedroid/bta/sdp/bta_sdp_act.o: CFLAGS += -Wno-unused-const-variable
 bluedroid/btc/core/btc_config.o: CFLAGS += -Wno-unused-const-variable
 bluedroid/stack/btm/btm_sec.o: CFLAGS += -Wno-unused-const-variable
 bluedroid/stack/smp/smp_keys.o: CFLAGS += -Wno-unused-const-variable
+endif
 
 endif
index 4b3d56f5676745e66f258be6e490362f08ff4906..bd7b0e0a64aee8cdaaa747a3404a3ab53e406d66 100644 (file)
@@ -12,5 +12,7 @@ COMPONENT_SUBMODULES += libcoap
 
 libcoap/src/debug.o: CFLAGS += -Wno-write-strings
 libcoap/src/pdu.o: CFLAGS += -Wno-write-strings
+ifeq ($(GCC_NOT_5_2_0), 1)
 # Temporary suppress "fallthrough" warnings until they are fixed in libcoap repo
 libcoap/src/option.o: CFLAGS += -Wno-implicit-fallthrough
+endif
index 851f6a8c38c3dcd2fd19f6b4e8317e27f73ecd8f..351fe3b74a9777fe0666a9746a09ed2b6a66fb2d 100644 (file)
@@ -6,7 +6,8 @@ COMPONENT_ADD_INCLUDEDIRS := expat/expat/lib port/include
 COMPONENT_SRCDIRS := expat/expat/lib port
 
 CFLAGS += -DHAVE_EXPAT_CONFIG_H -DHAVE_GETRANDOM
+ifeq ($(GCC_NOT_5_2_0), 1)
 # Temporary suppress "fallthrough" warnings until they are fixed in expat repo
 CFLAGS += -Wno-implicit-fallthrough
-
+endif
 COMPONENT_SUBMODULES += expat
index 12dcb571a515c2c4e8109a80ad0de3aea2001991..c84519cb3d009ee6a34285d374e05bd2093228b4 100644 (file)
@@ -87,6 +87,8 @@ CFLAGS +=  -DNATIVE_LITTLE_ENDIAN -DHAVE_WEAK_SYMBOLS -D__STDC_LIMIT_MACROS -D__
 # randombytes.c needs to pull in platform-specific implementation
 $(LSRC)/randombytes/randombytes.o: CFLAGS+=-DRANDOMBYTES_DEFAULT_IMPLEMENTATION
 
+ifeq ($(GCC_NOT_5_2_0), 1)
 # Temporary suppress "fallthrough" warnings until they are fixed in libsodium repo
 $(LSRC)/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.o: CFLAGS += -Wno-implicit-fallthrough
 $(LSRC)/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.o: CFLAGS += -Wno-implicit-fallthrough
+endif
index d79cbd36c2aab722cb0a7d23837f917276abd35c..037b09f2a035a52c19f161b35f75080a3d29173d 100644 (file)
@@ -28,3 +28,8 @@ ifdef CONFIG_PPP_SUPPORT
 endif
 
 CFLAGS += -Wno-address  # lots of LWIP source files evaluate macros that check address of stack variables
+
+ifeq ($(GCC_NOT_5_2_0), 1)
+else
+netif/ppp/pppos.o: CFLAGS += -Wno-type-limits
+endif
\ No newline at end of file
index 4c0df110355fcac2e57b0991060831cbcd738bdc..4fa5a1b0268c541957766572c2cbfbde7d5626d0 100644 (file)
@@ -2,4 +2,6 @@
 # Main Makefile. This is basically the same as a component makefile.
 #
 
+ifeq ($(GCC_NOT_5_2_0), 1)
 hid_device_le_prf.o: CFLAGS += -Wno-unused-const-variable 
+endif
\ No newline at end of file
index acb240386d546a92db2d33fa3c3f01e333016b6f..71d86d31612349ee017c85c82edb2a84a2627fe9 100644 (file)
@@ -273,7 +273,6 @@ COMMON_WARNING_FLAGS = -Wall -Werror=all \
        -Wno-error=unused-function \
        -Wno-error=unused-but-set-variable \
        -Wno-error=unused-variable \
-       -Wno-error=unused-const-variable \
        -Wno-error=deprecated-declarations \
        -Wextra \
        -Wno-unused-parameter -Wno-sign-compare
@@ -294,7 +293,6 @@ COMMON_WARNING_FLAGS += -Wno-parentheses \
        -Wno-int-in-bool-context
 endif
 
-
 ifdef CONFIG_WARN_WRITE_STRINGS
 COMMON_WARNING_FLAGS += -Wwrite-strings
 endif #CONFIG_WARN_WRITE_STRINGS
@@ -394,6 +392,14 @@ OBJCOPY := $(call dequote,$(CONFIG_TOOLPREFIX))objcopy
 SIZE := $(call dequote,$(CONFIG_TOOLPREFIX))size
 export CC CXX LD AR OBJCOPY SIZE
 
+COMPILER_VERSION_STR := $(shell $(CC) -dumpversion)
+COMPILER_VERSION_NUM := $(subst .,,$(COMPILER_VERSION_STR))
+GCC_NOT_5_2_0 := $(shell expr $(COMPILER_VERSION_STR) != "5.2.0")
+export COMPILER_VERSION_STR COMPILER_VERSION_NUM GCC_NOT_5_2_0
+
+CPPFLAGS += -DGCC_NOT_5_2_0=$(GCC_NOT_5_2_0)
+export CPPFLAGS
+
 PYTHON=$(call dequote,$(CONFIG_PYTHON))
 
 # the app is the main executable built by the project
@@ -581,15 +587,14 @@ print_flash_cmd: partition_table_get_info blank_ota_data
 # Check toolchain version using the output of xtensa-esp32-elf-gcc --version command.
 # The output normally looks as follows
 #     xtensa-esp32-elf-gcc (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 5.2.0
-# The part in brackets is extracted into TOOLCHAIN_COMMIT_DESC variable,
-# the part after the brackets is extracted into TOOLCHAIN_GCC_VER.
+# The part in brackets is extracted into TOOLCHAIN_COMMIT_DESC variable
 ifdef CONFIG_TOOLPREFIX
 ifndef MAKE_RESTARTS
 
 TOOLCHAIN_HEADER := $(shell $(CC) --version | head -1)
 TOOLCHAIN_PATH := $(shell which $(CC))
 TOOLCHAIN_COMMIT_DESC := $(shell $(CC) --version | sed -E -n 's|.*\(crosstool-NG (.*)\).*|\1|gp')
-TOOLCHAIN_GCC_VER := $(shell $(CC) --version | sed -E -n 's|xtensa-esp32-elf-gcc.*\ \(.*\)\ (.*)|\1|gp')
+TOOLCHAIN_GCC_VER := $(COMPILER_VERSION_STR)
 
 # Officially supported version(s)
 include $(IDF_PATH)/tools/toolchain_versions.mk
index a36ab8f80b415adb5ec4bf26eaac5e5f00701245..be3e558f58ef28e83fb07aa4eabb718438fbfb3d 100755 (executable)
@@ -157,8 +157,17 @@ echo -e "\nFound issues:"
 #       Ignore the next messages:
 # "error.o" or "-Werror" in compiler's command line
 # "reassigning to symbol" or "changes choice state" in sdkconfig
-sort -u "${LOG_SUSPECTED}" | \
-grep -v "library/error\.o\|\ -Werror\|error\.d\|reassigning to symbol\|changes choice state" \
+# Compiler and toochain versions is not supported from make/project.mk
+IGNORE_WARNS="\
+library/error\.o\
+\|\ -Werror\|error\.d\
+\|reassigning to symbol\
+\|changes choice state\
+\|Compiler version is not supported\
+\|Toolchain version is not supported\
+"
+
+sort -u "${LOG_SUSPECTED}" | grep -v "${IGNORE_WARNS}" \
     && RESULT=$RESULT_ISSUES \
     || echo -e "\tNone"
 
index b0a970453f156c69c349d63031c8530a2dbfab3e..c3c44cc0cea1b67b93a3ecf02b24e3220d184627 100644 (file)
@@ -2,4 +2,6 @@
 # Component Makefile
 #
 
+ifeq ($(GCC_NOT_5_2_0), 1)
 unity.o: CFLAGS += -Wno-unused-const-variable
+endif
\ No newline at end of file