michprev wrote:Which version should we use then / what is the difference? libc.a in toolchain takes 5.0 MB, in ESP-IDF 5.7 MB (both SPIRAM compatible versions)
There were a few changes done to the newlib version included into ESP-IDF, which were not propagated to newlib packaged with the toolchain.
For the most part, changes have to do with adding some functions which were not included, and removing some other functions which were included. You can see the list on this page:
https://github.com/espressif/esp-idf/co ... newlib/lib
We're doing some cleanup to the way we build GCC and newlib, this will introduce cleaner and more consistent results. All newlib and GCC patches will be published in Github repositories, and crosstool-NG will be configured to pull newlib and GCC from these repositories. IDF will have an option of building newlib from source.
michprev wrote:
memset is provided in esp32.rom.spiram_incompatible_fns.ld script but I am not using this script.
With "-nostdlib -mlongcalls -mfix-esp32-psram-cache-issue -g -Og -ggdb -Wall -Werror -Wl,--cref,-Map,bootloader.map -lc" memset is linked against toolchain libc.
This makes sense. "-nostdlib" tells the linker to empty the implict list of linked libraries, but "-lc" later tells it to link against libc.a, which it finds, since no other paths are provided, in the toolchain directory.
michprev wrote:
With "-nostdlib -mlongcalls -mfix-esp32-psram-cache-issue -g -Og -ggdb -Wall -Werror -Wl,--cref,-Map,bootloader.map -L idf/components/newlib/lib -lc" memset is linked against ESP-IDF libc.
This makes sense in the same way as above, except now you supply a new search path for libraries, so libc.a gets found there.