it's not needed with LC_MAIN executables.
Unified · Split
| @@ -1040,9 +1040,12 @@ LIBTCCAPI int tcc_set_output_type(TCCState *s, int output_type) · 1039 unmodified lines | ||
| 1040 | 1040 | /* add libc crt1/crti objects */ |
| 1041 | 1041 | if ((output_type == TCC_OUTPUT_EXE || output_type == TCC_OUTPUT_DLL) && |
| 1042 | 1042 | !s->nostdlib) { |
| 1043 | +#ifndef TCC_TARGET_MACHO | |
| 1044 | + /* Mach-O with LC_MAIN doesn't need any crt startup code. */ | |
| 1043 | 1045 | if (output_type != TCC_OUTPUT_DLL) |
| 1044 | 1046 | tcc_add_crt(s, "crt1.o"); |
| 1045 | 1047 | tcc_add_crt(s, "crti.o"); |
| 1048 | +#endif | |
| 1046 | 1049 | } |
| 1047 | 1050 | #endif |
| 1048 | 1051 | return 0; |