Hello,
Sorry for the bother but I’ve been struggling with compiling uclibc-ng. All I did was clone; make defconfig; make.
I get the following error:
CC ldso/ldso/ldso.oS
In file included from ./include/bits/posix1_lim.h:152:0,
from ./include/limits.h:144,
from ./include/sys/param.h:25,
from ./ldso/include/ldso.h:43,
from ldso/ldso/ldso.c:32:
./include/bits/local_lim.h:38:26: fatal error: linux/limits.h: No such file or directory
compilation terminated.
Makerules:370: recipe for target 'ldso/ldso/ldso.oS' failed
make: *** [ldso/ldso/ldso.oS] Error 1
I’ve tried to remove -nostdinc, the compilation then proceeds but with no success. I also tried to install the following packages: kernel-package, linux-libc-dev, binutils, libc-dev-bin, linux-headers-4.10.0-35 and linux-headers-generic.
Can anyone help?
Best regards,
Daniel Dubinsky
Fixes a buildroot build error with ffmpeg
In file included from /home/bernd/buildroot/output/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/signal.h:329:0,
from fftools/ffmpeg.h:26,
from fftools/ffmpeg_opt.c:23:
/home/bernd/buildroot/output/host/aarch64-buildroot-linux-uclibc/sysroot/usr/include/sys/ucontext.h:52:16:
error: field 'uc_mcontext' has incomplete type
mcontext_t uc_mcontext;
^~~~~~~~~~~
using this defconfig:
BR2_aarch64=y
BR2_PACKAGE_FFMPEG=y
sys/ucontext.h for other archs already include bits/sigcontext.h,
on aarch64 this is needed as well.
Signed-off-by: Bernd Kuhls <bernd.kuhls(a)t-online.de>
---
libc/sysdeps/linux/aarch64/sys/ucontext.h | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libc/sysdeps/linux/aarch64/sys/ucontext.h b/libc/sysdeps/linux/aarch64/sys/ucontext.h
index d17458896..dc7303b54 100644
--- a/libc/sysdeps/linux/aarch64/sys/ucontext.h
+++ b/libc/sysdeps/linux/aarch64/sys/ucontext.h
@@ -26,6 +26,10 @@
#include <sys/procfs.h>
+/* We need the signal context definitions even if they are not used
+ included in <signal.h>. */
+#include <bits/sigcontext.h>
+
typedef elf_greg_t greg_t;
/* Container for all general registers. */
--
2.11.0
There are multiple errors in _dl_tlsdesc_dynamic:
- the reference C implementation should return pointer to the
thread-local variable, not offset from the thread pointer, because the
xtensa ABI expects TLSDESC_FN to return pointer to the TLS variable;
- addx8 used for indexing into dtv has its second and third registers in
wrong order, the index must be multiplied by 8, not the base;
- the same addx8 uses wrong base: instead of dtv it adds the offset to
the threadptr;
- the return value in the fast path is calculated as
td->tlsinfo.ti_offset - __builtin_thread_pointer, not what was
intended;
- both fast and slow paths should not subtract __builtin_thread_pointer
from the result.
Signed-off-by: Max Filippov <jcmvbkbc(a)gmail.com>
---
ldso/ldso/xtensa/dl-tlsdesc.S | 21 +++++++++------------
1 file changed, 9 insertions(+), 12 deletions(-)
diff --git a/ldso/ldso/xtensa/dl-tlsdesc.S b/ldso/ldso/xtensa/dl-tlsdesc.S
index 6f417f61a98b..426f2180b3c0 100644
--- a/ldso/ldso/xtensa/dl-tlsdesc.S
+++ b/ldso/ldso/xtensa/dl-tlsdesc.S
@@ -39,7 +39,7 @@ END (_dl_tlsdesc_return)
The assembly code that follows is a rendition of the following
C code, hand-optimized a little bit.
- ptrdiff_t
+ void *
_dl_tlsdesc_dynamic(struct tlsdesc_dynamic_arg *td)
{
dtv_t *dtv = (dtv_t *)THREAD_DTV();
@@ -47,8 +47,8 @@ END (_dl_tlsdesc_return)
&& dtv[td->tlsinfo.ti_module].pointer.val
!= TLS_DTV_UNALLOCATED)
return dtv[td->tlsinfo.ti_module].pointer.val
- + td->tlsinfo.ti_offset - __builtin_thread_pointer();
- return __tls_get_addr (&td->tlsinfo) - __builtin_thread_pointer();
+ + td->tlsinfo.ti_offset;
+ return __tls_get_addr (&td->tlsinfo);
}
*/
@@ -65,33 +65,30 @@ HIDDEN_ENTRY (_dl_tlsdesc_dynamic)
/* && dtv[td->tlsinfo.ti_module].pointer.val != TLS_DTV_UNALLOCATED) */
l32i a6, a2, TLSDESC_MODID
- addx8 a6, a3, a6
+ addx8 a6, a6, a4
l32i a6, a6, 0
beqi a6, -1, .Lslow
/* return dtv[td->tlsinfo.ti_module].pointer.val
- + td->tlsinfo.ti_offset - __builtin_thread_pointer(); */
- l32i a6, a2, TLSDESC_MODOFF
- sub a2, a6, a3
+ + td->tlsinfo.ti_offset; */
+ l32i a5, a2, TLSDESC_MODOFF
+ add a2, a6, a5
abi_ret
- /* return __tls_get_addr (&td->tlsinfo) - __builtin_thread_pointer(); */
+ /* return __tls_get_addr (&td->tlsinfo); */
.Lslow:
#if defined(__XTENSA_WINDOWED_ABI__)
mov a6, a2
movi a4, __tls_get_addr
callx4 a4
- sub a2, a6, a3
+ mov a2, a6
retw
#elif defined(__XTENSA_CALL0_ABI__)
addi a1, a1, -16
s32i a0, a1, 0
- s32i a3, a1, 4
movi a0, __tls_get_addr
callx0 a0
- l32i a3, a1, 4
l32i a0, a1, 0
- sub a2, a2, a3
addi a1, a1, 16
ret
#else
--
2.1.4
Hello,
This is a followup to the ("f764bcffe" or1k: syscall: Pass arguments on the
stack) patch which fixes the issue where the definition of syscall() in unistd.h
and the common implementation in uclibc-ng don't match.
This series allows the implementation to match the definition and then goes on
to remove generic implementations used by or1k, nds32 and arc.
-Stafford
Stafford Horne (4):
syscall: Make common implementation match unistd.h
or1k: Use new common syscall() implementation
nds32: Use new common syscall() implementation
arc: Use new common syscall() implementation
libc/sysdeps/linux/arc/Makefile.arch | 2 +-
libc/sysdeps/linux/arc/syscall.c | 17 -----------------
libc/sysdeps/linux/common/syscall.c | 18 +++++++++++++++++-
libc/sysdeps/linux/nds32/Makefile.arch | 4 ++--
libc/sysdeps/linux/nds32/syscall.c | 28 ----------------------------
libc/sysdeps/linux/or1k/Makefile.arch | 2 +-
libc/sysdeps/linux/or1k/syscall.c | 32 --------------------------------
7 files changed, 21 insertions(+), 82 deletions(-)
delete mode 100644 libc/sysdeps/linux/arc/syscall.c
delete mode 100644 libc/sysdeps/linux/nds32/syscall.c
delete mode 100644 libc/sysdeps/linux/or1k/syscall.c
--
2.13.6
In libc/sysdeps/linux/common/bits/uClibc_pthread.h:
extern void weak_function _pthread_cleanup_push_defer(...)
This *weak_function* declaration will cause nptl/cleanup_defer_compat.c:
strong_alias (...) !!!FAIL!!!, because it include pthreadP.h->pthread.h
->uClibc_pthread.h
That means:
Readelf -s libpthread/nptl/cleanup_defer_compat.o you will get:
18: 00000000 198 FUNC WEAK DEFAULT 1 _pthread_cleanup_push_def
Readelf -s libc/misc/internals/__uClibc_main.o you will also get:
32: 00000038 58 FUNC WEAK DEFAULT 1 _pthread_cleanup_push_def
Final: gcc malloc_pthread_test.c -lpthread
The libc/stdlib/malloc-standard/malloc.c:839 (__MALLOC_LOCK->
_pthread_cleanup_push_def) will use the one in __uClibc_main.o
!!!not in cleanup_defer_compat.o!!!, becasue two cleanup_defer_compat in
libc.a with the same weak declarations and the __uClibc_main.o is close
to front.
====
All of malloc/free will failed in muti-threads' race conditions
probabilistic.
As it happens, uClibc-0.9.33.2 is OK, Becasue:
It's seperated in libpthread.a and libc.a, and the libc.a is the
last lib for ld internal-cmd, and malloc will get right cleanup_defer_compat
from libpthread.a.
This BUG is from 2016-09-24 to now:
>>>
commit 29ff9055c80efe77a7130767a9fcb3ab8c67e8ce
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sat Sep 24 02:55:31 2016 +0200
use a single libc and deduplicate threading code
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
<<<
Perharps we need carefully check all of the impact about that commit.
Signed-off-by: Guo Ren <ren_guo(a)c-sky.com>
---
libpthread/nptl/sysdeps/pthread/pthread.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libpthread/nptl/sysdeps/pthread/pthread.h b/libpthread/nptl/sysdeps/pthread/pthread.h
index b2897b3..1fba7fc 100644
--- a/libpthread/nptl/sysdeps/pthread/pthread.h
+++ b/libpthread/nptl/sysdeps/pthread/pthread.h
@@ -29,7 +29,7 @@
#include <bits/pthreadtypes.h>
#include <bits/setjmp.h>
#include <bits/wordsize.h>
-#if defined _LIBC && ( defined IS_IN_libc || defined NOT_IN_libc )
+#if defined _LIBC && ( defined IS_IN_libc || !defined NOT_IN_libc )
#include <bits/uClibc_pthread.h>
#endif
--
2.7.4