Prevent tail spin crash when option -pthread is used.
This commit is contained in:
6
libtcc.c
6
libtcc.c
@ -2410,8 +2410,10 @@ PUB_FUNC int tcc_parse_args(TCCState *s, int argc, char **argv)
|
|||||||
if (s->output_type == 0)
|
if (s->output_type == 0)
|
||||||
s->output_type = TCC_OUTPUT_EXE;
|
s->output_type = TCC_OUTPUT_EXE;
|
||||||
|
|
||||||
if (pas->pthread && s->output_type != TCC_OUTPUT_OBJ)
|
if (pas->pthread && s->output_type != TCC_OUTPUT_OBJ) {
|
||||||
tcc_set_options(s, "-lpthread");
|
args_parser_add_file(s, "-lpthread", TCC_FILETYPE_BINARY);
|
||||||
|
s->nb_libraries++;
|
||||||
|
}
|
||||||
|
|
||||||
if (s->output_type == TCC_OUTPUT_EXE)
|
if (s->output_type == TCC_OUTPUT_EXE)
|
||||||
tcc_set_linker(s, (const char *)pas->linker_arg.data);
|
tcc_set_linker(s, (const char *)pas->linker_arg.data);
|
||||||
|
|||||||
Reference in New Issue
Block a user