2020-03-06 08:53 AM
Just out of curiosity. Why STM32CubeIDE linker files discard libc.a libg.a and libgcc.a?
At the end of the linker file we usually find:
/* Remove information from the compiler libraries */
/DISCARD/ :
{
libc.a ( * )
libm.a ( * )
libgcc.a ( * )
}
Maybe I didn't get something right but, shouldn't the libc.a include all the C standard library code, so it should be needed to compile a C application?
Regards,
2020-04-29 05:45 AM
Hi,
Did you by any chance manage to find an answer to this question?
I tried using libc_nano.a instead of libc.a and I wasn't able to compile my code until I changed the linker file to discard libc_nano.a as well.
The linker complained of multiple definitions of almost all functions inside libc.a and I don't know why.
However, in CubeMX there seems to be no option to use libc_nano.a which would generate the correct LD file and this isn't exactly an obvious thing to look for.
Regards
2020-11-30 06:53 AM
Naming the library in the DISCARD section includes the whole library. You can change it to
libc.a:* ( * )
avoid this.