fixed libc linking when running in memory

tcc-xref
bellard 2003-10-04 21:24:46 +00:00
parent bef8703f77
commit feed3262c9
1 changed files with 5 additions and 2 deletions

View File

@ -849,9 +849,12 @@ static void tcc_add_runtime(TCCState *s1)
#endif
}
#endif
/* add libc if not memory output */
if (s1->output_type != TCC_OUTPUT_MEMORY && !s1->nostdlib) {
/* add libc */
if (!s1->nostdlib) {
tcc_add_library(s1, "c");
}
/* add crt end if not memory output */
if (s1->output_type != TCC_OUTPUT_MEMORY && !s1->nostdlib) {
tcc_add_file(s1, CONFIG_TCC_CRT_PREFIX "/crtn.o");
}
/* add various standard linker symbols */