macos: don't like in crt startup code

it's not needed with LC_MAIN executables.
This commit is contained in:
Michael Matz 2020-05-18 05:20:31 +02:00
parent 51f15d9971
commit ef730c4d2f

View File

@ -1040,9 +1040,12 @@ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type)
/* add libc crt1/crti objects */ /* add libc crt1/crti objects */
if ((output_type == TCC_OUTPUT_EXE || output_type == TCC_OUTPUT_DLL) && if ((output_type == TCC_OUTPUT_EXE || output_type == TCC_OUTPUT_DLL) &&
!s->nostdlib) { !s->nostdlib) {
#ifndef TCC_TARGET_MACHO
/* Mach-O with LC_MAIN doesn't need any crt startup code. */
if (output_type != TCC_OUTPUT_DLL) if (output_type != TCC_OUTPUT_DLL)
tcc_add_crt(s, "crt1.o"); tcc_add_crt(s, "crt1.o");
tcc_add_crt(s, "crti.o"); tcc_add_crt(s, "crti.o");
#endif
} }
#endif #endif
return 0; return 0;