Hi,
I am preparing a release and would like to remove UCLIBC_HAS_LFS
before doing it.
I believe UCLIBC_HAS_LFS does make the code more complex and
the benefit to disable it to save some bytes is not high enough.
Most users have UCLIBC_HAS_LFS enabled and it is enabled by default.
Attached is a patch.
Any comments?
best regards
Waldemar
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 05fca4593c3f54a6750f3cd2dd1eff61a2f5ee93 (commit)
from 79c4017f3518cd30afb59a170717c1e754eedadf (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 05fca4593c3f54a6750f3cd2dd1eff61a2f5ee93
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Sun Nov 27 05:19:36 2016 +0100
mips: fix SIGILL problem with mips ISA r6
-----------------------------------------------------------------------
Summary of changes:
libc/sysdeps/linux/mips/bits/atomic.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/sysdeps/linux/mips/bits/atomic.h b/libc/sysdeps/linux/mips/bits/atomic.h
index e4f9e3b..ed8369a 100644
--- a/libc/sysdeps/linux/mips/bits/atomic.h
+++ b/libc/sysdeps/linux/mips/bits/atomic.h
@@ -37,7 +37,7 @@ typedef uintptr_t uatomicptr_t;
typedef intmax_t atomic_max_t;
typedef uintmax_t uatomic_max_t;
-#if _MIPS_SIM == _ABIO32
+#if _MIPS_SIM == _ABIO32 && __mips < 2
#define MIPS_PUSH_MIPS2 ".set mips2\n\t"
#else
#define MIPS_PUSH_MIPS2
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
Hi,
Frank Liu wrote,
> Hi All,
>
> Kernel version : 4.4.19-linux4sam_5.4
> uclibc version : 1.0.12
> uclibc threading support : NPTL
> Processor Arch: ARM
Better you switch to uClibc-ng mailinglist for this question.
> We create a NONBLOCKING message queue.
>
> The expected behavior is when the message queue is full, calling mq_send would return -1 and set errno to EAGAIN(11). However we are seeing some inconsistent behaviors of mq_send.
>
> When calling mq_send in a single threaded environment, the expected behavior is observed.
>
> If the program starts a second thread, which is doing completely different task, calling mq_send when the queue is full would return -11 instead of -1. Also, the errno is set to an incorrect value. Values we have seen are 0, 2, which are completely different from the expected EAGAIN(11).
Can you provide a simple test case to check the behaviour?
best regards
Waldemar
Hi list and Waldemar,
Yes, I am trying to cross-compile on Mac OS X for Linux embedded (mipselsf) devices, within the Entware-ng environment.
I did search for “BR2_ENABLE_LOCALE”, “BR2_USE_WCHAR”, “BR2_TOOLCHAIN_BUILDROOT_LOCALE”, “BR2_TOOLCHAIN_BUILDROOT_WCHAR”, “BR2_ENABLE_LOCALE" in the Entware-ng folder (like $ grep -lr "BR2_ENABLE_LOCALE” *) without any results.
How can I disable LOCALE support?
> But the locale support in uClibc-ng is really crappy and it assumes
> a Linux host for some tools running on the host.
I do still think that the issue here are that the headers (langinfo.h) can’t be found.
Is that more an issue of “toolchain” or of “uClibc-ng"?
--
Best regards,
Ceriel
Op 21 nov. 2016, om 10:56 heeft Waldemar Brodkorb <wbx(a)uclibc-ng.org> het volgende geschreven:
> Hi Ceriel,
> C. Jacobs wrote,
>
>> Hi Waldemar,
>>
>> First question: Can I sent this message directly, or better via list devel(a)uclibc-ng.org?
>
> Better via list, so the answers are in the archive. And maybe
> someone else can help, too.
>
>> Preface: I am trying to build a new package within the Entware-ng environment and have little ‘C’ knowledge.
>>
>> I am stuck at Entware-ng its make process. That stops at uClibc-1.0.16 gen_locale:
>>> error: use of undeclared identifier ‘ERA_YEAR’
>>
>> I do think that the issue is that:
>> ./build_dir/toolchain-mipsel_mips32r2_gcc-5.3.0_uClibc-1.0.16/uClibc-ng-1.0.16/extra/locale/gen_locale.c
>> can’t find
>> ./build_dir/toolchain-mipsel_mips32r2_gcc-5.3.0_uClibc-1.0.16/uClibc-ng-1.0.16/include/langinfo.h
>>
>> How to best fix this situation?
>
> Disable LOCALE support.
> I think you are cross-compiling from MacOS X. That's normally not a
> problem, I use Mac OS X every dy to cross-compile my Linux embedded
> system stuff.
> But the locale support in uClibc-ng is really crappy and it assumes
> a Linux host for some tools running on the host.
>
> best regards
> Waldemar
There is not possible to use use fork() on noMMU target, so exporting
pthread_atfork() for such target is useless.
A program using pthread_atfork() will likely fail at runtime due to the
error code returned by this function.
Signed-off-by: Romain Naour <romain.naour(a)gmail.com>
---
libpthread/linuxthreads/ptfork.c | 14 --------------
libpthread/linuxthreads/sysdeps/pthread/pthread.h | 2 ++
2 files changed, 2 insertions(+), 14 deletions(-)
diff --git a/libpthread/linuxthreads/ptfork.c b/libpthread/linuxthreads/ptfork.c
index 6f1e2d3..74d6308 100644
--- a/libpthread/linuxthreads/ptfork.c
+++ b/libpthread/linuxthreads/ptfork.c
@@ -150,18 +150,4 @@ static pid_t __fork(void)
strong_alias(__fork,fork)
strong_alias(__fork,vfork)
-#else
-
-/* We can't support pthread_atfork without MMU, since we don't have
- fork(), and we can't offer the correct semantics for vfork(). */
-int pthread_atfork(void (*prepare)(void),
- void (*parent)(void),
- void (*child)(void))
-{
- /* ENOMEM is probably pushing it a little bit.
- Take it as `no *virtual* memory' :-) */
- errno = ENOMEM;
- return -1;
-}
-
#endif
diff --git a/libpthread/linuxthreads/sysdeps/pthread/pthread.h b/libpthread/linuxthreads/sysdeps/pthread/pthread.h
index cc13a52..0d17502 100644
--- a/libpthread/linuxthreads/sysdeps/pthread/pthread.h
+++ b/libpthread/linuxthreads/sysdeps/pthread/pthread.h
@@ -697,6 +697,7 @@ extern int pthread_getcpuclockid (pthread_t __thread_id,
/* Functions for handling process creation and process execution. */
+#ifdef __ARCH_USE_MMU__
/* Install handlers to be called when a new process is created with FORK.
The PREPARE handler is called in the parent process just before performing
FORK. The PARENT handler is called in the parent process just after FORK.
@@ -711,6 +712,7 @@ extern int pthread_getcpuclockid (pthread_t __thread_id,
extern int pthread_atfork (void (*__prepare) (void),
void (*__parent) (void),
void (*__child) (void)) __THROW;
+#endif
/* Terminate all threads in the program except the calling process.
Should be called just before invoking one of the exec*() functions. */
--
2.5.5
If uClibc is built outside of the source tree, then there is an error:
make[1]: *** No rule to make target `/home/akolesov/build-uclibc/extra/locale',
needed by `/home/akolesov/build-uclibc/extra/locale/gen_wc8bit'. Stop.
The rule to create $(top_builddir)/extra/locale is defined in top-level
Makefile.in. Same Makefile.in also invokes extra/locale/Makefile.in to build
various tools. Those tools have $(top_builddir)/extra/locale as a
dependency, but this makefile doesn't include top-level Makefile.in,
therefore rule to create dependant directory is absent in this submake
invocation.
To avoid this problem this patch defines $(top_builddir)/extra/locale as a
dependency for "headers" target, which invokes extra/locale/Makefile.in,
thus making sure that prerequisite directory is created in advance.
This problem doesn't occur when building in the source tree, since
$(top_builddir) == $(top_srcdir), so this directory already exists.
Signed-off-by: Anton Kolesov <Anton.Kolesov(a)synopsys.com>
---
Makefile.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.in b/Makefile.in
index 76008a2..98c6d6d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -183,7 +183,7 @@ menuconfig-clean-y: HEADERCLEAN_config
# libc/sysdeps/linux/Makefile.commonarch to headers-y
headers-y += $(target-headers-sysdep)
-headers: $(top_builddir)include/bits/uClibc_config.h | subdirs
+headers: $(top_builddir)include/bits/uClibc_config.h | subdirs $(top_builddir)extra/locale
$(Q)$(if $(UCLIBC_HAS_LOCALE),$(MAKE) -C extra/locale locale_headers)
subdirs: $(addprefix $(top_builddir),$(subdirs))
--
2.8.1
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "uClibc-ng - small C library for embedded systems".
The branch, master has been updated
via 79c4017f3518cd30afb59a170717c1e754eedadf (commit)
via 2d2aa1bd7074222d9d54232b2d96eae1d2aab7ae (commit)
via 9a9c16557a153cde7a0a98a271d9407cae685943 (commit)
from b985fa069187e4c5a7ee84213d9fbead2f219ce5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 79c4017f3518cd30afb59a170717c1e754eedadf
Author: Romain Naour <romain.naour(a)gmail.com>
Date: Sat Nov 5 19:55:43 2016 +0100
libpthread: remove pthread_atfork for noMMU target
There is not possible to use use fork() on noMMU target, so exporting
pthread_atfork() for such target is useless.
A program using pthread_atfork() will likely fail at runtime due to the
error code returned by this function.
Signed-off-by: Romain Naour <romain.naour(a)gmail.com>
commit 2d2aa1bd7074222d9d54232b2d96eae1d2aab7ae
Author: Anton Kolesov <Anton.Kolesov(a)synopsys.com>
Date: Wed Nov 16 19:33:24 2016 +0300
Fix extra/locale/gen_wc_8bit error with out-of-tree builds
If uClibc is built outside of the source tree, then there is an error:
make[1]: *** No rule to make target `/home/akolesov/build-uclibc/extra/locale',
needed by `/home/akolesov/build-uclibc/extra/locale/gen_wc8bit'. Stop.
The rule to create $(top_builddir)/extra/locale is defined in top-level
Makefile.in. Same Makefile.in also invokes extra/locale/Makefile.in to build
various tools. Those tools have $(top_builddir)/extra/locale as a
dependency, but this makefile doesn't include top-level Makefile.in,
therefore rule to create dependant directory is absent in this submake
invocation.
To avoid this problem this patch defines $(top_builddir)/extra/locale as a
dependency for "headers" target, which invokes extra/locale/Makefile.in,
thus making sure that prerequisite directory is created in advance.
This problem doesn't occur when building in the source tree, since
$(top_builddir) == $(top_srcdir), so this directory already exists.
Signed-off-by: Anton Kolesov <Anton.Kolesov(a)synopsys.com>
commit 9a9c16557a153cde7a0a98a271d9407cae685943
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sun Nov 13 13:47:13 2016 +0100
revert 9b1077dc70e52ee85a718bce3fcfec7ae9af2967 partially
-----------------------------------------------------------------------
Summary of changes:
Makefile.in | 2 +-
libc/Makefile.in | 1 +
libpthread/linuxthreads/ptfork.c | 14 --------------
libpthread/linuxthreads/sysdeps/pthread/pthread.h | 2 ++
4 files changed, 4 insertions(+), 15 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 76008a2..98c6d6d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -183,7 +183,7 @@ menuconfig-clean-y: HEADERCLEAN_config
# libc/sysdeps/linux/Makefile.commonarch to headers-y
headers-y += $(target-headers-sysdep)
-headers: $(top_builddir)include/bits/uClibc_config.h | subdirs
+headers: $(top_builddir)include/bits/uClibc_config.h | subdirs $(top_builddir)extra/locale
$(Q)$(if $(UCLIBC_HAS_LOCALE),$(MAKE) -C extra/locale locale_headers)
subdirs: $(addprefix $(top_builddir),$(subdirs))
diff --git a/libc/Makefile.in b/libc/Makefile.in
index 714a66e..3d6ef13 100644
--- a/libc/Makefile.in
+++ b/libc/Makefile.in
@@ -42,6 +42,7 @@ else
libc-a-y = $(libc-y) $(libc-static-y)
endif
+libc-a-$(HAVE_SHARED) += $(libdl-a-y)
libc-a-$(DO_C99_MATH) += $(libm-a-y)
libc-a-$(UCLIBC_HAS_LIBNSL_STUB) += $(libnsl-a-y)
libc-a-$(UCLIBC_HAS_LIBRESOLV_STUB) += $(libresolv-a-y)
diff --git a/libpthread/linuxthreads/ptfork.c b/libpthread/linuxthreads/ptfork.c
index 6f1e2d3..74d6308 100644
--- a/libpthread/linuxthreads/ptfork.c
+++ b/libpthread/linuxthreads/ptfork.c
@@ -150,18 +150,4 @@ static pid_t __fork(void)
strong_alias(__fork,fork)
strong_alias(__fork,vfork)
-#else
-
-/* We can't support pthread_atfork without MMU, since we don't have
- fork(), and we can't offer the correct semantics for vfork(). */
-int pthread_atfork(void (*prepare)(void),
- void (*parent)(void),
- void (*child)(void))
-{
- /* ENOMEM is probably pushing it a little bit.
- Take it as `no *virtual* memory' :-) */
- errno = ENOMEM;
- return -1;
-}
-
#endif
diff --git a/libpthread/linuxthreads/sysdeps/pthread/pthread.h b/libpthread/linuxthreads/sysdeps/pthread/pthread.h
index cc13a52..0d17502 100644
--- a/libpthread/linuxthreads/sysdeps/pthread/pthread.h
+++ b/libpthread/linuxthreads/sysdeps/pthread/pthread.h
@@ -697,6 +697,7 @@ extern int pthread_getcpuclockid (pthread_t __thread_id,
/* Functions for handling process creation and process execution. */
+#ifdef __ARCH_USE_MMU__
/* Install handlers to be called when a new process is created with FORK.
The PREPARE handler is called in the parent process just before performing
FORK. The PARENT handler is called in the parent process just after FORK.
@@ -711,6 +712,7 @@ extern int pthread_getcpuclockid (pthread_t __thread_id,
extern int pthread_atfork (void (*__prepare) (void),
void (*__parent) (void),
void (*__child) (void)) __THROW;
+#endif
/* Terminate all threads in the program except the calling process.
Should be called just before invoking one of the exec*() functions. */
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
Hi Waldemar,
I see a number of buildroot build issues with the post-unification
uclibc-ng versions (1.0.18 and 1.0.19) related to dl_iterate_phdr
used in static builds.
E.g.:
> xtensa | autossh-1.4e | http://autobuild.buildroot.net/results/96807eda8a4b5a25225a82d7dd2b352b84fc…
> xtensa | berkeleydb-5.3.28 | http://autobuild.buildroot.net/results/886aecbbd664d11383c11c6cd9434a52f9c8…
> xtensa | dvblast-3.0 | http://autobuild.buildroot.net/results/29ad877562d27896e3d68c06b8c1e3970750…
In fact the toolchain cannot produce static executable image
unless extra -lc is given to the linker.
The failure looks like this:
xtensa-buildroot-linux-uclibc-gcc -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -o autossh autossh.o -lnsl
xtensa-buildroot-linux-uclibc/5.4.0/libgcc.a(unwind-dw2-fde-dip.o): In function `__gthread_mutex_lock':
xtensa-buildroot-linux-uclibc/libgcc/./gthr-default.h:748: undefined reference to `dl_iterate_phdr'
and is caused by the reference to dl_iterate_phdr from the DWARF
unwinder in the libgcc.
The linker command line parameters are the following (irrelevant
paths stripped):
-o autossh crt1.o crti.o crtbegin.o autossh.o -lnsl -lgcc -lc -lgcc crtend.o crtn.o
The chain of dependencies is the following:
usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(init.os) is requested by
usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(__uClibc_main.os) (__pthread_initialize_minimal)
usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(unwind.os) is requested by
usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(init.os) (__GI___pthread_unwind)
usr/lib/gcc/xtensa-buildroot-linux-uclibc/5.4.0/libgcc.a(unwind-dw2-xtensa.o) is requested by
usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(unwind.os) (_Unwind_GetCFA)
usr/lib/gcc/xtensa-buildroot-linux-uclibc/5.4.0/libgcc.a(unwind-dw2-fde-dip.o) is requested by
usr/lib/gcc/xtensa-buildroot-linux-uclibc/5.4.0/libgcc.a(unwind-dw2-xtensa.o) (_Unwind_Find_FDE)
the following line only appears if extra -lc is given to the linker
(so that its parameters become
-o autossh crt1.o crti.o crtbegin.o autossh.o -lnsl -lgcc -lc -lgcc crtend.o crtn.o):
usr/xtensa-buildroot-linux-uclibc/sysroot/usr/lib/libc.a(dl-iterate-phdr.os) is requested by
usr/lib/gcc/xtensa-buildroot-linux-uclibc/5.4.0/libgcc.a(unwind-dw2-fde-dip.o) (dl_iterate_phdr)
Prior to uclibc-1.0.18 release it used to work because a
call to __pthread_initialize_minimal was being resolved to
function defined in libpthread/nptl/sysdeps/generic/libc-tls.c
which does not reference pthread_unwind.
Any idea how to fix this?
--
Thanks.
-- Max