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, 1.0 has been updated
via 121ee94aa6af104ed33a83bc573739a6f2c02f54 (commit)
via 097e5f6b5af44c8cfc365b0b7a9d8e628e647607 (commit)
via 48d8d11d697e7433e607b2519a022bd0ee415c12 (commit)
via ad1fca9b927f469e2fecdfbfa4e3ad130afa66ab (commit)
via 016e7cb223c2a28f0a65980d978124b463f21184 (commit)
via 6c3db949b0627674267f078ffdefc48de1484a74 (commit)
from 55532a6ae663cc0f20bdf62d6c5d06db766b55f3 (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 121ee94aa6af104ed33a83bc573739a6f2c02f54
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Thu Jan 7 23:34:46 2016 +0100
NPTL: fix infinite recursion
fix infinite recursion on application exit triggered by linking
libc before libpthread.
Patch from OpenWrt.
Reported-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
commit 097e5f6b5af44c8cfc365b0b7a9d8e628e647607
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Thu Jan 7 23:36:46 2016 +0100
NPTL: Fix __pthread_once old style declaration
Trivial fix.
Signed-Off-By: Leonid Lisovskiy <lly.dev(a)gmail.com>
commit 48d8d11d697e7433e607b2519a022bd0ee415c12
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Thu Jan 7 23:35:57 2016 +0100
Add implementation for copysignl for i386
Patch from OpenWrt.
Reported-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
commit ad1fca9b927f469e2fecdfbfa4e3ad130afa66ab
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Thu Jan 7 23:33:19 2016 +0100
Implement legacy bcopy/bzero/bcmp/index/rindex as inline functions
patch from OpenWrt.
Reported-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
commit 016e7cb223c2a28f0a65980d978124b463f21184
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Thu Jan 7 23:39:45 2016 +0100
Provide XTI __t_scalar_t types, like glibc
Reported-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
commit 6c3db949b0627674267f078ffdefc48de1484a74
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Thu Jan 7 23:39:02 2016 +0100
test-skeleton: Fixes from glibc
glibc commits
d7a05d0728 test-skeleton: Kill any child process's offspring
cc8dcf96e7 test-skeleton: Support temporary files without memory leaks [BZ#18333]
Reported-by: Leonid Lisovskiy <lly.dev(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
include/string.h | 38 +++++++++++---
libc/sysdeps/linux/common/bits/types.h | 4 ++
libc/sysdeps/linux/i386/Makefile.arch | 3 +-
libc/sysdeps/linux/i386/copysign.S | 55 ++++++++++++++++++++
libpthread/nptl/cleanup_defer_compat.c | 8 +--
libpthread/nptl/init.c | 4 +-
.../sysdeps/unix/sysv/linux/mips/pthread_once.c | 4 +-
test/test-skeleton.c | 32 +++++++++---
8 files changed, 123 insertions(+), 25 deletions(-)
create mode 100644 libc/sysdeps/linux/i386/copysign.S
diff --git a/include/string.h b/include/string.h
index 80585ef..8315203 100644
--- a/include/string.h
+++ b/include/string.h
@@ -362,18 +362,40 @@ extern char *index (const char *__s, int __c)
/* Find the last occurrence of C in S (same as strrchr). */
extern char *rindex (const char *__s, int __c)
__THROW __attribute_pure__ __nonnull ((1));
-# else
-# ifdef __UCLIBC_SUSV3_LEGACY_MACROS__
+# elif defined(__UCLIBC_SUSV3_LEGACY_MACROS__) && !defined(_STRINGS_H)
/* bcopy/bzero/bcmp/index/rindex are marked LEGACY in SuSv3.
* They are replaced as proposed by SuSv3. Don't sync this part
* with glibc and keep it in sync with strings.h. */
-# define bcopy(src,dest,n) (memmove((dest), (src), (n)), (void) 0)
-# define bzero(s,n) (memset((s), '\0', (n)), (void) 0)
-# define bcmp(s1,s2,n) memcmp((s1), (s2), (size_t)(n))
-# define index(s,c) strchr((s), (c))
-# define rindex(s,c) strrchr((s), (c))
-# endif
+/* Copy N bytes of SRC to DEST (like memmove, but args reversed). */
+static __inline__ void bcopy (__const void *__src, void *__dest, size_t __n)
+{
+ memmove(__dest, __src, __n);
+}
+
+/* Set N bytes of S to 0. */
+static __inline__ void bzero (void *__s, size_t __n)
+{
+ memset(__s, 0, __n);
+}
+
+/* Compare N bytes of S1 and S2 (same as memcmp). */
+static __inline__ int bcmp (__const void *__s1, __const void *__s2, size_t __n)
+{
+ return memcmp(__s1, __s2, __n);
+}
+
+/* Find the first occurrence of C in S (same as strchr). */
+static __inline__ char *index (__const char *__s, int __c)
+{
+ return strchr(__s, __c);
+}
+
+/* Find the last occurrence of C in S (same as strrchr). */
+static __inline__ char *rindex (__const char *__s, int __c)
+{
+ return strrchr(__s, __c);
+}
# endif
/* Return the position of the first bit set in I, or 0 if none are set.
diff --git a/libc/sysdeps/linux/common/bits/types.h
b/libc/sysdeps/linux/common/bits/types.h
index 4029167..9d72d45 100644
--- a/libc/sysdeps/linux/common/bits/types.h
+++ b/libc/sysdeps/linux/common/bits/types.h
@@ -188,6 +188,10 @@ typedef __off64_t __loff_t; /* Type of file sizes and offsets (LFS).
*/
typedef __quad_t *__qaddr_t;
typedef char *__caddr_t;
+/* Used in XTI. */
+typedef long int __t_scalar_t;
+typedef unsigned long int __t_uscalar_t;
+
/* Duplicates info from stdint.h but this is used in unistd.h. */
__STD_TYPE __SWORD_TYPE __intptr_t;
diff --git a/libc/sysdeps/linux/i386/Makefile.arch
b/libc/sysdeps/linux/i386/Makefile.arch
index 581e10a..1c72d23 100644
--- a/libc/sysdeps/linux/i386/Makefile.arch
+++ b/libc/sysdeps/linux/i386/Makefile.arch
@@ -9,7 +9,8 @@ CSRC-y := brk.c __syscall_error.c sigaction.c
SSRC-y := \
__longjmp.S setjmp.S bsd-setjmp.S bsd-_setjmp.S \
- sync_file_range.S syscall.S mmap.S
+ sync_file_range.S syscall.S mmap.S \
+ copysign.S
SSRC-$(UCLIBC_HAS_LFS) += mmap64.S
SSRC-$(if $(findstring yy,$(UCLIBC_HAS_ADVANCED_REALTIME)$(UCLIBC_HAS_LFS)),y) +=
posix_fadvise64.S
diff --git a/libc/sysdeps/linux/i386/copysign.S b/libc/sysdeps/linux/i386/copysign.S
new file mode 100644
index 0000000..6499ce0
--- /dev/null
+++ b/libc/sysdeps/linux/i386/copysign.S
@@ -0,0 +1,55 @@
+/*
+ * Written by J.T. Conklin <jtc(a)netbsd.org>rg>.
+ * Public domain.
+ */
+
+#define _ERRNO_H 1
+#include <features.h>
+#include <bits/errno.h>
+
+.text
+.global copysign
+.type copysign,%function
+copysign:
+ movl 16(%esp),%edx
+ movl 8(%esp),%eax
+ andl $0x80000000,%edx
+ andl $0x7fffffff,%eax
+ orl %edx,%eax
+ movl %eax,8(%esp)
+ fldl 4(%esp)
+ ret
+.size copysign,.-copysign
+
+libc_hidden_def(copysign)
+
+.global copysignf
+.type copysignf,%function
+copysignf:
+ movl 8(%esp),%edx
+ movl 4(%esp),%eax
+ andl $0x80000000,%edx
+ andl $0x7fffffff,%eax
+ orl %edx,%eax
+ movl %eax,4(%esp)
+ flds 4(%esp)
+ ret
+.size copysignf,.-copysignf
+
+libc_hidden_def(copysignf)
+
+.global copysignl
+.type copysignl,%function
+copysignl:
+ movl 24(%esp),%edx
+ movl 12(%esp),%eax
+ andl $0x8000,%edx
+ andl $0x7fff,%eax
+ orl %edx,%eax
+ movl %eax,12(%esp)
+ fldt 4(%esp)
+ ret
+.size copysignl,.-copysignl
+
+libc_hidden_def(copysignl)
+
diff --git a/libpthread/nptl/cleanup_defer_compat.c
b/libpthread/nptl/cleanup_defer_compat.c
index 64ecb13..ba15c79 100644
--- a/libpthread/nptl/cleanup_defer_compat.c
+++ b/libpthread/nptl/cleanup_defer_compat.c
@@ -21,7 +21,7 @@
void
attribute_protected
-_pthread_cleanup_push_defer (
+__pthread_cleanup_push_defer (
struct _pthread_cleanup_buffer *buffer,
void (*routine) (void *),
void *arg)
@@ -56,12 +56,12 @@ _pthread_cleanup_push_defer (
THREAD_SETMEM (self, cleanup, buffer);
}
-strong_alias (_pthread_cleanup_push_defer, __pthread_cleanup_push_defer)
+strong_alias (__pthread_cleanup_push_defer, _pthread_cleanup_push_defer)
void
attribute_protected
-_pthread_cleanup_pop_restore (
+__pthread_cleanup_pop_restore (
struct _pthread_cleanup_buffer *buffer,
int execute)
{
@@ -96,4 +96,4 @@ _pthread_cleanup_pop_restore (
if (execute)
buffer->__routine (buffer->__arg);
}
-strong_alias (_pthread_cleanup_pop_restore, __pthread_cleanup_pop_restore)
+strong_alias (__pthread_cleanup_pop_restore, _pthread_cleanup_pop_restore)
diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c
index 776bec7..eb84d6e 100644
--- a/libpthread/nptl/init.c
+++ b/libpthread/nptl/init.c
@@ -104,8 +104,8 @@ static const struct pthread_functions pthread_functions =
.ptr___pthread_key_create = __pthread_key_create_internal,
.ptr___pthread_getspecific = __pthread_getspecific_internal,
.ptr___pthread_setspecific = __pthread_setspecific_internal,
- .ptr__pthread_cleanup_push_defer = _pthread_cleanup_push_defer,
- .ptr__pthread_cleanup_pop_restore = _pthread_cleanup_pop_restore,
+ .ptr__pthread_cleanup_push_defer = __pthread_cleanup_push_defer,
+ .ptr__pthread_cleanup_pop_restore = __pthread_cleanup_pop_restore,
.ptr_nthreads = &__nptl_nthreads,
.ptr___pthread_unwind = &__pthread_unwind,
.ptr__nptl_deallocate_tsd = __nptl_deallocate_tsd,
diff --git a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pthread_once.c
b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pthread_once.c
index 393f0d7..7cf918e 100644
--- a/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pthread_once.c
+++ b/libpthread/nptl/sysdeps/unix/sysv/linux/mips/pthread_once.c
@@ -35,9 +35,7 @@ clear_once_control (void *arg)
int
attribute_protected
-__pthread_once (once_control, init_routine)
- pthread_once_t *once_control;
- void (*init_routine) (void);
+__pthread_once (pthread_once_t *once_control, void (*init_routine) (void))
{
while (1)
{
diff --git a/test/test-skeleton.c b/test/test-skeleton.c
index 03c2ff8..4f26804 100644
--- a/test/test-skeleton.c
+++ b/test/test-skeleton.c
@@ -17,6 +17,7 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#include <assert.h>
#include <errno.h>
#include <getopt.h>
#include <malloc.h>
@@ -53,7 +54,7 @@ static const char *test_dir;
struct temp_name_list
{
struct qelem q;
- const char *name;
+ char *name;
} *temp_name_list;
/* Add temporary files in list. */
@@ -63,14 +64,17 @@ add_temp_file (const char *name)
{
struct temp_name_list *newp
= (struct temp_name_list *) calloc (sizeof (*newp), 1);
- if (newp != NULL)
+ char *newname = strdup (name);
+ if (newp != NULL && newname != NULL)
{
- newp->name = name;
+ newp->name = newname;
if (temp_name_list == NULL)
temp_name_list = (struct temp_name_list *) &newp->q;
else
insque (newp, temp_name_list);
}
+ else
+ free (newp);
}
/* Delete all temporary files. */
@@ -80,11 +84,19 @@ delete_temp_files (void)
while (temp_name_list != NULL)
{
remove (temp_name_list->name);
- temp_name_list = (struct temp_name_list *) temp_name_list->q.q_forw;
+ free (temp_name_list->name);
+
+ struct temp_name_list *next
+ = (struct temp_name_list *) temp_name_list->q.q_forw;
+ free (temp_name_list);
+ temp_name_list = next;
}
}
-/* Create a temporary file. */
+/* Create a temporary file. Return the opened file descriptor on
+ success, or -1 on failure. Write the file name to *FILENAME if
+ FILENAME is not NULL. In this case, the caller is expected to free
+ *FILENAME. */
static int
__attribute__ ((unused))
create_temp_file (const char *base, char **filename)
@@ -112,6 +124,8 @@ create_temp_file (const char *base, char **filename)
add_temp_file (fname);
if (filename != NULL)
*filename = fname;
+ else
+ free (fname);
return _fd;
}
@@ -125,7 +139,10 @@ signal_handler (int sig __attribute__ ((unused)))
int status;
int i;
- /* Send signal. */
+ assert (pid > 1);
+ /* Kill the whole process group. */
+ kill (-pid, SIGKILL);
+ /* In case setpgid failed in the child, kill it individually too. */
kill (pid, SIGKILL);
/* Wait for it to terminate. */
@@ -337,7 +354,8 @@ main (int argc, char *argv[])
/* We put the test process in its own pgrp so that if it bogusly
generates any job control signals, they won't hit the whole build. */
- setpgid (0, 0);
+ if (setpgid (0, 0) != 0)
+ printf ("Failed to set the process group ID: %m\n");
/* Execute the test function and exit with the return value. */
exit (TEST_FUNCTION);
hooks/post-receive
--
uClibc-ng - small C library for embedded systems