From 4d35220c40f7c5b570473e09de3c82f5d614efdc Mon Sep 17 00:00:00 2001 From: Tony Butler Date: Thu, 22 Dec 2022 15:01:37 -0800 Subject: [PATCH] boost: refresh GCC options in Makefile this Makefile still used `CONFIG_GCC_USE_VERSION_*` to select various compilation options, for GCC versions that are antiquated convert to parsing the major from the `CONFIG_GCC_VERSION` which will always exist and can also be used with range logic intent seemed to be: * `-std=gnu++20` for "=10" (and newer, probably) * `-std=gnu++14` for "=5" * `-std=gnu++17` for "not =10 and not =5" GCC 11 or 12 would likely revert to the default (6 through 9) option with those, because 10 was the newest at the time, and 11 and 12 are "not =10 and not =5" probably the GCC 5 support could be removed, not sure about 9 and 10 Signed-off-by: Tony Butler --- libs/boost/Makefile | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/boost/Makefile b/libs/boost/Makefile index 4fe77be5..9180e9ec 100644 --- a/libs/boost/Makefile +++ b/libs/boost/Makefile @@ -384,7 +384,13 @@ TARGET_LDFLAGS += -pthread -lrt -lstdc++ -Wl,--gc-sections,--as-needed,--print-g TARGET_CFLAGS += \ $(if $(CONFIG_SOFT_FLOAT),-DBOOST_NO_FENV_H) -fPIC -ffunction-sections -fdata-sections -flto -EXTRA_CXXFLAGS += $(if $(CONFIG_GCC_USE_VERSION_10),-std=gnu++20,$(if $(CONFIG_GCC_USE_VERSION_5),-std=gnu++14,-std=gnu++17)) +ifeq ($(word 1,$(subst ., ,$(call qstrip,$(CONFIG_GCC_VERSION)))),5) + EXTRA_CXXFLAGS += -std=gnu++14 +else ifneq ($(filter-out 6 7 8 9,$(word 1,$(subst ., ,$(call qstrip,$(CONFIG_GCC_VERSION))))),) + EXTRA_CXXFLAGS += -std=gnu++17 +else + EXTRA_CXXFLAGS += -std=gnu++20 +endif ifneq ($(findstring mips,$(ARCH)),) BOOST_ABI = o32