You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tested the MCVE and OTA works again perfectly fine. I found the problem in my full sketch. I had a global object called crc32! The same name as the function name with problem. Sorry for bothering you and thank you @earlephilhower for your help. Closing this issue...
Resulting .elf has our function and not the original one, crc32 returning 0.
> xtensa-lx106-elf-gdb --batch --ex "disassemble crc32" .pio/build/d1_mini/firmware.elf
Dump of assembler code for function crc32(void const*, size_t, uint32_t):
0x4020d0f0 <+0>: movi.n a2, 00x4020d0f2 <+2>: ret.n
End of assembler dump.
Moving main .o to the back of the 'library group' seems to help
/home/runner/.platformio/packages/toolchain-xtensa/bin/../lib/gcc/xtensa-lx106-elf/10.3.0/../../../../xtensa-lx106-elf/bin/ld: .pio/build/d1_mini/src/main.cpp.o: in function `crc32':/home/runner/dev/arduino7651/src/main.cpp:8: multiple definition of `crc32'; .pio/build/d1_mini/libFrameworkArduino.a(crc32.cpp.o):/home/runner/.platformio/packages/framework-arduinoespressif8266@src-31d658a59f41540201fc3726a1394910/cores/esp8266/crc32.cpp:39: first defined herecollect2: error: ld returned 1 exit status
Not sure if that has any more side-effects, or whether this feature is used by any sketches.
(iirc tasmota might override wificlient this way)
Is it possible to add a warning when a (global) function is redefined? Maybe even better to stop further compilation. I rather would have a build to fail compared to nearly impossible to find issues which may appear and disappear nearly random on new builds.
We've seen enough of those the last few years.
Activity
mcspr commentedon Nov 6, 2022
Linking happens like this right now
With a sketch c/p from the issue, lets add our own crc32 func
Resulting .elf has our function and not the original one, crc32 returning 0.
Moving main .o to the back of the 'library group' seems to help
Not sure if that has any more side-effects, or whether this feature is used by any sketches.
(iirc tasmota might override wificlient this way)
TD-er commentedon Nov 15, 2022
Is it possible to add a warning when a (global) function is redefined? Maybe even better to stop further compilation. I rather would have a build to fail compared to nearly impossible to find issues which may appear and disappear nearly random on new builds.
We've seen enough of those the last few years.