-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Make SPIFFS and LittleFS stay out of link when not needed #6699
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
Conversation
redefine them to do something useful when either spiffs or littlefs are used
I've looked at the code of this PR and I do think I get how it should work. Do you already have any idea on how much smaller a SPIFFS-only (or LittleFS-only) build is with this fix? |
SPIFFS is 32KB and LittleFS 25KB as far as I remember. The trick in this PR and WPS is that there are |
But why doesn't it try to link in the .o file if it does find the strong function implementation in there (and nothing else is needed) |
I don't know that for sure.
What I can say is that |
@TD-er it links either both, in which case the weak is discarded due to the presence of the strong, or just the weak, in which case the weak is used (and optimized out because it's an empty function). |
That's something I know, but what I don't know is how it is guaranteed the weak one is found first before the strong one, when the strong one is not needed. |
When a strong function is present, the weak function is used when
Example:
Run & results:
|
Thanks. |
Have you seen a decrease in binary size with this PR ? |
Have not yet tried this PR, since I have not been near a compile PC today. |
I did test it and it does save about 20k in build size (using SPIFFS) |
@TD-er please retest. If ok, this can be merged now for 2.6.0. |
I will be back home Thursday evening so I cannot test it before. |
We dont use SPIFFS nor LittleFS in Tasmota |
Time to release 2.6.0 :-) Tasmota does work reliable with latest master from tonight. |
We are going to release very soon now, probably this week. |
This comes after a discussion with @earlephilhower
(who will be too busy for the next days to come to continue on this)
replaces and closes #6697
fixes #6691
Tested with all 4 uncommented
ets_printf
from this PR,calling the two weak functions in
setup()
, and calling or notSPIFFS.begin()
/LittleFS.begin()
.