diff options
| author | seyko <seyko2@gmail.com> | 2015-05-03 14:17:18 +0300 |
|---|---|---|
| committer | seyko <seyko2@gmail.com> | 2015-05-03 14:17:18 +0300 |
| commit | 576aeb3aa933af4114cc2ca4e64794e85f528f0e (patch) | |
| tree | 792eeeafd1dfe955b821429b19636e9e43ed8385 /libtcc.c | |
| parent | 2ba219f781a304112398cc37fb382c762a1c7cf4 (diff) | |
| download | tinycc-576aeb3aa933af4114cc2ca4e64794e85f528f0e.tar.gz tinycc-576aeb3aa933af4114cc2ca4e64794e85f528f0e.tar.bz2 | |
fix "tcc test.c -Wl,,--oformat,binary"
set linker options only when "s->output_type == TCC_OUTPUT_EXE"
otherwise tcc will produce a wrong object file
Diffstat (limited to 'libtcc.c')
| -rw-r--r-- | libtcc.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -2057,10 +2057,14 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv) } } + if (s->output_type == 0) + s->output_type = TCC_OUTPUT_EXE; + if (pthread && s->output_type != TCC_OUTPUT_OBJ) tcc_set_options(s, "-lpthread"); - tcc_set_linker(s, (const char *)linker_arg.data); + if (s->output_type == TCC_OUTPUT_EXE) + tcc_set_linker(s, (const char *)linker_arg.data); cstr_free(&linker_arg); return optind; |
