summaryrefslogtreecommitdiff
path: root/libpthread
AgeCommit message (Collapse)Author
2012-06-15remove __FORCE_GLIBCPeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-06-15do not include libc-internal.hPeter S. Mazinger
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-06MIPS: Convert __syscall_error() callers to use $a0 for argumentKevin Cernekee
Some callers passed the first argument in $v0, while others used $a0. Change the callers to use $a0 consistently. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-05-05linuxthreads.old: fix build warnings with epoll enabledMike Frysinger
Pull in the epoll header for the epoll structs. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-24linuxthreads.old: refactor nommu logic a little to avoid mmu warningMike Frysinger
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-24linuxthreads.old: pass back up saved_errno value in manager initMike Frysinger
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-24linuxthreads.old: fix set-but-unused warningMike Frysinger
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-24linuxthreads.old: fix typo in pthread_mutex_unlock hidden prototypeMike Frysinger
Reported-by: Tony Wu <tung7970@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-04-22linuxthreads.old: only declare __pthread_xxx funcs hidden inside of libpthreadMike Frysinger
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-03-26nptl: fix compiler warning due to missing prototypeCarmelo Amoroso
libpthread/nptl/sysdeps/pthread/pt-longjmp.c: In function 'longjmp': libpthread/nptl/sysdeps/pthread/pt-longjmp.c:27:3: warning: implicit declaration of function '__libc_longjmp' [-Wimplicit-function-declaration] libpthread/nptl/sysdeps/pthread/pt-longjmp.c:28:1: warning: 'noreturn' function does return [enabled by default] Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2012-03-26nptl: fix compiler warning due to unused-but-set-variableCarmelo Amoroso
gcc 4.6.x raises useful warnings due to unused-but-set-variable, This patch fixes the following one by using properly preprocessor guard libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c: In function '__pthread_cond_timedwait': libpthread/nptl/sysdeps/pthread/pthread_cond_timedwait.c:103:6: warning: variable 'ret' set but not used [-Wunused-but-set-variable] Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2012-01-29nptl_db: handle SUSv4-OBBernhard Reutner-Fischer
pthread_getconcurrency / pthread_setconcurrency is OBSOLETE in SUSv4 so disable pthread debug support too Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-28buildsys: fixup sigaction handlingBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-27libc_arm: avoid multiple version of __aeabi_unwind_cpp_pr dummy codeCarmelo Amoroso
Do not pollute libraries with its own implementation of __aeabi_unwind_cpp_pr1 code. Just add it to uclibc_nonshared.a archive and share it. This fixes build issue with static linking of application due to multiple symbol definition in libgcc_eh-a and libpthread.a or librt.a Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2012-01-18nptl: .gitignore generated pt-crt{i,n}.SBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-15libc: build abort with unwind-info for backtraceBernhard Reutner-Fischer
If backtrace support is turned on, build raise() and abort() with unwind info (fixup 4c9b7f3c21ff21c199e54bfad2fdf3445fa4573d). Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2012-01-14linuxthreads/signals: do not restore handler for invalid signalMarkos Chandras
Invalid signals have no handlers so when trying to restore the old handler to a bad signal a SIGSEGV occurs. This is because the library tries to store the old handler to an invalid memory area where it things the bad signal lives. URL: https://bugs.busybox.net/show_bug.cgi?id=4640 Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-01-13libc: allow to backtrace out of abort callCarmelo Amoroso
Build raise and abort function with dwarf2 info by using -fasynchronous-unwind-tables to make backtrace() working across a call to abort. A scenario where it could be useful is within a signal handler that wants to dump a backtrace when catching some signal (i.e SIGABRT). Without having abort & raise built with DWARF2 information, it is not possible for the libgcc stack unwinder to walk through the call stack out of the abort/raise function. Impacts in terms of size are really limited Current text data bss dec hex filename 164 0 0 164 a4 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.os 164 0 0 164 a4 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.oS 220 24 4 248 f8 ./libc/stdlib/abort.os With (-fasynchronous-unwind-tables) text data bss dec hex filename 216 0 0 216 d8 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.os 216 0 0 216 d8 ./libpthread/nptl/sysdeps/unix/sysv/linux/raise.oS 280 24 4 308 134 ./libc/stdlib/abort.os Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> Acked-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-24nptl: add missing pt-tempname.cBernhard Reutner-Fischer
fix bd3c1a2495cbcb51b606f8e4892fcd127f91e645 forgotten file. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-18nptl: sem_open: use open64 if LFSBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-11-17misc: hide __gen_tempnameBernhard Reutner-Fischer
fix signed vs. unsigned comparison warnings while at it Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-10-27sparc: fix build for linuxthreads.oldRob Landley
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-27pthreads: fix build when DNS resolver is not enabled.Bernhard Reutner-Fischer
Resolver state is only available if DNS resolver is enabled. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-10-27linuxthreads: fix typo in __UCLIBC_HAS_IPv4__ macroCarmelo Amoroso
IPv4 should has 'V' capital letter. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-06-14buildsys: pt-initfini.s depends on uClibc_config.hBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-06-13nptl/pthread: Correct path for machine specific pt-initfini.cKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-06-13ctor/dtor nptl: Fix init and fini function compilationKhem Raj
We need to define the rules for .S files so it gets the include paths some architectures like mips include headers Some architectures e.g. SH have their own version of pt-initfini.c so look for that first before resorting to generic version of pt-initfini.c Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-06-10nptl/Makefile.in: Fix the build break caused by UCLIBC_CTOR_DTOR enablingKhem Raj
Extra / somehow does not match the target and complains that $(top_builddir)libpthread/nptl/sysdeps/pthread/crti.o has no rules to build Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-05-31NPTL: Fix CTOR_DTORBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-13unwind.h: Move to libc/sysdeps from nptl sysdepsKhem Raj
Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-05-13epoll.c: add cancellation to epoll_[p]wait()Peter S. Mazinger
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-11commentary typo fixBernhard Reutner-Fischer
s/decriptor/descriptor/ Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-11commentary typo fixBernhard Reutner-Fischer
use cancellation (with two 'l') uniformly. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-11lll: avoid shadow warningsBernhard Reutner-Fischer
use __ret uniformly to avoid shadow warnings as seen on x86_64. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-05-11libubacktrace: mv unwind.h to includeBernhard Reutner-Fischer
Fixes compilation if NPTL is off. I hope this doesn't break ARM EABI but cannot check ATM. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-03-09remove trailing ';' from _syscallX()Peter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-08nptl: fix compilation on x86_64William Pitcock
This commit gives us a fully functioning NPTL on x86-64 by using the GOTOFF macro as needed. Signed-off-by: William Pitcock <nenolod@dereferenced.org> Signed-off-by: Khem Raj <raj.khem@gmail.com>
2011-03-05The C6X portAurelien Jacquiot
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-05Allow ABIs where SP points below the stack frame.Bernd Schmidt
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-05Add Makefile support for DSBT ELF.Bernd Schmidt bernds_cb1@t-online.de
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-04nptl: fix use of IS_IN_LIBPTHREAD macroCarmelo Amoroso
IS_IN_LIBPTHREAD should be IS_IN_libpthread instead. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
2011-03-03remove ucontext.h and guard sigstack structure with SUSV4_LEGACY and ↵Peter S. Mazinger
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-03add missing prototypesPeter S. Mazinger
Add some missing prototypes Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-03use common sigthread.hPeter S. Mazinger
NPTL build did not use the correct bits/sigthread.h, use a common version avoiding this. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-03add missing prototypesPeter S. Mazinger
Add some missing prototypes Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-03syntax fixesPeter S. Mazinger
Avoid compile warnings about the use of undefined constants Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-03-03avoid warnings on _STACK_GROWS_* usagePeter S. Mazinger
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net>
2011-02-25nptl:arm: add a wrapper for .cfi_sections pseudo-opsCarmelo Amoroso
ARM disables by default the support for ASM CFI directives. Anyway using an old version of binutils that does not support some new pseudo-op, the build fails as below: AS libpthread/nptl/sysdeps/unix/sysv/linux/close.oS libpthread/nptl/sysdeps/unix/sysv/linux/close.S: Assembler messages: libpthread/nptl/sysdeps/unix/sysv/linux/close.S:9: Error: unknown pseudo-op: `.cfi_sections' The problem is that the .cfi_sections pseudo should be wrapped by a macro that expands to nothing when the CFI is off. Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com> CC: Khem Ray <ray.khem@gmail.com>
2011-02-24linuxthreads.old: fix nommu initial thread stack detectionMike Frysinger
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-09arm: mv nptl specific atomic impl to common placeBernhard Reutner-Fischer
Thanks to Nitin Garg for notincing! Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>