-
Notifications
You must be signed in to change notification settings - Fork 13.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
Assembler errors while compiling on esphome with framework version >=3.0.0 #8672
Comments
What happens in command line? i.e. esphome equivalent of |
ESPHome successfully generates this build dir:
Here are the actual files: thermik.tar.gz If I run
But if I edit
to
then |
Yes |
--- src/t.h 2022-09-11 22:32:42.000000000 +0300
+++ src/t.h.mod 2022-09-11 23:05:37.294064517 +0300
@@ -15,10 +15,12 @@
((MyComponent*)OTC)->process();
}
- IRAM_ATTR void process() {
+ void process();
+};
+
+IRAM_ATTR void process() {
const char* Peow[] = {
"A",
"B"
};
- }
-};
+} (if someone more familiar with section <-> asm <-> inline decl and def interaction could explain this, please do :) |
Wow, good job! And it even works with the same definition but external implementation (not sure if those terms are correct). Wonder if I should leave the first IRAM_ATTR in place...
My main project works with the recommended framework now using this workaround. Thank you, @mcspr! |
Oops, sorry, that is what I meant. You could totally could use either standalone func or a class method, the point is just to move both section attribute and function body out of the class body aka make it not inline. It does seem like a workaround, true, just not sure which part of the build takes the blame |
The true MCVE is here: It doesn't require any external environment, reproduces only with the toolchain.
You might want to change "-c" to "-S" and see the assemble listing :) (imho this is a bug of GCC, not others) |
Something in optimization, then?
edit: ref. .section .rodata.42".str1.4,"aMS",@progbits,1 |
Looking a second time - __attribute__((section ("\"bar.42\"")))
+ __attribute__((section ("bar.42"))) This generates .section .rodata.42.str1.4,"aMS",@progbits,1 Versus the faulty .section .rodata.42".str1.4,"aMS",@progbits,1 |
One more thing: What does that ".section" qualify? |
.file "mcve.cpp"
.section .rodata.42".str1.1,"aMS",@progbits,1 ; <<<
.LC0:
.string "A"
.LC1:
.string "B"
.text
.global x
.section .bss
.type x, @object
.size x, 1
x:
.zero 1
.ident "GCC: (GNU) 10.3.0" |
But we should have expected |
Which is inlined here, so supposedly it is generated at some point and then discarded? My bet is off-by-one error, somewhere dealing with these section strings (if / when they are in nearby memory) :) |
Basic Infos
Platform
Problem Description
Hello. I came from ESPHome world, going deeper and deeper (ESPHome -> PlatformIO -> ESP8266 core for Arduino) trying to debug this problem.
This initially was published as ESPHome issue esphome/issues#3311
When the code below is being built with framework version 3.0.0 or higher, the process fails with errors like this:
If I switch back to version 2.7.4 (well, looks like for some reason PlatformIO uses 2.6.3 in that case), everything is fine, it builds successfully and works as expected.
MCVE Sketch
Minimal code for reproduction in ESPHome is https://gist.github.com/Chupaka/6679f559a29aa513bc4e8120762b2cdc (2 small files)
To get back to framework 2.7.4, edit
t.yaml
:The text was updated successfully, but these errors were encountered: