From ef730c4d2f4bdeb8a9b88aa0078abc4bc943371b Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Mon, 18 May 2020 05:20:31 +0200 Subject: [PATCH] macos: don't like in crt startup code it's not needed with LC_MAIN executables. --- libtcc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libtcc.c b/libtcc.c index 61168deb..81c65444 100644 --- a/libtcc.c +++ b/libtcc.c @@ -1040,9 +1040,12 @@ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type) /* add libc crt1/crti objects */ if ((output_type == TCC_OUTPUT_EXE || output_type == TCC_OUTPUT_DLL) && !s->nostdlib) { +#ifndef TCC_TARGET_MACHO + /* Mach-O with LC_MAIN doesn't need any crt startup code. */ if (output_type != TCC_OUTPUT_DLL) tcc_add_crt(s, "crt1.o"); tcc_add_crt(s, "crti.o"); +#endif } #endif return 0;