-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flasher_stub GCC 9 warnings/errors #499
Comments
While the errors can obviously be fixed by either What I've tried so far is forward-porting the patches from miniz 1.15 r4 to 2.1.0 (the latest as of now), but have been unsuccessful in building this, at least with picolibc. The error I'm getting is around GCC's
The patch against miniz I'm using is:
|
Hi @paravoid, Thanks for the detailed report and for pushing forward with newer gcc versions. I haven't had time to look deeply but I have a short answer and a long answer which may help: The Makefile in the flasher stub doesn't link libgcc (not on purpose, just that it it wasn't previously needed for anything). If you add (Worth noting that the flasher stub also doesn't link any libc, so choice of libc should only matter for compile-time inclusion of libc headers.) -- The long answer is that Looking up line 2797 in miniz.c to see exactly what operation triggered this doesn't seem to be quite right, may be a binutils/gcc bug? If you remove |
Update miniz to the latest version, 2.1.0. This is the stock, amalgated miniz, with a few modifications, forward-ported from the existing diff against 1.5: * Configuration options (the definitions at the top of miniz.h) * Disabling assert(), i.e. defining MZ_ASSERT to nothing * Defining TDEFL_LESS_MEMORY to 1 * Setting TDEFL_LZ_DICT_SIZE = 8*1024 and TDEFL_LZ_CODE_BUF_SIZE = 8 * 1024 An additional complication is that the new miniz performs a long long to integer division, which requires code from libgcc (__ashldi3), which we didn't link to by default (due to -nostdlib). Add -lgcc to LDLIBS. Even with the additional libgcc dependency, it seems like this is a .text reduction: from 7990 to 7947 (both compiled with gcc 9.2.1 and picolibc 1.3). Tested on real hardware (D1 Mini Pro). See espressif#499 for some additional context.
Only used there, which causes a "defined but not used" (-Wunused-const-variable) compiler error in newer versions of GCC. Rather than disable what is otherwise a useful compiler warning, make the definition conditional to the ESP32s. See espressif#499 for context.
Update miniz to the latest version, 2.1.0. This is the stock, amalgated miniz, with a few modifications, forward-ported from the existing diff against 1.5: * Configuration options (the definitions at the top of miniz.h) * Disabling assert(), i.e. defining MZ_ASSERT to nothing * Defining TDEFL_LESS_MEMORY to 1 * Setting TDEFL_LZ_DICT_SIZE = 8*1024 and TDEFL_LZ_CODE_BUF_SIZE = 8 * 1024 An additional complication is that the new miniz performs a long long to integer division, which requires code from libgcc (__ashldi3), which we didn't link to by default (due to -nostdlib). Add -lgcc to LDLIBS. This seems to be a small increase in .text (8018->8023) with the stock toolchain, but with a newer one (gcc 9.2.1/picolibc 1.3) actually results in a decrease (7990->7947). Tested on real hardware (D1 Mini Pro). See espressif#499 for some additional context.
Update miniz to the latest version, 2.1.0. This is the stock, amalgated miniz, with a few modifications, forward-ported from the existing diff against 1.5: * Configuration options (the definitions at the top of miniz.h) * Disabling assert(), i.e. defining MZ_ASSERT to nothing * Defining TDEFL_LESS_MEMORY to 1 * Setting TDEFL_LZ_DICT_SIZE = 8*1024 and TDEFL_LZ_CODE_BUF_SIZE = 8 * 1024 An additional complication is that the new miniz performs a long long to integer division, which requires code from libgcc (__ashldi3), which we didn't link to by default (due to -nostdlib). Add -lgcc to LDLIBS. This seems to be a small increase in .text (8018->8023) with the stock toolchain, but with a newer one (gcc 9.2.1/picolibc 1.3) actually results in a decrease (7990->7947). Tested on real hardware (D1 Mini Pro). See #499 for some additional context. Merges #500
Building flasher_stub (as of efb55ac) with gcc version 9.2.1 20191130 (9.2.1-21+4) (Debian's), results into the following compiler warnings (that due to the stock Makefile's
-Werror
are converted into errors):I'm looking at updating miniz to a newer upstream, but it doesn't seem too trivial for now (string.h/memset conflicts). I'll look into it more, will update if I get to something.
The text was updated successfully, but these errors were encountered: