libc: consolidate pthread stub functions
authorSimon Schubert <simon.schubert@epfl.ch>
Tue, 26 May 2009 20:15:47 +0000 (22:15 +0200)
committerSimon Schubert <simon.schubert@epfl.ch>
Wed, 27 May 2009 09:46:27 +0000 (11:46 +0200)
commit82205bfb5bec67600a6b477c8acf5b7268bd3704
tree7a34084fa53402e2d6bfc14fd1626e1db18eff58
parentc39dd9c03996a319fd592e3f137eb602ce5a91e2
libc: consolidate pthread stub functions

To Hasso's and my surprise we are maintaining two sets of stub functions
for pthread.  These stubs are present so that consumers that are thread
aware, but don't require pthreads, will successfully link even without
-lpthread.

pthread_fake.c was introduced for external consumers, I believe Xorg.
It provided externally visible weak symbols for pthread_* functions that
all returned an error.

_pthread_stubs.c was introduced later so that libc could be made pthread
aware.  It provided only stub functions that are used by libc itself,
provided by weak symbols for _pthread_* (notice leading underscore).
These functions returned always success, so that libc could operate
properly.

This consolidation now provides weak symbols for both pthread_* and
_pthread_* for all functions defined by libpthread, except for
pthread_create.  These functions return success and/or behave properly.
lib/libc/gen/Makefile.inc
lib/libc/gen/_pthread_stubs.c
lib/libc/gen/pthread_fake.c [deleted file]