From bb16d92f82ca3d4b3969c4833631dce2b3bce534 Mon Sep 17 00:00:00 2001 From: Érico Rolim Date: Mon, 7 Dec 2020 12:34:00 -0300 Subject: Support -pthread compiler flag. POSIX requires -lpthread, but most Linux manual pages recommend using -pthread, and a lot of projects use it. --- driver.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/driver.c b/driver.c index 39fcc7b..ea422a1 100644 --- a/driver.c +++ b/driver.c @@ -440,6 +440,9 @@ main(int argc, char *argv[]) arrayaddptr(&stages[PREPROCESS].cmd, arg); } else if (strcmp(arg, "-pedantic") == 0) { /* ignore */ + } else if (strcmp(arg, "-pthread") == 0) { + arrayaddptr(&stages[LINK].cmd, "-l"); + arrayaddptr(&stages[LINK].cmd, "pthread"); } else { if (arg[2] != '\0' && strchr("cESsv", arg[1])) usage(NULL); -- cgit v1.2.3