[Top][All Lists]

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

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

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

I think maybe, instead of saying and doing:
-pthread   same as -D_REENTRANT and -lpthread

It should say and do something along these lines:
-pthread   same as -D_REENTRANT while compiling and -lpthread while linking

On Saturday, December 23, 2017 3:37 PM, avih <address@hidden> wrote:

Thanks, confirmed the reported test case now works.

However, It seems to still not behave the same as gcc.
Using the same test.c file as before:

tcc -pthread -c test.c
# -> tcc: error: cannot specify libraries with -c

It's not unreasonable I think that tcc complains, but gcc is fine with it.

The above is a reduced test case from compiling mpv (the video player),
which uses -pthread both while compiling c files and while linking.

The build system which mpv uses is waf - patched by me to support tcc.

On Saturday, December 23, 2017 3:17 PM, Michael Matz <address@hidden> wrote:


On Sat, 23 Dec 2017, avih wrote:

> Try the same with -pthread:
> tcc -pthread ./test.o -otest  # -> tcc: error: undefined symbol 'main'

Thanks for the report.  Fix in mob.


reply via email to

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