summaryrefslogtreecommitdiff
path: root/libpthread/nptl/sysdeps/unix
AgeCommit message (Collapse)Author
2016-11-29libpthread: Fix inclusion of unwind code.Ignacy Gawędzki
Since librt and libpthread are now integrated into libc, including unwind-resume and unwind-forcedunwind implementations of unwind code makes no sense. Only unwind-forcedunwind is now included with functions hidden to avoid them overriding the ones from libgcc_s. * libpthread/nptl/sysdeps/generic/unwind-resume.h: New. Define generic PERSONALITY_PROTO and PERSONALITY_ARGS and set HAVE_ARCH_UNWIND_RESUME to 0. * libpthread/nptl/sysdeps/pthread/unwind-resume.c: Move... * libpthread/nptl/sysdeps/generic/unwind-resume.c: ... here. Include generic implementation of _Unwind_Resume on the condition that !HAVE_ARCH_UNWIND_RESUME. Make functions hidden to prevent them from overriding libgcc_s's ones. * libpthread/nptl/sysdeps/pthread/unwind-forcedunwind.c: Likewise. * libpthread/nptl/sysdeps/arm/unwind-resume.h: New. Define ARM-specific PERSONALITY_PROTO and PERSONALITY_ARGS and set HAVE_ARCH_UNWIND_RESUME to 1. * libpthread/nptl/sysdeps/arm/arm-unwind-resume.c, * libpthread/nptl/sysdeps/arm/pt-arm-unwind-resume.c, * libpthread/nptl/sysdeps/arm/rt-arm-unwind-resume.c: New. ARM-specific implementations of _Unwind_Resume resp. for libc, libpthread and librt. * libpthread/nptl/sysdeps/Makefile.commonarch: Remove both arm-unwind-resume and rt-arm-unwind-resume from libpthread_arch_CSRC. * libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-forcedunwind.c, * libpthread/nptl/sysdeps/unix/sysv/linux/arm/unwind-resume.c: Remove. Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
2016-11-27remove UCLIBC_HAS_LFSWaldemar Brodkorb
2016-11-27microblaze: fixup gcc warningsWaldemar Brodkorb
2016-11-27microblaze: sync sysdep-cancel.h/sydep.h with GNU libcWaldemar Brodkorb
2016-11-27sh: remove duplicate codeWaldemar Brodkorb
2016-11-27Revert "sh: fix static linking issue"Waldemar Brodkorb
This reverts commit c13f823941b103cf744929e5afcb3e2bc1342354.
2016-11-04nios2: sync support with glibcWaldemar Brodkorb
Only static linking is supported for now. More debugging and analyzing for ld.so, TLS and NPTL is required. But at least you can bootup a static root fileystem in Qemu.
2016-11-03microblaze: add NPTL/TLS support from GNU libcWaldemar Brodkorb
Not perfect, but a starting point. Some tests of the test suite are failing.
2016-10-13cleanup and fix static linking issuesWaldemar Brodkorb
There was a deadlock hanging in a sycall to futex, which should be solved now. Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-10-13ARC: nptl: cancellable wrappers were broken #2Vineet Gupta
Despite the prev fix, tst-mqueue3 was still segfaulting. The issue was BLINK register not restored properly for return 00002690 <mq_timedsend>: 2690: sub r9,r25,0x448 2698: ld r10,[r9] 269c: cmp r10,0 26a0: beq -36 26a4: st.aw blink,[sp,-4] 26a8: st.aw r0,[sp,-4] 26ac: st.aw r1,[sp,-4] 26b0: st.aw r2,[sp,-4] 26b4: st.aw r3,[sp,-4] 26b8: st.aw r4,[sp,-4] 26bc: bl 1e28 <__librt_enable_asynccancel> 26c0: mov r9,r0 26c4: ld.ab r4,[sp,4] 26c8: ld.ab r3,[sp,4] 26cc: ld.ab r2,[sp,4] 26d0: ld.ab r1,[sp,4] 26d4: ld.ab r0,[sp,4] 26d8: ld.ab blink,[sp, 4] <---- function return BLINK 26dc: mov r8,182 26e0: trap_s 0 26e2: cmp r0,-1024 26e6: st.aw r0,[sp,-4] 26ea: mov r0,r9 26ee: bl 1e90 <__librt_disable_asynccancel> <-- BLINK clobbered to next PC 26f2: ld.ab r0,[sp,4] <----| loops here until sp is out of bound 26fa: cmp r0,-1024 | 26fe: jls [blink] -----| 2702: b 15d8 2706: nop_s So the fix was to retain BLINK on stack before function call, and pop it later - 26d8: ld.ab blink,[sp, 4] + 26d8: ld blink,[sp] <--- restore BLINK, but retain on stack 26dc: mov r8,182 26e0: trap_s 0 26e2: cmp r0,-1024 26e6: st.aw r0,[sp,-4] 26ea: mov r0,r9 26ee: bl 1e90 <__librt_disable_asynccancel> 26f2: ld.ab r0,[sp,4] + 26f6: ld.ab blink,[sp,4] <--- finally pop BLINK 26fa: cmp r0,-1024 26fe: jls [blink] Reported-by: Eugeniy Paltsev <paltsev@synopsys.com> Cc: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2016-10-13ARC: nptl: cancellable wrappers were brokenVineet Gupta
This was reported as uClibc test suite failures of tst-mqueue3 and tst-mqueue5. The syscall args were getting clobbered, so use scratch regs which are not used for syscall args 00002690 <mq_timedsend>: ; SINGLE_THREAD_P 2690: sub r1,r25,0x448 <--- clobers r1, r2 2698: ld r2,[r1] 269c: cmp r2,0 26a0: bz mq_timedsend_nocancel ; DOCARGS (saves syscall args but r1, r2 clobbered already) 26a4: st.aw blink,[sp,-4] 26a8: st.aw r0,[sp,-4] 26ac: st.aw r1,[sp,-4] 26b0: st.aw r2,[sp,-4] 26b4: st.aw r3,[sp,-4] 26b8: st.aw r4,[sp,-4] 26bc: bl 1e28 <__librt_enable_asynccancel> Reported-by: Eugeniy Paltsev <paltsev@synopsys.com> Cc: Alexey Brodkin <abrodkin@synopsys.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2016-10-05cleanup ppc portWaldemar Brodkorb
Remove powerpc64 bits as we only support powerpc32.
2016-09-26use a single libc and deduplicate threading codeWaldemar Brodkorb
Similar to musl libc a single libc has many benefits and solves some open issues with uClibc-ng. - no pthread_mutex_* weak symbols exported anymore - applications no longer failing to link when either -lrt or -lpthread are missing for dynamic and static linking mode - smaller C library - slightly better runtime performance
2016-09-26always assume tgkill is presentWaldemar Brodkorb
We do not support 2.4 Linux kernels anyway, and almost all newer 2.6 kernels should have tgkill syscall. Cleanup the raise situation, pt-raise.c is unused, sync raise.c with latest GNU libc. Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-09-26remove dead code and documentationWaldemar Brodkorb
The code was disabled a while ago in commit: 814b0901f460a246315bfa7933a661f415bdc7fa Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2016-07-10x86_64: use C implementation for pthread_cond_wait/pthread_cond_timedwaitWaldemar Brodkorb
Add test case for the deadlock detection. Reported-By: Martin Willi <martin@strongswan.org>
2016-06-12xtensa: use generic lowlevellockWaldemar Brodkorb
Simplify and use generic lowlevellock. Tested-by: Waldemar Brodkorb <wbx@uclibc-ng.org> Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-06-12metag: use generic lowlevellockWaldemar Brodkorb
Simplify and use generic lowlevellock. Tested-by: Waldemar Brodkorb <wbx@uclibc-ng.org> Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-06-12arc: use generic lowlevellockWaldemar Brodkorb
Simplify and use generic lowlevellock. Tested-by: Waldemar Brodkorb <wbx@uclibc-ng.org> Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-05-31ARM: nptl: Use generic lowlevellock.c, patch from glibcLeonid Lisovskiy
lowlevellock.c for arm differs from the generic lowlevellock.c only in insignificant ways, so can be removed. Follow glibc commit 6d96f5e4c0 Solves __lll_timedlock_wait busy-wait issues described at http://sourceware.org/bugzilla/show_bug.cgi?id=15119 Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2016-04-15replace FSF addresses with URLsNikola Forró
License notices in most of the source files refer to an outdated FSF address. Replace it with URL, like in the rest of the source files.Signed-off-by: Nikola Forró <nforro@redhat.com>
2016-01-10NPTL: Fix __pthread_once old style declarationWaldemar Brodkorb
Trivial fix. Signed-Off-By: Leonid Lisovskiy <lly.dev@gmail.com>
2015-12-05remove __UCLIBC_HAVE_ASM_GLOBAL_DOT_NAME__Waldemar Brodkorb
It's even no longer required for non-ported ppc64 architecture. Sync with GNU C library. This simplify the macros in include/libc-symbols.h.
2015-11-30xtensa: avoid some compiler warningsWaldemar Brodkorb
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com> Signed-off-by: Waldemar Brodkorb <wbx@uclibc-ng.org>
2015-10-22NPTL/ARC: fix __lll_lock_wait_private redefinition for static linksVineet Gupta
Commit 2d9740a65a "uclibc: nptl: fix __lll_lock_wait_private multiple definition" did a sweeping change which did for all in tree arches at that time (ARC wasn't) Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
2015-10-08xtensa: support call0 ABIMax Filippov
Most changes are mechanical replacement of 'retw' instruction with 'abi_ret' macro, defined to 'retw' or 'ret' according to ABI. Assembly code that makes calls is duplicated for call0 ABI with changed register numbers for parameters/return value and call instruction. 'entry' instructions are replaced with 'abi_entry' macro. More interesting changes: - non-leaf assembly functions (e.g. _dl_tlsdesc_dynamic, _dl_linux_resolve, SYSCALL_ERROR_HANDLER, PSEUDO) now need to preserve registers around intermediate calls they make, use temporary stack frame for that; - setjmp/longjmp only need to save and restore return address, stack pointer and callee-saved registers in the jmpbuf; - __clone and syscall functions had hardcoded offsets to parameter passed on stack, on call0 ABI they don't need stack frame, so the offset is different. Replace these offsets with FRAMESIZE macro. Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-08-02sh: fix static linking issueWaldemar Brodkorb
2015-07-22fix static builds of pthread apps for x86/x86_64Waldemar Brodkorb
Found via buildroot autobuilder.
2015-06-23xtensa: fix stack frame size for NPTLMax Filippov
Cancellable syscalls use call8 to call functions that enable/disable cancellation, thus they cannot use the default FRAMESIZE. Redefine FRAMESIZE for such syscalls. This fixes the following testsuite failure: .... tst-mqueue8 FAIL tst-mqueue8 got 1 expected 0 going to cancel mq_receive in-time in-time mq_receive cancellation succeeded going to cancel mq_receive early Didn't expect signal from child: got `Segmentation fault' Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
2015-06-18Fix libgcc_s_resume issue with gcc 5.1Thomas Petazzoni
When built with gcc 5.1, uClibc-ng fails to build with the following issue: librt/librt_so.a(rt-unwind-resume.oS): In function `_Unwind_Resume': rt-unwind-resume.c:(.text+0x3c): undefined reference to This commit fixes the code in a way similar to what was done in glibc in commit: https://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=175cef4163dd60f95106cfd5f593b8a4e09d02c9 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-04-13buildsys: tweak ucontext_i.h prerequisitesBernhard Reutner-Fischer
ucontext_i.h too depends on uClibc_config.h. Update it to look like the other MANGLE generated files and tweak prereqs Fixes: make realclean ; make -j libc/misc/internals/__uClibc_main.i Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-03-29merge uClibc git masterWaldemar Brodkorb
2015-03-26NPTL: SH: silence warningBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2015-01-26merge upstream changesWaldemar Brodkorb
2015-01-23nptl: compile pt-vfork in ARM-modeBernhard Reutner-Fischer
amending commit 49a67cf67d5a7194214566bc730ee7e28d55bbe1 could need a thumb implementation.. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-11-13Merge remote-tracking branch 'origin/upstream'Waldemar Brodkorb
2014-11-13nptl: compile pt-vfork in ARM-modeBernhard Reutner-Fischer
could need a thumb implementation.. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-22xtensa: add support for NPTLWaldemar Brodkorb
Changes from: https://github.com/foss-xtensa/uClibc/commits/xtensa_nptl Author: Chris Zankel <chris@zankel.net> Author: Baruch Siach <baruch@tkos.co.il>
2014-09-20nptl: remove duplicate vfork() in libpthreadWaldemar Brodkorb
Automatic patching via two oneliners by Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>: sed -i -e 's/[[:space:]]pt-vfork\.[csS]//' -e '/^ASFLAGS-pt-vfork\./d' $(git grep -l pt-vfork libpthread/nptl/sysdeps) find libpthread/nptl -name "*pt-vfork*" -exec git rm {} \; Reported-By: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
2014-09-16buildsys: remove now redundant lib placement definesBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-16buildsys: fix IS_IN_lib*Bernhard Reutner-Fischer
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-16nptl: rephrase *.sym handlingBernhard Reutner-Fischer
Avoids circular dependency warning from make by generating the .h directly from the .sym files, elimination intermediate files. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-09-04sparc: remove sparc64/sparcv9 codeWaldemar Brodkorb
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-08-18uclibc: nptl: fix __lll_lock_wait_private multiple definitionTony Wu
Mark non-pthread __lll_lock_wait_private weak to avoid multiple definition error in static link mode. Signed-off-by: Tony Wu <tung7970@gmail.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18ARC/NPTL: Fix __libc_sigaction redefinition with static linksVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-08-18NPTL: ARC supportVineet Gupta
Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-06-12NPTL: Fix undefined reference to PRIVATE_FUTEX with 2.6.18 kernelDan Moulding
When compiling against the 2.6.18 kernel headers, during linking of the NPTL library it runs into a "undefined reference to PRIVATE_FUTEX" error in pthread_cond_timedwait.S. This resolves the problem by ensuring that the definition for PRIVATE_FUTEX is made available to pthread_cond_timedwait.S. Signed-off-by: Dan Moulding <dan.moulding@rackwareinc.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-04-01Fix warnings in MIPS buildSteve Ellcey
This patch fixes the rest of the set-but-not-used warnings in the MIPS code by using attribute_unused and also fixes some conversion warnings by changing __arch_compare_and_exchange_xxx_[8|16]_int. Assigning __cmp (int type) to __prev (pointer type) generates a warning. Assigning zero to each separately avoids this warning without having to add a cast. Signed-off-by: Steve Ellcey <sellcey@mips.com> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-01-15nptl: Fix arm pt-vforkBernhard Reutner-Fischer
We were ending up with an unrecognised CPP token (which is not diagnosed for assembler-with-cpp, 59805) Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2014-01-14buildsys: metag: Remove inappropriate commentBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>