Objective-C has a runtime that translates its syntax into functions that are organized and compiled. Does C have a runtime library? Also, if anyone can answer the question, what are the steps GCC takes during C compilation? e.g. main.c >> main.s >> main.bin
Objective-C has a runtime that translates its syntax into functions that are organized and
Share
Yes, the C language features a standard library; that is, a number of standard macros, routines and types one can use in his programs, apart from any in the core language itself.
In popular implementations, there is a separate library file containing the code for the C standard library. For example, in GNU/Linux environments, the GNU C library (
libc) is almost always present. Microsoft provides themsvcrt.dllruntime library for the Windows system, and so on.Also, the C standard library might not be available in freestanding implementations. Sometimes it is possible to compile a program without linking against the C standard library from your system. As an example, the Windows API is well known for behaving as a freestanding C programming environment (although one might need to link against other system libraries specific to Windows).
Regarding GCC, the following illustrates briefly the compilation pipeline:
cpp, resulting in a translation unit. (Actually, as Basile pointed out, nowadays nocppprocess is created; the entire preprocessing work is done withincc1. Nevertheless, the resulting behavior is most likely the same as withcpp.)cc1;as;ld.Naturally, each of these steps may be altered or not executed at all depending on the driver options; the above is just a rough explanation of the overall process.