This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: -ffreestanding option of GCC
ali hagigat <hagigatali@gmail.com> writes:
> Although i specified compiling in a free standing environment but
> still libc.so, libgcc.so (-lc and -lgcc) and some other strange object
> files are being linked with my program like ccYT96w6.o, crt1.o,
> crtend.o...
> Why?
> Can i get rid of all of them some how?
> My interpretation of free standing was a program which does not depend
> on any external files, but why many files are here besides my file?
The -ffreestanding option directs the compiler to not assume that
standard functions have their usual definition, and to not assign any
special semantics to the function main. It does not change the linking
behaviour. You are looking for the -nostdlib option, or possibly
-nostartfiles or -nodefaultlibs.
Ian