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 ad2f07f5bef8a891ddc54c5d9e98d2aca0deffde (commit)
via 5db59b479613593b31945e933790edd1ba831c5a (commit)
via bcc1b625ed008c80ac51c817e6b524c8f18518cf (commit)
via e2c5b08690895002470e30ab5cb26a897acdb2cf (commit)
from 58eeb61bd059255436972c0039bcd4b68ef47247 (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 ad2f07f5bef8a891ddc54c5d9e98d2aca0deffde
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sat Aug 22 20:40:42 2015 +0200
ldso: install backward compatibility symlink by default
Simplify the switch from uClibc to uClibc-ng suggested
by Alexey Brodkin <Alexey.Brodkin(a)synopsys.com>om>.
Gcc always uses .0 ld.so link, so install it by default.
commit 5db59b479613593b31945e933790edd1ba831c5a
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Sat Aug 22 20:41:31 2015 +0200
quieten compile warnings
Sync with glibc, quietens gcc warnings.
commit bcc1b625ed008c80ac51c817e6b524c8f18518cf
Author: Romain Naour <romain.naour(a)openwide.fr>
Date: Sat Aug 22 21:08:36 2015 +0200
add tests for mkostemps()
Signed-off-by: Romain Naour <romain.naour(a)openwide.fr>
commit e2c5b08690895002470e30ab5cb26a897acdb2cf
Author: Junling Zheng <zhengjunling(a)huawei.com>
Date: Mon Jul 20 13:33:57 2015 +0000
nptl_db/db_info: fix the incorrect initial size for dtvp
When debugging a program on ARMv7 with thread-local storage declared using
"__thread", attempting to print a thread-local variable will result in the
following message:
Cannot find thread-local storage for Thread <snip> (LWP <snip>),
executable
file /tmp/tls: capability not available
This can be traced back to uclibc libpthread/nptl_db/td_thr_tls_get_addr.c
which gdb uses to look up the address of the TLS. The function returns
TD_NOCAPAB due to a mismatch in size between the DTV pointer and the size
recorded in the db description. The problem lies in libpthread/nptl_db/db_info.c
which initializes the db with the sizeof the union dtv. Instead it should
be the sizeof a pointer to union dtv.
Fixed the initial size for dtvp to sizeof a pointer, instead of sizeof
the union.
Refer to:
http://sourceware.org/ml/libc-alpha/2006-10/msg00088.html
https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=416b630981788c1f08e7…
Signed-off-by: Junling Zheng <zhengjunling(a)huawei.com>
-----------------------------------------------------------------------
Summary of changes:
ldso/ldso/Makefile.in | 2 +
libpthread/nptl/sysdeps/pthread/bits/libc-lock.h | 2 +-
libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h | 2 +-
libpthread/nptl_db/db_info.c | 2 +-
test/misc/tst-mkostemps.c | 159 +++++++++++++++++++++
5 files changed, 164 insertions(+), 3 deletions(-)
create mode 100644 test/misc/tst-mkostemps.c
diff --git a/ldso/ldso/Makefile.in b/ldso/ldso/Makefile.in
index 424131c..ffbb5cc 100644
--- a/ldso/ldso/Makefile.in
+++ b/ldso/ldso/Makefile.in
@@ -74,6 +74,8 @@ $(ldso): $(ldso:.$(ABI_VERSION)=)
$(ldso:.$(ABI_VERSION)=): | $(top_builddir)lib
$(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 )
$($(UCLIBC_LDSO_NAME)_OUT)/$(UCLIBC_LDSO_NAME)_so.a: $(ldso-y)
$(Q)$(RM) $@
diff --git a/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h
b/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h
index 4df507b..633021a 100644
--- a/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h
+++ b/libpthread/nptl/sysdeps/pthread/bits/libc-lock.h
@@ -171,7 +171,7 @@ typedef pthread_key_t __libc_key_t;
/* Initialize the named lock variable, leaving it in a consistent, unlocked
state. */
#if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
-# define __libc_lock_init(NAME) ((NAME) = LLL_LOCK_INITIALIZER, 0)
+# define __libc_lock_init(NAME) ((void)((NAME) = LLL_LOCK_INITIALIZER))
#else
# define __libc_lock_init(NAME) \
__libc_maybe_call (__pthread_mutex_init, (&(NAME), NULL), 0)
diff --git a/libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h
b/libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h
index 5ad5d95..ae39b87 100644
--- a/libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h
+++ b/libpthread/nptl/sysdeps/pthread/bits/stdio-lock.h
@@ -31,7 +31,7 @@ typedef struct { int lock; int cnt; void *owner; } _IO_lock_t;
#define _IO_lock_initializer { LLL_LOCK_INITIALIZER, 0, NULL }
#define _IO_lock_init(_name) \
- ((_name) = (_IO_lock_t) _IO_lock_initializer , 0)
+ ((void) ((_name) = (_IO_lock_t) _IO_lock_initializer))
#define _IO_lock_fini(_name) \
((void) 0)
diff --git a/libpthread/nptl_db/db_info.c b/libpthread/nptl_db/db_info.c
index a57a053..159a027 100644
--- a/libpthread/nptl_db/db_info.c
+++ b/libpthread/nptl_db/db_info.c
@@ -60,7 +60,7 @@ extern bool __nptl_initial_report_events;
i.e. at the very end of the area covered by TLS_PRE_TCB_SIZE. */
DESC (_thread_db_pthread_dtvp,
TLS_PRE_TCB_SIZE + offsetof (tcbhead_t, dtv)
- - (TLS_TCB_SIZE == 0 ? sizeof (tcbhead_t) : 0), union dtv)
+ - (TLS_TCB_SIZE == 0 ? sizeof (tcbhead_t) : 0), union dtv *)
#endif
diff --git a/test/misc/tst-mkostemps.c b/test/misc/tst-mkostemps.c
new file mode 100644
index 0000000..2f45bfd
--- /dev/null
+++ b/test/misc/tst-mkostemps.c
@@ -0,0 +1,159 @@
+/*
+ * Test application for mkstemp/mkstemps/mkostemp/mkostemps
+ * Copyright (C) 2015 by Romain Naour <romain.naour(a)openwide.fr>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <errno.h>
+
+#define assert(x) \
+ if (!(x)) \
+ { \
+ fputs ("test failed: " #x "\n", stderr); \
+ retval = 1; \
+ goto the_end; \
+ }
+
+int
+main (int argc, char *argv[])
+{
+ char name[256];
+ char name_suffix[256];
+ FILE *fp = NULL;
+ int retval = 0;
+ int fd;
+ int flags = O_RDONLY | O_CLOEXEC;
+ struct stat sb_f1;
+ struct stat sb_f2;
+
+ /* mkstemp test */
+ sprintf(name, "%s-uClibc-test.XXXXXX", __FILE__);
+
+ fd = mkstemp(name);
+
+ fstat(fd, &sb_f1);
+ assert ((sb_f1.st_mode & S_IFMT) == S_IFREG)
+
+ stat(name, &sb_f2);
+ assert ((sb_f2.st_mode & S_IFMT) == S_IFREG)
+
+ assert (sb_f1.st_ino == sb_f2.st_ino)
+
+ close(fd);
+ unlink (name);
+
+ /* mkstemps test */
+ sprintf(name_suffix, "%s-uClibc-test.XXXXXX.txt", __FILE__);
+
+ fd = mkstemps(name_suffix, 4);
+
+ fstat(fd, &sb_f1);
+ assert ((sb_f1.st_mode & S_IFMT) == S_IFREG)
+
+ stat(name_suffix, &sb_f2);
+ assert ((sb_f2.st_mode & S_IFMT) == S_IFREG)
+
+ assert (sb_f1.st_ino == sb_f2.st_ino)
+
+ close(fd);
+ unlink (name_suffix);
+
+ /* mkostemp test */
+ sprintf(name, "%s-uClibc-test.XXXXXX", __FILE__);
+
+ fd = mkostemp(name, flags);
+
+ fstat(fd, &sb_f1);
+ assert ((sb_f1.st_mode & S_IFMT) == S_IFREG)
+
+ stat(name, &sb_f2);
+ assert ((sb_f2.st_mode & S_IFMT) == S_IFREG)
+
+ assert (sb_f1.st_ino == sb_f2.st_ino)
+ assert (sb_f1.st_mode == sb_f2.st_mode)
+
+ close(fd);
+ unlink (name);
+
+ /* mkostemps test */
+ sprintf(name_suffix, "%s-uClibc-test.XXXXXX.txt", __FILE__);
+
+ fd = mkostemps(name_suffix, 4, flags);
+
+ fstat(fd, &sb_f1);
+ assert ((sb_f1.st_mode & S_IFMT) == S_IFREG)
+
+ stat(name, &sb_f2);
+ assert ((sb_f2.st_mode & S_IFMT) == S_IFREG)
+
+ assert (sb_f1.st_ino == sb_f2.st_ino)
+ assert (sb_f1.st_mode == sb_f2.st_mode)
+
+ close(fd);
+ unlink (name_suffix);
+
+ /* suffixlen = 0 */
+ sprintf(name_suffix, "%s-uClibc-test.XXXXXX", __FILE__);
+
+ fd = mkostemps(name_suffix, 0, flags);
+
+ fstat(fd, &sb_f1);
+ assert ((sb_f1.st_mode & S_IFMT) == S_IFREG)
+
+ stat(name, &sb_f2);
+ assert ((sb_f2.st_mode & S_IFMT) == S_IFREG)
+
+ assert (sb_f1.st_ino == sb_f2.st_ino)
+ assert (sb_f1.st_mode == sb_f2.st_mode)
+
+ close(fd);
+ unlink (name_suffix);
+
+ /* stress tests */
+
+ /* template len < 6 */
+ sprintf(name, "XXXXX");
+
+ fd = mkstemp(name);
+
+ assert(fd == -1);
+ assert(errno == EINVAL);
+
+ /* suffixlen < 0 */
+ sprintf(name_suffix, "%s-uClibc-test.XXXXXX.txt", __FILE__);
+
+ fd = mkostemps(name_suffix, -1, flags);
+
+ assert(fd == -1);
+ assert(errno == EINVAL);
+
+ /* Missing one X */
+ sprintf(name_suffix, "%s-uClibc-test.XXXXX.txt", __FILE__);
+
+ fd = mkostemps(name_suffix, 4, flags);
+
+ assert(fd == -1);
+ assert(errno == EINVAL);
+
+ /* wrong suffixlen */
+ sprintf(name_suffix, "%s-uClibc-test.XXXXXX.txt", __FILE__);
+
+ fd = mkostemps(name_suffix, 2, flags);
+
+ assert(fd == -1);
+ assert(errno == EINVAL);
+
+the_end:
+ if (fp != NULL)
+ assert (fclose (fp) == 0);
+ unlink (name);
+ unlink (name_suffix);
+
+ return retval;
+}
hooks/post-receive
--
uClibc-ng - small C library for embedded systems