203 Commits

Author SHA1 Message Date
Bernhard Reutner-Fischer
21cbb6fe88 unistd.h: put getppid under XOPEN2K8
Add __LEAF to all __THROW, introduce non-leaf __THROWNL
Adjust affected spots accordingly.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-13 21:12:37 +01:00
Bernhard Reutner-Fischer
41537a770b buildsys: fix IS_IN_lib*
define NOT_IN_libc / IS_IN_libxxx appropriately
to fix pthread_once

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-16 22:42:06 +02:00
Waldemar Brodkorb
6d550ddd12 sparc: remove sparc64/sparcv9 code
The sparc64/sparcv9 code is incomplete. Furthermore there is
no real embedded hardware for sparc64 available, so better remove
it until someone comes up with a complete port.

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-04 13:56:34 +02:00
Vineet Gupta
374db5d174 LT.old: Add ARC support
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-12-20 14:38:23 +01:00
Bernhard Reutner-Fischer
479faad8a6 LT.old: add missing prototypes
to silence warning

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-20 10:10:17 +01:00
Vineet Gupta
f0489b5c79 LT{,.old}: include stddef.h for size_t
A user application built with -D_POSIX_C_SOURCE=200112L and
 #include signal.h, yields following compilation error:

------------------->8-----------------------------
arc-linux-uclibc-gcc -D_POSIX_C_SOURCE=200112L hello.c
In file included from
/opt/INSTALL/lib/gcc/arc-linux-uclibc/4.4.7/../../../../arc-linux-uclibc/sys-include/signal.h:429,
                 from hello.c:1:
/opt/INSTALL/lib/gcc/arc-linux-uclibc/4.4.7/../../../../arc-linux-uclibc/sys-include/bits/pthreadtypes.h:48:
error: expected specifier-qualifier-list before 'size_t'
------------------->8-----------------------------

The fix is to make sure size_t is explicitly provided to pthreadtype.h

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-03-13 09:46:18 +01:00
Markos Chandras
faa3bc7b7c not-cancel.h: Use openat if arch does not have the open syscall
Signed-off-by: Markos Chandras <markos.chandras@imgtec.com>

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-02-20 13:45:13 +01:00
Bernhard Reutner-Fischer
a586f419f5 LT.old: reinstate build
As noted by Florian Fainelli:
  LD libpthread-0.9.34-git.so
libpthread/linuxthreads.old/libpthread_so.a(wrapsyscall.oS): In function `fcntl64':
wrapsyscall.c:(.text+0xd8): undefined reference to `__libc_fcntl64'
libpthread/linuxthreads.old/libpthread_so.a(wrapsyscall.oS): In function `lseek64':
wrapsyscall.c:(.text+0x190): undefined reference to `__libc_lseek64'
libpthread/linuxthreads.old/libpthread_so.a(wrapsyscall.oS): In function `pread64':
wrapsyscall.c:(.text+0x39c): undefined reference to `__libc_pread64'

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-01-14 17:52:28 +01:00
Mike Frysinger
290e19f814 drop support for pre ISO-C compilers
This drops __signed, __volatile, and __const.  Only the latter was
used in the code base, and for uClibc, not consistently.  Much of
the code used plain "const" which meant "__const" was useless.

Really, the point of this is to stay in sync with what glibc did.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-11-18 06:17:03 -05:00
Mike Frysinger
266bdc1f62 Replace FSF snail mail address with URLs
This matches a similar change made to glibc.

No functional changes here.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-11-18 06:03:38 -05:00
Chris Zankel
5c0a3b60fb xtensa: use atomic instructions instead of a syscall
Replace system calls with atomic instructions for 'compare and swap'
in linuxthreads.old.

Signed-off-by: Chris Zankel <chris@zankel.net>
2012-11-03 12:57:45 -07:00
Bernd Schmidt
3411a732ec Remove pragma weak for undeclared symbol
pthread_initialize is a static function and should not be mentioned in a
header.  The #pragma weak for it appears to confuse gcc-4.7.

