Unified · Split
| @@ -252,7 +252,7 @@ libtcc.dylib: $(LIBTCC_OBJ) · 251 unmodified lines | |||
| 252 | 252 | ||
| 253 | # OSX libtcc.dylib (without rpath/ prefix) | 253 | # OSX libtcc.dylib (without rpath/ prefix) |
| 254 | libtcc.osx: $(LIBTCC_OBJ) | 254 | libtcc.osx: $(LIBTCC_OBJ) |
| 255 | $S$(CC) -shared -install_name libtcc.dylib -o libtcc.dylib $^ $(LDFLAGS) | 255 | $S$(CC) -shared -o libtcc.dylib $^ $(LDFLAGS) |
| 256 | 256 | ||
| 257 | # windows dynamic libtcc library | 257 | # windows dynamic libtcc library |
| 258 | libtcc.dll : $(LIBTCC_OBJ) | 258 | libtcc.dll : $(LIBTCC_OBJ) |
| @@ -1457,7 +1457,10 @@ ST_FUNC void tcc_add_runtime(TCCState *s1) · 1456 unmodified lines | |||
| 1457 | tcc_add_btstub(s1); | 1457 | tcc_add_btstub(s1); |
| 1458 | } | 1458 | } |
| 1459 | #endif | 1459 | #endif |
| 1460 | tcc_add_support(s1, TCC_LIBTCC1); | 1460 | /* libtcc1 is not needed when tccrun mode */ |
| 1461 | if (s1->output_type != TCC_OUTPUT_MEMORY){ | ||
| 1462 | tcc_add_support(s1, TCC_LIBTCC1); | ||
| 1463 | } | ||
| 1461 | #ifndef TCC_TARGET_MACHO | 1464 | #ifndef TCC_TARGET_MACHO |
| 1462 | /* add crt end if not memory output */ | 1465 | /* add crt end if not memory output */ |
| 1463 | if (s1->output_type != TCC_OUTPUT_MEMORY) | 1466 | if (s1->output_type != TCC_OUTPUT_MEMORY) |
| @@ -813,8 +813,12 @@ ST_FUNC int macho_output_file(TCCState *s1, const char *filename) · 812 unmodified lines | |||
| 813 | Section *s; | 813 | Section *s; |
| 814 | collect_sections(s1, &mo); | 814 | collect_sections(s1, &mo); |
| 815 | relocate_syms(s1, s1->symtab, 0); | 815 | relocate_syms(s1, s1->symtab, 0); |
| 816 | mo.ep->entryoff = get_sym_addr(s1, "main", 1, 1) | 816 | if (s1->output_type == TCC_OUTPUT_DLL) { |
| 817 | - get_segment(&mo, 1)->vmaddr; | 817 | /* TODO: more handling for .dylib ? */ |
| 818 | } else { | ||
| 819 | mo.ep->entryoff = get_sym_addr(s1, "main", 1, 1) | ||
| 820 | - get_segment(&mo, 1)->vmaddr; | ||
| 821 | } | ||
| 818 | if (s1->nb_errors) | 822 | if (s1->nb_errors) |
| 819 | goto do_ret; | 823 | goto do_ret; |
| 820 | 824 | ||