Merely instantiating a std::stringstream does this, and investigation of the map file reveals that a lot of that is related to pulling in locale and formatting symbols which I will never use, but which are being loaded anyway.
So, my reasoning is that I should produce a new libstdc++, patching the stream classes to not use locale at all, and then to link this instead of the toolchain provided libstdc++. (I am very open to other suggestions to avoid this approach -- I did investigate uSTL but found the implementation too simplistic, and needed the full std:: streams/rdbuf interface.)
However, let's say that I need to reproduce the libstdc++-psram-workaround.a binary that is contained in esp-idf... how would I do that? A total guess is to copy the upstream gcc/libstdc++-v3/**/*.cc files into a new component in my app, with the following flags in component.mk:
Code: Select all
CFLAGS+=-mfix-esp32-psram-cache-issue
CXXFLAGS+=-mfix-esp32-psram-cache-issue
LDFLAGS:=$(filter-out -lstdc++,$(LDFLAGS))