Hello,
While investigating a build failure of the "gamin" package in Buildroot
on the Microblaze architecture
(http://autobuild.buildroot.net/results/887/887df97196d7777efbf18a7bee91aa45…)
regarding PTHREAD_MUTEX_RECURSIVE being undefined, I noticed a
discrepancy between the definition of PTHREAD_MUTEX_RECURSIVE in the
linuxthreads variant of pthread.h and the NPTL variant of pthread.h.
Indeed, libpthread/nptl/sysdeps/pthread/pthread.h contains:
#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
,
PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
#endif
while the corresponding linuxthreads version, in
libpthread/linuxthreads/sysdeps/pthread/pthread.h contains:
#ifdef __USE_UNIX98
,
PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_ADAPTIVE_NP,
PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
#endif
Notice how the NPTL code defines all the non-NP variants if
__USE_XOPEN2K8 is defined, but not the linuxthreads version?
Maybe this difference is normal, I am not familiar enough with all the
standards and conformance issues, but I thought it would be good to
point it out.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
Max ULP for "cos (M_PI_6l * 2.0) == 0.5" in "test-double" sub-test
is set to "0" for ARC. It causes "test-double" test failure.
I realized that this sub-test on ARM gets completely same results.
But it doesn't fails on ARM because max ULP is set to "1" for ARM.
I am wondering, if it was done for any special reason?
Otherwise, set max ULP for "cos (M_PI_6l * 2.0) == 0.5" test to
"1" instead of "0" for ARC.
Signed-off-by: Eugeniy Paltsev <Eugeniy.Paltsev(a)synopsys.com>
---
test/math/libm-test-ulps-arc | 1 +
1 file changed, 1 insertion(+)
diff --git a/test/math/libm-test-ulps-arc b/test/math/libm-test-ulps-arc
index 7139447..46b2ac5 100644
--- a/test/math/libm-test-ulps-arc
+++ b/test/math/libm-test-ulps-arc
@@ -2,6 +2,7 @@
# cos
Test "cos (M_PI_6l * 2.0) == 0.5":
+double: 1
idouble: 1
Test "cos (M_PI_6l * 4.0) == -0.5":
double: 2
--
2.5.5
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 939014ddce98bd07c774815a7f0cf379c8bde38d (commit)
via de633ed60fca535f51a4f6af24c8899321a3d69c (commit)
from 3e40f9669279f005f7154892539166f5081fbcb2 (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 939014ddce98bd07c774815a7f0cf379c8bde38d
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Thu Aug 25 23:32:43 2016 +0200
mips: add NaN support
commit de633ed60fca535f51a4f6af24c8899321a3d69c
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Tue Aug 23 05:47:00 2016 +0200
delete dead code, use -Wdeclaration-after-statement by default
Add -Wdeclaration-after-statement when EXTRA_WARNINGS is enabled.
-----------------------------------------------------------------------
Summary of changes:
Rules.mak | 11 ++++-------
extra/Configs/Config.mips | 15 +++++++++++++++
ldso/ldso/Makefile.in | 3 +++
3 files changed, 22 insertions(+), 7 deletions(-)
diff --git a/Rules.mak b/Rules.mak
index 8d0e66a..cd343f5 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -1,4 +1,4 @@
-# Rules.make for uClibc
+# Rules.mak for uClibc
#
# Copyright (C) 2000-2008 Erik Andersen <andersen(a)uclibc.org>
#
@@ -170,7 +170,6 @@ headers_dep := $(top_builddir)include/bits/sysnum.h \
$(top_builddir)include/bits/uClibc_config.h
sub_headers := $(headers_dep)
-#LIBS :=$(interp) -L$(top_builddir)lib -lc
LIBS := $(interp) -L$(top_builddir)lib $(libc:.$(ABI_VERSION)=)
# Make sure DESTDIR and PREFIX can be used to install
@@ -410,6 +409,8 @@ ifeq ($(TARGET_ARCH),mips)
CPU_CFLAGS-$(CONFIG_MIPS_N64_ABI)+=-mabi=64
CPU_CFLAGS-$(CONFIG_MIPS_O32_ABI)+=-mabi=32
CPU_CFLAGS-$(CONFIG_MIPS_N32_ABI)+=-mabi=n32
+ CPU_CFLAGS-$(CONFIG_MIPS_NAN_LEGACY)+=-mnan=legacy
+ CPU_CFLAGS-$(CONFIG_MIPS_NAN_2008)+=-mnan=2008
CPU_LDFLAGS-y += $(CPU_CFLAGS)
endif
@@ -593,10 +594,9 @@ WARNING_FLAGS += \
-Wnonnull \
-Wold-style-declaration \
-Wold-style-definition \
+ -Wdeclaration-after-statement \
-Wshadow \
-Wundef
-# Works only w/ gcc-3.4 and up, can't be checked for gcc-3.x w/ check_gcc()
-#WARNING_FLAGS-gcc-4 += -Wdeclaration-after-statement
endif
WARNING_FLAGS += $(WARNING_FLAGS-gcc-$(GCC_MAJOR_VER))
$(foreach w,$(WARNING_FLAGS),$(eval $(call check-gcc-var,$(w))))
@@ -638,9 +638,6 @@ $(eval $(call check-ld-var,--sort-common))
$(eval $(call check-ld-var,--discard-all))
LDFLAGS_NOSTRIP:=$(LDFLAG-fuse-ld) $(CPU_LDFLAGS-y) -shared \
-Wl,--warn-common $(CFLAG_-Wl--warn-once) -Wl,-z,combreloc
-# binutils-2.16.1 warns about ignored sections, 2.16.91.0.3 and newer are ok
-#$(eval $(call check-ld-var,--gc-sections))
-#LDFLAGS_NOSTRIP += $(LDFLAG_--gc-sections)
ifeq ($(UCLIBC_BUILD_RELRO),y)
LDFLAGS_NOSTRIP+=-Wl,-z,relro
diff --git a/extra/Configs/Config.mips b/extra/Configs/Config.mips
index 919e80c..8137d8b 100644
--- a/extra/Configs/Config.mips
+++ b/extra/Configs/Config.mips
@@ -32,6 +32,21 @@ config CONFIG_MIPS_N64_ABI
endchoice
+choice
+ prompt "Target NAN Encoding"
+ default CONFIG_MIPS_NAN_LEGACY
+ help
+ This is the NAN Encoding you want to use. Chose either Legacy
+ or 2008.
+
+config CONFIG_MIPS_NAN_LEGACY
+ bool "LEGACY"
+
+config CONFIG_MIPS_NAN_2008
+ bool "2008"
+
+endchoice
+
config UCLIBC_USE_MIPS_PREFETCH
bool "Use MIPS prefetch optimization for memcpy/memset"
default y
diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in
index dde6a53..993aeb9 100644
--- a/ldso/ldso/Makefile.in
+++ b/ldso/ldso/Makefile.in
@@ -82,6 +82,9 @@ $(ldso:.$(ABI_VERSION)=): $($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a
$(call link.so,$(ldso_FULL_NAME),$(ABI_VERSION))
# link for backward compatibility
(cd $(top_builddir)lib; ln -sf $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION) $(UCLIBC_LDSO_NAME).so.0 )
+ifeq ($(CONFIG_MIPS_NAN_2008),y)
+ (cd $(top_builddir)lib; ln -sf $(UCLIBC_LDSO_NAME).so.$(ABI_VERSION) $(UCLIBC_LDSO_NAME)-mipsn8.so.0)
+endif
$($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
$(Q)$(RM) $@
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
Hello,
Today I was investigating a link issue that occurs in Buildroot with
the libarchive package. It turns out that the code of this package
uses pthread_mutex_lock/pthread_mutex_unlock in some places to be
thread-safe, but does *not* link with the libpthread library.
I was originally surprised that this could even work, but I discovered
that the libc intentionally provides a stub implementation of
pthread_mutex_lock/unlock. The idea behind this is that a library can
use pthread_mutex_lock/unlock without linking to libpthread. This way,
if the application using the library is single-threaded and doesn't
link with libpthread, pthread_mutex_lock/unlock are no-ops. On the
other hand, if the application using the library is multi-threaded, it
will link with libpthread, and therefore the libpthread versions of
pthread_mutex_lock/unlock will be used.
This all seems good, until you get to static linking. Indeed with
uClibc-ng, the following program:
#include <pthread.h>
int main(void)
{
pthread_mutex_t lock;
pthread_mutex_lock(&lock);
return 0;
}
will link perfectly fine with dynamic linking:
$ ./host/usr/bin/arm-linux-gcc -o foo foo.c
$ ./host/usr/bin/arm-linux-readelf -d foo | grep NEEDED
0x00000001 (NEEDED) Shared library: [libc.so.0]
but will fail to build with static linking:
$ ./host/usr/bin/arm-linux-gcc -o foo foo.c -static
/tmp/ccda8vkc.o: In function `main':
foo.c:(.text+0x14): undefined reference to `pthread_mutex_lock'
collect2: error: ld returned 1 exit status
And this explains the build failures like
http://autobuild.buildroot.net/results/01b/01b7088a06e7310c8773e78e8be4f6e8…
that we are seeing in Buildroot.
It is worth mentioning that using the musl C library, this test case
works fine in both dynamic linking and static linking cases (and the
libarchive error also does not occur).
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
The syscall ABI includes the gcc functional calling ABI since a syscall
implies userland caller and kernel callee.
The current gcc ABI (v3) for ARCv2 ISA required 64-bit data be passed in
even-odd register pairs, (potentially punching reg holes when passing such
values as args). This was partly driven by the fact that the double-word
LDD/STD instructions in ARCv2 expect the register alignment and thus gcc
forcing this avoids extra MOV at the cost of a few unused register (which we
have plenty anyways).
This however was rejected as part of upstreaming gcc port to HS. So the new
ABI v4 doesn't enforce the even-odd reg restriction.
Do note that for ARCompact ISA builds v3 and v4 are practically the same in
terms of gcc code generation.
This change is dormant for now (gcc 4.8.x based tools) and will only kick
in with switch to gcc 6.x based tools.
Signed-off-by: Vineet Gupta <vgupta(a)synopsys.com>
---
libc/sysdeps/linux/arc/bits/uClibc_arch_features.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h b/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h
index 51607240cd82..94e089d5dfa8 100755
--- a/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h
@@ -41,8 +41,14 @@
/* The default ';' is a comment on ARC. */
#define __UCLIBC_ASM_LINE_SEP__ `
-/* does your target align 64bit values in register pairs ? (32bit arches only) */
-#if defined(__A7__)
+/* does your target align 64bit values in register pairs ? (32bit arches only)
+ * - ARC700 never had any constraint on reg pairs (even if ABI v3)
+ * - Inital HS ABI (v3: non upstream gcc) had 64-bit data aligned in even-odd
+ * reg pairs (thus allowed reg holes when passing such args to calls)
+ * - Upstream gcc (6.x) HS ABI doesn't have that restriction
+ */
+
+#if defined(__A7__) || (__GNUC__ > 4)
#undef __UCLIBC_SYSCALL_ALIGN_64BIT__
#else
#define __UCLIBC_SYSCALL_ALIGN_64BIT__
--
2.7.4
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 3e40f9669279f005f7154892539166f5081fbcb2 (commit)
from 9725c0b6e4fda2db5c5aac0888d64dc97c69a332 (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 3e40f9669279f005f7154892539166f5081fbcb2
Author: Vineet Gupta <Vineet.Gupta1(a)synopsys.com>
Date: Tue Aug 16 15:04:27 2016 -0700
ARC: Support syscall ABI v4
The syscall ABI includes the gcc functional calling ABI since a syscall
implies userland caller and kernel callee.
The current gcc ABI (v3) for ARCv2 ISA required 64-bit data be passed in
even-odd register pairs, (potentially punching reg holes when passing such
values as args). This was partly driven by the fact that the double-word
LDD/STD instructions in ARCv2 expect the register alignment and thus gcc
forcing this avoids extra MOV at the cost of a few unused register (which we
have plenty anyways).
This however was rejected as part of upstreaming gcc port to HS. So the new
ABI v4 doesn't enforce the even-odd reg restriction.
Do note that for ARCompact ISA builds v3 and v4 are practically the same in
terms of gcc code generation.
This change is dormant for now (gcc 4.8.x based tools) and will only kick
in with switch to gcc 6.x based tools.
Signed-off-by: Vineet Gupta <vgupta(a)synopsys.com>
-----------------------------------------------------------------------
Summary of changes:
libc/sysdeps/linux/arc/bits/uClibc_arch_features.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h b/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h
index 5160724..94e089d 100755
--- a/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h
+++ b/libc/sysdeps/linux/arc/bits/uClibc_arch_features.h
@@ -41,8 +41,14 @@
/* The default ';' is a comment on ARC. */
#define __UCLIBC_ASM_LINE_SEP__ `
-/* does your target align 64bit values in register pairs ? (32bit arches only) */
-#if defined(__A7__)
+/* does your target align 64bit values in register pairs ? (32bit arches only)
+ * - ARC700 never had any constraint on reg pairs (even if ABI v3)
+ * - Inital HS ABI (v3: non upstream gcc) had 64-bit data aligned in even-odd
+ * reg pairs (thus allowed reg holes when passing such args to calls)
+ * - Upstream gcc (6.x) HS ABI doesn't have that restriction
+ */
+
+#if defined(__A7__) || (__GNUC__ > 4)
#undef __UCLIBC_SYSCALL_ALIGN_64BIT__
#else
#define __UCLIBC_SYSCALL_ALIGN_64BIT__
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
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 9725c0b6e4fda2db5c5aac0888d64dc97c69a332 (commit)
from c61570ac32f052e050c46838ea5ab60de5836f8e (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 9725c0b6e4fda2db5c5aac0888d64dc97c69a332
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Tue Aug 16 22:08:25 2016 +0200
linuxthreads: install libpthread_nonshared.a
This is useful to build native gcc on targets supporting
Linuxthreads instead of NPTL.
-----------------------------------------------------------------------
Summary of changes:
libpthread/linuxthreads/Makefile.in | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/libpthread/linuxthreads/Makefile.in b/libpthread/linuxthreads/Makefile.in
index 5b7d559..47c45ef 100644
--- a/libpthread/linuxthreads/Makefile.in
+++ b/libpthread/linuxthreads/Makefile.in
@@ -67,10 +67,13 @@ libpthread-so-y += $(libpthread_OBJ:.o=.oS)
lib-a-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.a
lib-so-$(UCLIBC_HAS_THREADS) += $(top_builddir)lib/libpthread.so
-$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend)
+$(top_builddir)lib/libpthread.so: $(libpthread_OUT)/libpthread_so.a $(libc.depend) $(top_builddir)lib/libpthread_nonshared.a
$(call link.so,$(libpthread_FULL_NAME),$(ABI_VERSION))
# link for backward compatibility
$(call link.so,$(libpthread_FULL_NAME),0)
+ $(Q)cat $(top_srcdir)extra/scripts/format.lds > $@.tmp
+ $(Q)echo "GROUP ( $(notdir $(a)).$(ABI_VERSION) libpthread_nonshared.a )" >> $@.tmp
+ $(Q)mv $@.tmp $@
ifeq ($(PTHREADS_DEBUG_SUPPORT),y)
$(libpthread_OUT)/libpthread_so.a: STRIP_FLAGS:=$(STRIP_FLAGS:-x=-X --strip-debug)
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
This test uses OFD locks which are supported only by 64-bit ABI.
Thus OFD locks must be used with flock64 structure for sure in this
test. It is necessary because on some 32-bit targets (e.g. 32-bit
uClibc) flock is not mapped to flock64 when _FILE_OFFSET_BITS is not
set to 64.
Signed-off-by: Yuriy Kolerov <yuriy.kolerov(a)synopsys.com>
---
testcases/kernel/syscalls/fcntl/fcntl34.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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 c61570ac32f052e050c46838ea5ab60de5836f8e (commit)
from bbd7151f7980c7d075fe652331f01d3aadc73e42 (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 c61570ac32f052e050c46838ea5ab60de5836f8e
Author: Eric Le Bihan <eric.le.bihan.dev(a)free.fr>
Date: Tue Aug 9 18:48:47 2016 +0200
librt: fix path parsing in __spawni()
__spawni() loops forever when parsing the path variable due to incorrect
pointer update. This patch fixes the issue.
Signed-off-by: Eric Le Bihan <eric.le.bihan.dev(a)free.fr>
-----------------------------------------------------------------------
Summary of changes:
librt/spawn.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/librt/spawn.c b/librt/spawn.c
index 79f5b06..25e3994 100644
--- a/librt/spawn.c
+++ b/librt/spawn.c
@@ -203,9 +203,10 @@ __spawni(pid_t *pid, const char *file,
*--name = '/';
}
- char *p;
+ char *p = (char *)path;
do {
char *startp;
+ path = p;
p = strchrnul(path, ':');
/* Two adjacent colons, or a colon at the beginning or the end
@@ -233,7 +234,6 @@ __spawni(pid_t *pid, const char *file,
goto error;
}
- path = p;
} while (*p++ != '\0');
error:
hooks/post-receive
--
uClibc-ng - small C library for embedded systems