Signed-off-by: Bernd Schmidt <bernds@codesourcery.com
2012-07-24 15:51:23 +02:00
Bernd Schmidt
8345b5cfe1 Remove use of attribute_shared_hidden
This attribute is not defined anywhere. Removed its use to make the file
compile.

Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
2012-07-24 15:50:56 +02:00
Peter S. Mazinger
fe1423c4a8 linuxthreads.old: build all objects twice, once for shared lib and once for static
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:44 +02:00
Peter S. Mazinger
088f450bfd linuxthreads.old: move libpthread_hidden_proto to header
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:44 +02:00
Peter S. Mazinger
40eb40a99a linuxthreads.old/internals.h: make some internal functions hidden
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:44 +02:00
Peter S. Mazinger
1d2dbb9eb2 linuxthreads: guard *tsd* related stuff correctly
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:44 +02:00
Peter S. Mazinger
b9e95fe38e libc_pthread_init.c: include only what is necessary
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:43 +02:00
Peter S. Mazinger
71a7acbd4e linuxthreads.old: cleanup a bit
Use __UCLIBC_HAS_TLS__ instead of USE___THREADS (although this LT implementation
will never support TLS).
Disable unused/unneeded members of the pthread_functions structure.
No redirect/forward for _pthread_cleanup_push/pop, it would have not worked anyway
due to the fact, that the structure member was not initialized. Disable it's possible
internal use in libc-lock.h.
Avoid using internals.h in libc_pthread_init.c (moving a prototype to pthread-functions.h).

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:43 +02:00
Peter S. Mazinger
e757515091 linuxthreads.old: remove __old_sem_* and rename __new_sem_* to sem_*
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:43 +02:00
Peter S. Mazinger
295d4b49a6 wrapsyscall.c: add cancellable fcntl64
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:42 +02:00
Peter S. Mazinger
4228d2f34c ptfork.c: use strong_alias for vfork
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:41 +02:00
Peter S. Mazinger
bb0b54956b internals.h: use sysconf(_SC_PAGESIZE) instead of __pagesize
Rename PAGE_SIZE to __PAGE_SIZE to be sure that we do not get the
definition from uClibc_page.h.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:33 +02:00
Peter S. Mazinger
47adeb6a1c wrapsyscall.c: include proper header for epoll
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:31 +02:00
Peter S. Mazinger
1f3ca8e086 allocrtsig.c,pthread.c: disable __libc_allocate_rtsig, unused
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:28 +02:00
Peter S. Mazinger
b91a7f431d cleanup fork()
Keep only fork (and it's hidden variant) and __libc_fork.
Common __libc_fork prototype in unistd.h.
Get rid of __fork, by changing HIDDEN_JUMPTARGET(__fork) to use fork
I can't see the reason to have fork() in libpthread, but kept it for now
making __fork static in these files.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:24 +02:00
Peter S. Mazinger
741caa9982 semaphore.h, uClibc_local_lim.h: make sure SEM_VALUE_MAX is always defined
LT old and new provided SEM_VALUE_MAX in semaphore.h, NPTL in local_lim.h
Make sure to get the same definitions, independently of the fact, that
semaphore.h is included or not.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:24 +02:00
Peter S. Mazinger
d70e284a0d semaphore.c: include limits.h before semaphore.h
else SEM_VALUE_MAX will be undefined

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:24 +02:00
Peter S. Mazinger
14647468df make use of jmpbuf-offsets.h and jmpbuf-unwind.h
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:23 +02:00
Peter S. Mazinger
8f86b8a197 move *longjmp related prototypes to setjmp.h
Provide common prototypes for __longjmp, __libc_longjmp, __libc_siglongjmp
_longjmp_unwind, __libc_unwind_longjmp in setjmp.h in preparation for use in LT new
Add __longjmp to h8300 and i960
Make common longjmp.c good for NPTL
Guard _longjmp_unwind use in sh's longjmp.c for NPTL (I think sh could use the common one)
Remove unneeded attribute_noreturn, prototype provides it already

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:23 +02:00
Peter S. Mazinger
db19d8d0a9 signal.h: provide prototype for __libc_sigaction and remove all others
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:22 +02:00
Peter S. Mazinger
1533e2876b remove __FORCE_GLIBC
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:21 +02:00
Peter S. Mazinger
5d39c1ed76 do not include libc-internal.h
it is already included by features.h

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15 14:00:21 +02:00
Mike Frysinger
7dd2d7821e linuxthreads.old: fix build warnings with epoll enabled
Pull in the epoll header for the epoll structs.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-05-05 15:05:23 -04:00
Mike Frysinger
c51edb3fae linuxthreads.old: refactor nommu logic a little to avoid mmu warning
Should be no functional changes; just fixing:

libpthread/linuxthreads.old/manager.c: In function 'pthread_free':
libpthread/linuxthreads.old/manager.c:707:9: warning:
	variable 'h_bottom_save' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-24 01:39:15 -04:00
Mike Frysinger
84347a3c16 linuxthreads.old: pass back up saved_errno value in manager init
This matches the newer linuxthreads code, and fixes the build warning:

libpthread/linuxthreads.old/manager.c: In function 'pthread_handle_create':
libpthread/linuxthreads.old/manager.c:487:7: warning:
	variable 'saved_errno' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-24 01:39:15 -04:00
Mike Frysinger
22eb98f555 linuxthreads.old: fix set-but-unused warning
Move spin_count down to the code block where it's used to fix the warning:

libpthread/linuxthreads.old/spinlock.c: In function '__pthread_lock':
libpthread/linuxthreads.old/spinlock.c:70:7: warning:
	variable 'spin_count' set but not used [-Wunused-but-set-variable]

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-24 01:39:15 -04:00
Mike Frysinger
9c8c3a7914 linuxthreads.old: fix typo in pthread_mutex_unlock hidden prototype
Reported-by: Tony Wu <tung7970@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-24 01:26:09 -04:00
Mike Frysinger
0c3247e4c1 linuxthreads.old: only declare __pthread_xxx funcs hidden inside of libpthread
These stubs get used in libc as forwarding funcs, so we don't want them
labeled as hidden.  Otherwise, attempting to use them in other libraries
(like libdl) will result in references to symbols that only libpthread
provides.  Such as:
	/usr/bin/python2.6: can't resolve symbol '__pthread_mutex_lock' in lib '/lib/libdl.so.0'.

This also brings the old code in line with the newer linuxthreads.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-22 18:00:45 -04:00
Rob Landley
015179a2c8 sparc: fix build for linuxthreads.old
sparc target has assembly implementations of clone.S that doesn't
get used, and thus the build breaks.  Also, sparc is missing a header file in
pthreads.old that exists in pthreads.new.

Signed-off-by: Rob Landley <rob@landley.net>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2011-10-27 07:32:55 -07:00
Peter S. Mazinger
c6057584e0 epoll.c: add cancellation to epoll_[p]wait()
While there, fix epoll_pwait syscall, it takes 6 arguments

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-13 11:31:10 +02:00
Bernhard Reutner-Fischer
c91c3a2b27 commentary typo fix
use cancellation (with two 'l') uniformly.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-11 22:03:33 +02:00
Aurelien Jacquiot
46d6a24872 The C6X port
This adds support for the TI C6X family of processors.

Signed-off-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Aurelien Jacquiot <a-jacquiot@ti.com>
Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
2011-03-05 18:10:15 +01:00
Bernd Schmidt
817f685f4c Allow ABIs where SP points below the stack frame.
On C6X, the stack pointer points to a word that is not part of the current
function's stack frame.  It may be overwritten by callees.  Take this into
account when creating the stack for a cloned thread.

Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
2011-03-05 18:10:15 +01:00
Bernd Schmidt bernds_cb1@t-online.de
f4eebb6146 Add Makefile support for DSBT ELF.
This adds support for a new binary format, DSBT ELF, to the Makefiles.
Every shared library is assigned a DSBT index, and the link.so macro is
adjusted to ensure the correct linker argument is passed.

Configuration and ldso support will follow in separate commits.

Signed-off-by: Bernd Schmidt <bernds@codesourcery.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-03-05 18:09:46 +01:00
Peter S. Mazinger
5e22e71adf remove ucontext.h and guard sigstack structure with SUSV4_LEGACY and STRICT_HEADERS
Remove ucontext.h if SUSV4_LEGACY is not set and fix it's references.
Guard sigstack structure with SUSV4_LEGACY and STRICT_HEADERS.
Disable sigstack function prototype, it is not provided by uClibc.

Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-03 18:22:50 +01:00
Mike Frysinger
7a583ea370 linuxthreads.old: fix nommu initial thread stack detection
Because the nommu address space is flat, and the application stack can
literally be located anywhere, we cannot rely on the assumptions that the
mmu port gets away with.  Namely, that the first thread's stack lives at
the top of memory and nothing will be created above it.

Currently, the code rounds the current stack up a page and sets that as
the "top" of the stack, and then marks the "bottom" of the stack as "1".
Then as new threads are created, this assumption is further refined by
slowly backing off the "bottom" when a new stack is created within the
range of the initial stack.

Simple ascii example (tid0 is the initial thread):

1 thread:
 [bos          tid0 stack           tos]

2 threads:
                 [     tid0 stack      ]
      [tid1 stack]

3 threads:
                 [     tid0 stack      ]
      [tid1 stack]
                                            [tid2 stack]

As you can kind of see, this algorithm operates on one basic assumption:
the initial top of stack calculation is the absolute top of the stack.
While this assumption was fairly safe in the original nommu days of yore
where the only file format was FLAT (which defaults to a 4KiB stack --
exactly 1 page), and memory was fairly tight, we can see that this falls
apart pretty quickly as soon as the initial stack is larger than a page.

The issue that crops up now is simple to hit: start an application with
an 8KiB stack, execute some functions that put pressure on the stack so
that it exceeds 4KiB, then start up some threads.  The initial tos will
be rounded up by a page, but this is actually the middle of the stack.
Now when the initial thread returns from its functions (thus unwinding
the stack) and tries to call something which calls back into libpthread,
the thread_self() func fails to detect itself as the initial thread as
the current stack is now above the tos.  The __pthread_find_self() func
kicks in, walks all the thread arrays, fails to find a hit, and then
walks into uninitialized memory for the thread descriptor.  Use of this
garbage memory has obvious results -- things fall down & go boom.

To address this, I extend the current algorithm to automatically scale
back both the bottom and the top stack limits of the initial thread.
We use the current stack pointer at "thread boot time" only as a single
known point.  The initial thread stack bottom is set to the bottom of
memory and the initial thread stack top is set to the top of memory.
Then as we create new stack threads, we figure out whether the new stack
is above or below the single known good address, and then scale back
either the tos or the bos accordingly.

Reviewed-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2011-02-24 08:25:06 -05:00
Steven J. Magnani
87fd5816c9 microblaze: thread support
Header files needed to build linuxthreads.old for microblaze.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2010-11-10 19:44:37 +01:00
Austin Foxley
00891d9cf0 enable building __fcntl_nocancel, as it used unconditionally now
also sync up not-cancel.h headers between all three thread libraries

Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-25 22:08:02 -07:00
Natanael Copa
71239593ef nptl: proper soname handling
Since sublevel releases are not ABI compatible we need to adjust
the soname to include the sublevel version.

This makes it possible to install ABI incompatible versions of the
library side by side so clean upgrades are possible.

Signed-off-by: Natanael Copa <natanael.copa@gmail.com>
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
2010-04-22 08:39:36 -07:00