tcc.c: fix an error when you build an object file with '-pthread' key set
commit0a50e6c933cb3d470494c203e90808cef6873b06
authorSergei Trofimovich <st@anti-virus.by>
Tue, 4 Jan 2011 09:17:52 +0000 (4 11:17 +0200)
committerSergei Trofimovich <st@anti-virus.by>
Tue, 4 Jan 2011 09:17:52 +0000 (4 11:17 +0200)
tree8b8f7a193219a5e6f30ea9f927f6db0fe2b163de
parentd97a25fbdd80ad005be41e9d47d6aefe2a5f6cae
tcc.c: fix an error when you build an object file with '-pthread' key set

The problem was partially fixed by Henry in the following patch:

    tcc.c: skip -lpthread when -c option specified

But that patch had one brawback: it is sensitive to argument order,
as decision is taken during commandline parsing:

    $ tcc -c a.c -o a.o -pthread # 1. works fine
    tcc: error: file 'a.c' not found

    $ tcc -pthread -c a.c -o a.o # 2. blows
    tcc: error: cannot specify libraries with -c

This patch fixes case 2.

Signed-off-by: Sergei Trofimovich <st@anti-virus.by>
tcc.c