C++: prepare RTTI support

Ref. https://github.com/espressif/esp-idf/issues/1684

Also, for full RTTI support, libstdc++.a in the toolchain should be built
in both with RTTI and w/o RTTI options. Multilib with -fno-rtti
flag is used for that.

Note that this commit does not actually enable RTTI support.
The respective Kconfig option is hidden, and will be made visible when
the toolchain is updated.
This commit is contained in:
Anton Maklakov
2019-10-31 10:15:54 +07:00
parent 4f297ed3fa
commit fae64f79bb
5 changed files with 27 additions and 3 deletions

View File

@@ -452,7 +452,6 @@ CXXFLAGS ?=
EXTRA_CXXFLAGS ?=
CXXFLAGS := $(strip \
-std=gnu++11 \
-fno-rtti \
$(OPTIMIZATION_FLAGS) $(DEBUG_FLAGS) \
$(COMMON_FLAGS) \
$(COMMON_WARNING_FLAGS) \
@@ -465,6 +464,13 @@ else
CXXFLAGS += -fno-exceptions
endif
ifdef CONFIG_COMPILER_CXX_RTTI
CXXFLAGS += -frtti
else
CXXFLAGS += -fno-rtti
LDFLAGS += -fno-rtti
endif
ARFLAGS := cru
export CFLAGS CPPFLAGS CXXFLAGS ARFLAGS