tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] "error: undefined symbol main" with -pthread on linux


From: avih
Subject: [Tinycc-devel] "error: undefined symbol main" with -pthread on linux
Date: Sat, 23 Dec 2017 10:19:09 +0000 (UTC)

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'

reply via email to

[Prev in Thread] Current Thread [Next in Thread]