Tested on Ubuntu 16.04 LTS x86-64 and latest tcc mob (0.9.27)
Use the following test.c file:
int main(int argc, char **argv) { return 0; }
Compile only:
tcc -c ./test.c # -> test.o
Normal executable:
tcc ./test.o -otest # -> working "test"
Try the same with -pthread:
tcc -pthread ./test.o -otest # -> tcc: error: undefined symbol 'main'
tcc -hh shows:
-pthread same as -D_REENTRANT and -lpthread
However, this does work:
tcc -D_REENTRANT -lpthread ./test.o -otest # --> working "test"
So it seems -pthread is broken and doesn't do what it says it should.
It is recognized though. E.g. using -pthreadX results in:
tcc: error: invalid option -- '-pthreadX'