Pthread uses RAM and flash even not used (IDFGH-13283) #14213
Labels
Resolution: NA
Issue resolution is unavailable
Status: Done
Issue is done internally
Type: Bug
bugs in IDF
Answers checklist.
IDF version.
v5.1.1
Operating System used.
Windows
How did you build your project?
Command line with Make
If you are using Windows, please specify command line type.
None
What is the expected behavior?
What is the actual behavior?
startup.c
callsesp_pthread_init()
even when pthread is not used.Steps to reproduce.
pthread/pthread.c
,newlib/pthread.c,
pthread/pthread_rwlock.c
,pthread/local_storage.c
,pthread/pthread_cond_var.c
, and remove call toesp_pthread_init()
instartup.c
and compare binary size with regular build.Build or installation Logs.
There will also be savings in heap space which are not shown here.
More Information.
Even with pthread linked in, but completely unused, the functions remain in the final binary. This can be seen via the map file:
This shows that pthread_create is not used anywhere outside its own compilation unit, but it does not get stripped. Why not?
The text was updated successfully, but these errors were encountered: