mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-19 23:22:16 +03:00
5 Commits
Author | SHA1 | Message | Date | |
---|---|---|---|---|
|
d979b57d76
|
Upgrade to GCC 10.1 toolchain (#6294)
* Upgrade to GCC 9.1 toolchain * Rebuilt using pure GNU binutils and GCC Remove dependencies on earlier forked GNU utilities (gcc-xtensa, binutils-gdb-xtensa) and just use GCC sources, unmodified (except for patches in the esp-quick-toolchain directories). * Rebuild bearssl using new toolchain * Fix GDBstub linkage options GDB works with pure GNU GCC and pure GNU binutils now. Still warnings galore, but tested with the example sketch in the docs. * Fix digitalRead alias warning * Remove gdb stub warnings w/a pragma * Fix deprecated implicit copy ctors in IP code Fix some warnings present in GCC8/9 in the IPAddress code In AddressListIterator there was a copy constructor which simply copied the structure bit-for-bit. That's the default operation, so remove it to avoid the warning there. IPAddress, add a default copy constructor since the other copy constructors are simply parsing from one format into a native ip_addr_t. @d-a-v, can you give these a look over and see if they're good (since IP stuff is really your domain). * Fix AxTLS alias function defs to match real code * Fix WiFiClientSecure implicit default copy ctor These both use shared-ptrs to handle refcnts to allocated data, so using the default copy constructor is fine (and has been in use for a long time). * Dummy size for heap to avoid GCC 8/9 warnings Make GCC think _heap_start is large enough to avoid the basic (and incorrect) bounds-checking warnings it produces. The size chosen is arbitrary and does not affect the actual size of the heap in any way. * Make heap an undefined extend array Instead of a bogus size, use an indefinite size for the heap to avoid GCC warnings * Trivial tab to space fix * Update SDFat to remove FatFile warnings * Fix ticker function cast warnings in GCC 9 The callback function is defined to take a (void*) as parameter, but our templates let users use anything that fits inside sizeof(void*) to be passed in. Add pragmas to stop GCC warnings about this, since we already check the size of the type will fit in the allocated space. * Remove GCC support fcn that's in ROM Manually delete the divdi3.so from the libgcc.a library by running the updated EQT's 9.1-post script. * Make exceptions work again, get std::regex up Exceptions are broken on all builds (GCC4.8-9.1) due to the removal of the PROGMEM non-32b read exception handler (added in the unstable pre3.0.0). Build the exception code with -mforce-l32 and patch accordingly to avoid LoadStore errors. Apply patches to select portions of the regex lib which use _stype_ (which is now in flash). * Rebuild Bearssl using latest GCC push * Automate building of BearSSL and LWIP w/new toolchain * Workaround g++ template section problem for exception strings G++ seems to throw out the section attributes for templates. This means that the __EXCSTR(a synonym for "PSTR()") is ignored and exception.what strings are stored in RODATA, eating up RAM. Workaround by using the linker to place the strings keying off their name ("*__exception_what__*"). * Rebuild moving exception.what to unique names Exception.whats are now all in __exception_what__ and can be moved by the linker to flash. Works aroung G++ issue with segments being lost in templates. * Rebuild with new LWIP locking * Update to latest libs, save iram Move two GCC FP support routines out of iram since they are in ROM already, saving some add'l IRAM. Same list as gcc 4.8. * Update BearSSL to latest release * Fix umm_perf reference to ROM function * Fix "reinterpret_case is not a constexpr" error In GCC 9 (and 8 from what I read on SO), a cast of a const int to a function pointer (via explicit or implicit reinterpret_cast) is not a constexpr. ```` /home/earle/Arduino/hardware/esp8266com/esp8266/cores/esp8266/umm_malloc/umm_performance.cpp:45:36: error: a reinterpret_cast is not a constant expression 45 | int constexpr (*_rom_putc1)(int) = (int (*)(int))(void*)0x40001dcc; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```` Remove the constexpr, potentially increasing heap usage by 4 bytes in debug mode. * Update libc.a to latest rev * Full rebuild of toolchain and libs * Upgrade to GCC 9.2, released in August 2019 Add builds for all 5 cross-compiles to pass CI * Move to --std=gnu++14 (C++14 + GNU extensions) * Fix Ticker merge conflict * Fix json merge conflict * One more merge diff fix * Reapply Ticker.h casting warning fixes for gcc9 * Update with fixes from Sming repo for PSTR and ASM * Upgrade to -gnu4 toolchain * Move to gnu5 build with add'l softFP from ROM * Move add'l softFP from IRAM to flash Per @mikee47, we miss sone add'l soft-FP routined in the linker which makes them end up in IRAM. Move them explicitly into flash, like a couple others we have already done this for. * Move to std=c++17/c17 in platform, remove abs/round Move to C++17 and C17 standards on the compiler options. Remove "register" from core since it is deprecated. Remove the #define abs() and #define round() which a) overwrote the C stdlib definitions, poorly, and b) broke the GCC core code which used "abs" as an internal function name. Now abs() returns an integer, and not whatever was being absoluted. fabs() etc. can be used if users need fload/double suport. round() returns a double now, which is basically what it was returning in the original case since adding/subtracting by a FP. * Use std::abs/round to replace the macro definitions Per discussion w/@devyte, preserve the abs() and round() functionality via the using statement. * Remove using std::abs which conflicted with C lib headers * Add 2nd arg (exception handler) to ets_isr_t Disassembly of the ROM shows there are 2 params to the ets_isr_t callback. The first is the arg passed in, the second is a pointer to an exception frame where you can get info about when the IRQ happened. * Move the gdbstub example to a subdir The Arduino IDE and the build CI don't build it without a subdir, so make one for gdbstub's example so it's visible and tested. * Fix ets_irq_arratch redefinition and core IRQ handlers Remove a duplicated, different declaration for ets_irq_attach from ets_sys.h. It never really even matched the other declaration in the same header. Update the core to IRQ handlers to fix the prototype and include the 2nd, unused frame parameter. * Actually rebuild the libc.a using GCC 9.2 * Fix SPISlave interrupt attach's 2nd parameter * Rebuild eboot.elf with GCC 9 * Update to latest SoftwareSerial for Delegate fix * Upgrade to GCC 9.3 * Rebuild all arch toolchains * Move to GCC 10.1 * Merge master and fix eboot build GCC10 now uses `-fno-common` so the eboot global variables were being placed in IRAM. Adjust the makefile and rebuild to fix. * Built complete toolchain for all archs * Pull in latest PSTR changes and fix GCC10.1 build Somehow the prior GCC build's -mforce32 patch wasn't applying correctly, but I was still able to get a binary. Fixed. Also pulled in latest PSTR changes in progmem.h * Update platform.io to platform C/C++ standards * Use PR's toolchain in platformio build * Fix several asm warnings in PIO build * Optional stack smash protection -fstack-protector Add a menu to enable GCC's built-in stack smash protection. When a subroutine goes past its end of stack, generate a crashdump on function exit like: ```` GCC detected stack overrun Stack corrupted, stack smash detected. >>>stack>>> ctx: cont sp: 3fffff20 end: 3fffffc0 offset: 0000 3fffff20: 40202955 00000001 0000001c 4020287e 3fffff30: feefeffe 000000fd 00000000 00000000 ... <<<stack<<< ```` Disabled by default because there is a small per-function code overhead (and CPU time if the function is called very frequently and is very small). BearSSL and LWIP are not built using stack smash detection, yet. * Fix duplicated stc=gnu99/c17 in build * Dump faulting function PC in stack overflow Report a fake exception to have the exception decoder print the actual faulting function. This won't tell you where in the function the issue happened, but it will tell you the function name first and foremost. * Rebuild with Platform.io JSON tag in release tgzs |
||
|
ac25f3276f
|
Upgrade to 2.5.0-4 toolchain w/improved pgm_read_x, C++ exceptions (#6273)
* Upgrade to 2.5.0-4 toolchain w/improved pgm_read_x Rebuild the entire toolchain (including standard libraries) with the latest pgm_read_xxx headers included (which fix unaligned dword reads from progmem and run faster/smaller, and a pgm_read_byte change which removes an instruction on each read saving flash). Pull in latest bearssl while we're at it, too, which speeds up EC handshakes and reduced ROM usage, too. * Fix C++ exceptions Exception code now only does 32b aligned reads from progmem to access the eh_table (some via -mforce-l32, some via hand-inserted pgm_read_x macros). Fixes #6151 Fixes #6305 Fixes #6198 |
||
|
8e248064b9
|
Update toolchain and bins to 2.5.0-2 autobuild (#5441)
The complete toolchain, including mkspiffs, esptool, C, C++, newlib, and others (BearSSL excluded) is now built and uploaded with a single command to ensure repeatability and minimize manual mistakes. All OSes and architectures are built at a time. Update to 2.5.0-2 throught the chain. |
||
|
6280e98b03 |
Enable exceptions, update to optimized newlib, migrate to new toolchain (#5376)
* Move to PROGMEM aware libc, allow PSTR in printf() A Newlib (libc) patch is in progress to move the _P functions from inside Arduino into first-class citizens in libc. This Arduino patch cleans up code that's been migrated there. Binaries for the new libs are included because it seems they're part of the Arduino git tree, and should be replaced with @igrr built ones when/if the Newlib changes are accepted. Notable changes/additions for Arduino: Allow for use of PROGMEM based format and parameter strings in all *printf functions. No need for copying PSTR()s into RAM before printing them out (transparently saves heap space when using _P functions) and makes it easier to print out constant strings for applications. Add "%S" (capital-S) format that I've been told, but cannot verify, is used in Arduino to specify a PROGMEM string parameter in printfs, as an alias for "%s" since plain "%s" can now handle PROGMEM. Optimized the memcpy_P, strnlen_P, and strncpy_P functions to use 32-bit direct reads whenver possible (source and dest alignment mediated), but there is still room for improvement in others. Finally, move several constant arrays from RODATA into PROGMEM and update their accessors. Among these are the ctype array, ~260 bytes, mprec* arrays, ~300 bytes, and strings/daycounts in the time formatting functions, ~200 bytes. All told, sketches will see from 300 to 800 additional RAM heap free on startup (depending on their use of these routines). * Fix merge error in #ifdef/#endif * Fix host test using the newlib generic pgmspace.h Host tests now use the sys/pgmspace.h for compiles instead of the ESP8266-specific version. * Update with rebuilt libraries using latest newlib * Include binaries built directly from @igrr repo Rebuild the binaries using a git clone of https://github.com/igrr/newlib-xtensa Build commands for posterity: ```` rm -rf ./xtensa-lx106-elf/ ./configure --prefix=<DIR>/esp8266/tools/sdk/libc --with-newlib \ --enable-multilib --disable-newlib-io-c99-formats \ --disable-newlib-supplied-syscalls \ --enable-newlib-nano-formatted-io --enable-newlib-reent-small \ --enable-target-optspace \ --program-transform-name="s&^&xtensa-lx106-elf-&" \ --disable-option-checking --with-target-subdir=xtensa-lx106-elf \ --target=xtensa-lx106-elf rm -f etc/config.cache CROSS_CFLAGS="-fno-omit-frame-pointer -DSIGNAL_PROVIDED -DABORT_PROVIDED"\ " -DMALLOC_PROVIDED" \ PATH=<DIR>/esp8266/tools/xtensa-lx106-elf/bin/:$PATH \ make all install ```` * Fix merge define conflict in c_types.h * Fix strlen_P misaligned source error Include fix from newlib-xtensa/fix-strlen branch cleaning up misaligned access on a non-aligned source string. * Fix strlen_P and strcpy_P edge cases Ran the included test suite on ESP8266 tstring.c with the following defines: #define MAX_1 50 #define memcmp memcmp_P #define memcpy memcpy_P #define memmem memmem_P #define memchr memchr_P #define strcat strcat_P #define strncat strncat_P #define strcpy strcpy_P #define strlen strlen_P #define strnlen strnlen_P #define strcmp strcmp_P #define strncmp strncmp_P Uncovered edge case and return value problems in the optimized versions of the strnlen_P and strncpy_P functions. Corrected. * Fix memcpy_P return value memcpy-1.c test suite showed error in return value of memcpy_P. Correct it. * Fix strnlen_P/strlen_P off-by-4 error Random crashes, often on String constructors using a PSTR, would occur due to the accelerated strnlen_P going past the end of the string. Would make debug builds fail, too (ESP.getVersionString() failure). Fix to fall through to normal copy on a word that's got a 0 byte anywhere in it. * Add device tests for libc functional verification Add test suite used to debug libc optimized _P functions to the device tests. * Rebuild from igrr's repo (same source as prior) Rebuild .a from igrr's repo at 347260af117b4177389e69fd4d04169b11d87a97 * WIP - add exceptions * Fix exception to have 0-terminator * Move some exception constants to TEXT from RODATA * Remove throw stubs * Move more exception stuff to ROM * Enable exceptions in platform.io * Remove atexit, is duplicated in rebuilt lib Need to look at the quick-toolchain options, there seems to be a definition for atexit defined there (libgcc?) that needs to be excised. For now, remove our local do-nothing copy. * Update libgcc to remove soft-fp functions The esp-quick-toolchain generated libgcc.a needed to have the soft-FP routines that are in ROM removed from it. Remove them in the new esp-quick-toolchain and update. * Fix merge typos in Makefile * Add unhandled exception handler to postmortem * Return our atexit() handler * Latest stdc++, minimize exception emercengy area * Remove atexit from newlib atexit was defined in newlib strongly, but we also define a noop atexit in core. Since we never exit, use the core's noop and delete the atexit from libc.a Updated in esp-quick-toolchain as well. * Move __FUNCTION__ static strings to PROGMEM __FUNCTION__ is unlikely to be a timing sensitive variable, so move it to PROGMEM and not RODATA (RAM) using linker magic. asserts() now should take no RAM for any strings. * Clean up linker file, update to latest stdc++ * Update to latest stdc++ which doesn't call strerror * Update to GCC5.1 exception emergency allocator Using GCC 5.1's emergency memory allocator for exceptions, much less space is required in programs which do not use exceptions and when space is allocated it is managed more efficiently. * Initial try with new compiler toolchain * Include newlib built from esp-quick-toolchain * Update JSON with all new esp-quick-toolchain builds * Use 64bit Windows compiler on 64bit Windows * Dump std::exception.what() when possible When doing the panic on unhandled exceptions, try and grab the .what() pointer and dump it as part of the termination info. Makes it easy to see mem errors (std::bad_alloc) or std::runtime_error strings. * Use scripted install from esp-quick-toolchain Makes sure proper libraries and includes are present by using a scripted installation from esp-quick-install instead of a manual one. * Update eqk to remove atexit, fix packaging diff |
||
|
ae13809c81 |
Update SDK to 2.0.0
- Update SDK header files and libraries to SDK 2.0.0 plus 2.0.0_16_08_09 patch - Remove mem_manager.o from libmain.a (replaced with umm_malloc) - Disable switch from DIO to QIO mode for certain flash chips (saves IRAM space) - Add user_rf_cal_sector_set; it points to rf_init_data sector. - Change the way rf_init_data is spoofed. This is now done by wrapping spi_flash_read and returning the data we need during startup sequence. - Place lwip library into flash using linker script instead of section attributes (saves IRAM space) |