-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Setting LV_ATTRIBUTE_FAST_MEM spawns linker warnings on ESP-IDF v5.1 #4391
Comments
Hi, Thank you for opening this issue!
Are we sure that the compiler in general will like having the What do you think? |
At least this is how all the sources of ESP-IDF are made, IRAM_ATTR is placed only in C files for function bodies, and in H files if it's an inline function. Here's a quick search for And they are clearly aware of this issue, here's a piece of CMakeLists.txt where they temporarily silence this warning for Clang (support for which hasn't been released yet). Probably GCC prior to 12 did not generate a warning for this, but Clang and GCC12 do: BUT, I did some research and as GCC docs state:
Based on this, I'd rather keep the OTOH if an attribute is mentioned only in header prototypes, wouldn't it create a new section on each inclusion of a header file because of the counter macro? So maybe keeping it in C files only isn't a bad idea after all, I doubt the compiler would have problems with C-files-only attributes since this work is done by the linker after the fact anyways |
I agree with that. Do you have time to send a Pull request with the required changes? |
Sure, should I use release/v8.3 for that? |
removed function attributes from prototypes and kept only on function declarations or static inline functions: - LV_ATTRIBUTE_TICK_INC - LV_ATTRIBUTE_TIMER_HANDLER - LV_ATTRIBUTE_FLUSH_READY This fixes an issue in ESP-IDF where section attributes use __COUNTER__ macro, and this results in prototype and declaration having different sections assigned
…gl#4391) removed function attributes from prototypes and kept only on function declarations or static inline functions: - LV_ATTRIBUTE_FAST_MEM This fixes an issue in ESP-IDF where section attributes use __COUNTER__ macro, and this results in prototype and declaration having different sections assigned
fixed attributes should be specified before the declarator in a function definition regression introduced in 6663930
PR is mered, closing. |
Perform all steps below and tick them with [x]
Describe the bug
I'm using ESP-IDF v5.1 (stable) with lvgl v8.3.8 (from component manager). When I enable
Set IRAM as LV_ATTRIBUTE_FAST_MEM
linker produces a bunch of warnings about conflicting iram sections like this:You can clearly see different sections are assigned to function and to its prototype because
IRAM_ATTR
expands with_SECTION_ATTR_IMPL(".iram1", __COUNTER__)
macro that uses__COUNTER__
. This was not the case for v5.0 supposedly because v5.1 updated to GCC12.2.0 and this was ignoredThis issue comment mentions what can be a fix for this problem:
And indeed all ESP-IDF sources follow that practice
Here is the full output of the linkage:
The text was updated successfully, but these errors were encountered: