This is what I did. I maintain a fork of the crosstool-NG git(hub) repo, which has the relevant changes from Max Filipov applied (cherry picked) on top. Somewhere in the last year the original crosstool-ng had newlib 2.0.0 removed (as being obsolete). I simply took the relevant commit (nice and clean) and reverted it in my fork. Now newlib 2.0.0, with patches from Max, is available again.
Update: the build now stops with an error, though:
[ERROR] /home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/libgcc/libgcov.h:510:56: error: 'intptr_t' undeclared (first use in this function)
[ERROR] /home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/libgcc/libgcov.h:510:65: error: expected ',' or ';' before 'counters'
[ERROR] /home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/libgcc/libgcov.h:559:39: error: expected ';' before 'new_node'
[ERROR] make[4]: *** [Makefile:921: _gcov_merge_add.o] Error 1
[ERROR] make[4]: *** Waiting for unfinished jobs....
[ERROR] /home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/libgcc/libgcov.h:510:56: error: 'intptr_t' undeclared (first use in this function)
[ERROR] /home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/libgcc/libgcov.h:510:65: error: expected ',' or ';' before 'counters'
[ERROR] /home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/libgcc/libgcov.h:559:39: error: expected ';' before 'new_node'
[ERROR] make[4]: *** [Makefile:921: _gcov_merge_topn.o] Error 1
[ERROR] /home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/libgcc/libgcov.h:510:56: error: 'intptr_t' undeclared (first use in this function)
[ERROR] /home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/libgcc/libgcov.h:510:65: error: expected ',' or ';' before 'counters'
[ERROR] /home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/libgcc/libgcov.h:559:39: error: expected ';' before 'new_node'
[ERROR] make[4]: *** [Makefile:921: _gcov_merge_ior.o] Error 1
[ERROR] /home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/libgcc/libgcov.h:510:56: error: 'intptr_t' undeclared (first use in this function)
[ERROR] /home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/libgcc/libgcov.h:510:65: error: expected ',' or ';' before 'counters'
[ERROR] /home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/libgcc/libgcov.h:559:39: error: expected ';' before 'new_node'
[ERROR] make[4]: *** [Makefile:921: _gcov_merge_time_profile.o] Error 1
[ERROR] make[3]: *** [Makefile:13271: all-target-libgcc] Error 2
Let's me look into this. Maybe we can completely disable this libgcov thing.
/home/erik/src/esp/crosstool-NG/.build/xtensa-lx106-elf/src/gcc/gcc/../include/ansidecl.h:40:1: error: expected initializer before 'extern'
There is really nothing wrong with this code:
#ifndef _ANSIDECL_H
#define _ANSIDECL_H 1
#ifdef __cplusplus
extern "C" {
#endif
When I tried to build this I got an error in zlib, which was mentioned in an issue - it needs to be updated to latest, which is 1.2.13, so I updated the package info for that directly from the main crosstool repo . Then I built
Here are the sample files - these need to be put under the directory xtensa-esp8266-elf (note the name change)