embeddedartistry / libc

libc targeted for embedded systems usage. Reduced set of functionality (due to embedded nature). Chosen for portability and quick bringup.
MIT License
510 stars 67 forks source link

Linker Flag Investigation: -nolibc vs -nostdlib/-nodefaultlibs #125

Open phillipjohnston opened 4 years ago

phillipjohnston commented 4 years ago

Shoudl our libc use this flag? instead of nostdlib or nodefaultlibs?

-nolibc
Do not use the C library or system libraries tightly coupled with it when linking. Still link with the startup files, libgcc or toolchain provided language support libraries such as libgnat, libgfortran or libstdc++ unless options preventing their inclusion are used as well. This typically removes -lc from the link command line, as well as system libraries that normally go with it and become meaningless when absence of a C library is assumed, for example -lpthread or -lm in some configurations. This is intended for bare-board targets when there is indeed no C library available.

This might eliminate the need to handle #124