aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libtcc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libtcc.c b/libtcc.c
index 827d3c0..d631a43 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -2410,8 +2410,10 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv)
if (s->output_type == 0)
s->output_type = TCC_OUTPUT_EXE;
- if (pas->pthread && s->output_type != TCC_OUTPUT_OBJ)
- tcc_set_options(s, "-lpthread");
+ if (pas->pthread && s->output_type != TCC_OUTPUT_OBJ) {
+ args_parser_add_file(s, "-lpthread", TCC_FILETYPE_BINARY);
+ s->nb_libraries++;
+ }
if (s->output_type == TCC_OUTPUT_EXE)
tcc_set_linker(s, (const char *)pas->linker_arg.data);