It wasn't clear to me if the original poster was asking about object modules which include external links to be resolved by the linker, or was asking about executables, which would include library code (or overlay handlers). The compiler would at least need to generate the code required to call printf().
How was the initial gcc compiler created? You'd need an existing C compiler in order to compile C code. I mentioned this above, that this is either done by cross compiling from another machine, or by creating the initial version of a compiler in a language already supported by the target machine.
As an early example, Altair Basic's roots go back to an 8008/8080 emulator that ran on a PDP-10. The paper tape loader mentioned in the wiki article had to be toggled into memory using the Altair's front panel: