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 910299c49f55e7954f1c5a4350faf0bd2cc6ae1c (commit)
via e4c5a6c49bbbc735ea867f59bef681a27fc3641e (commit)
via 0316ebff1c2b95454c749432280f2fc89ae40387 (commit)
via 85fd72aa292bfd1cac61fef44d0525ddac6fde56 (commit)
via 6d0e2f736b48c84bb3de4c01d780c365ab409f9b (commit)
via aebd550aa3f06ee3758afc865915bfac89198577 (commit)
via 751791df0fc179afcf4c848cd582e394acff4246 (commit)
via bfb6af2478a475517a2ab674fb1fb171d02e42ad (commit)
via 46f7386f4162dab171295ae60b88daaa6d60f55b (commit)
via 96f513fc237166059eec9d25ba719aa3dda3427e (commit)
from 4aed5269c44032e8ddbeb176d661350542fc05ab (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 910299c49f55e7954f1c5a4350faf0bd2cc6ae1c
Author: Yoshinori Sato <ysato(a)users.sourceforge.jp>
Date: Sat Jan 9 16:27:58 2016 +0900
h8300: O_DIRECT and O_DIRECTORY swapping.
Different define of latest kernel.
kernel define is
#define O_DIRECT 00040000 /* direct disk access hint */
#define O_DIRECTORY 00200000 /* must be a directory */
Yoshinori Sato <ysato(a)users.sourceforge.jp>
commit e4c5a6c49bbbc735ea867f59bef681a27fc3641e
Author: Eugene Rudoy <gene(a)freetz.org>
Date: Sat Jan 9 12:00:43 2016 +0100
ARCH_NATIVE_BIT should in the first place be passed when building utils for host
ARCH_NATIVE_BIT should in the first place be passed when building utils
for host (BUILD_CFLAGS-utils). It could also be passed when building utils
for target (CFLAGS-utils), but this is actually not necessary
as ARCH_NATIVE_BIT and __WORDSIZE are identical in this case.
Fixes 5ec4477584b69fe5f1410649b2eb3a63835fb649 (makes it actually work).
Signed-off-by: Eugene Rudoy <gene(a)freetz.org>
commit 0316ebff1c2b95454c749432280f2fc89ae40387
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Sun Jan 10 09:08:14 2016 +0100
merge libc/stdlib/malloc/realloc.c
commit 85fd72aa292bfd1cac61fef44d0525ddac6fde56
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 6d0e2f736b48c84bb3de4c01d780c365ab409f9b
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 aebd550aa3f06ee3758afc865915bfac89198577
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 751791df0fc179afcf4c848cd582e394acff4246
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 bfb6af2478a475517a2ab674fb1fb171d02e42ad
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 46f7386f4162dab171295ae60b88daaa6d60f55b
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>
commit 96f513fc237166059eec9d25ba719aa3dda3427e
Author: Waldemar Brodkorb <wbx(a)openadk.org>
Date: Sat Jan 9 09:09:51 2016 +0100
merge 55532a6ae663cc0f20bdf62d6c5d06db766b55f3
-----------------------------------------------------------------------
Summary of changes:
Rules.mak | 11 +++-
include/string.h | 38 +++++++++++---
libc/stdlib/malloc/realloc.c | 6 +--
libc/sysdeps/linux/common/bits/types.h | 4 ++
libc/sysdeps/linux/h8300/bits/fcntl.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 +++++++++---
utils/Makefile.in | 2 +-
12 files changed, 138 insertions(+), 33 deletions(-)
create mode 100644 libc/sysdeps/linux/i386/copysign.S
diff --git a/Rules.mak b/Rules.mak
index 39bfbd1..454479e 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -778,8 +778,15 @@ endif
ASFLAGS += $(ASFLAG_--noexecstack)
LIBGCC_CFLAGS ?= $(CFLAGS) $(CPU_CFLAGS-y)
-$(eval $(call cache-output-var,LIBGCC,$(CC) $(LIBGCC_CFLAGS) -print-libgcc-file-name))
-LIBGCC_DIR:=$(dir $(LIBGCC))
+$(eval $(call cache-output-var,LIBGCC_A,$(CC) $(LIBGCC_CFLAGS) -print-libgcc-file-name))
+$(eval $(call cache-output-var,LIBGCC_EH,$(CC) $(LIBGCC_CFLAGS)
-print-file-name=libgcc_eh.a))
+# with -O0 we (e.g. lockf) might end up with references to
+# _Unwind_Resume, so pull in gcc_eh in this case..
+# with a --disable-shared toolchain, libgcc_eh.a and libgcc.a are combined
+# in libgcc.a, so check if the printed file exist, before adding to the commandline
+LIBGCC_EH_FILE := $(shell if [ -f $(LIBGCC_EH) ]; then echo $(LIBGCC_EH); fi)
+LIBGCC_DIR := $(dir $(LIBGCC_A))
+LIBGCC := $(LIBGCC_A) $(if $(DODEBUG),$(LIBGCC_EH_FILE))
# moved from libpthread/linuxthreads
ifeq ($(UCLIBC_CTOR_DTOR),y)
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/stdlib/malloc/realloc.c b/libc/stdlib/malloc/realloc.c
index 4fdbf77..bdfb526 100644
--- a/libc/stdlib/malloc/realloc.c
+++ b/libc/stdlib/malloc/realloc.c
@@ -26,6 +26,9 @@ realloc (void *mem, size_t new_size)
size_t size;
char *base_mem;
+ if (! mem)
+ return malloc (new_size);
+
/* Check for special cases. */
if (! new_size)
{
@@ -33,9 +36,6 @@ realloc (void *mem, size_t new_size)
return NULL;
}
- if (! mem)
- return malloc (new_size);
-
/* This matches the check in malloc() */
if (unlikely(((unsigned long)new_size > (unsigned long)(MALLOC_HEADER_SIZE*-2))))
return NULL;
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/h8300/bits/fcntl.h
b/libc/sysdeps/linux/h8300/bits/fcntl.h
index d180cbd..c167ee2 100644
--- a/libc/sysdeps/linux/h8300/bits/fcntl.h
+++ b/libc/sysdeps/linux/h8300/bits/fcntl.h
@@ -44,8 +44,8 @@
#define O_ASYNC 020000
#ifdef __USE_GNU
-# define O_DIRECTORY 040000 /* Must be a directory. */
-# define O_DIRECT 0200000 /* Direct disk access. */
+# define O_DIRECT 040000 /* Direct disk access. */
+# define O_DIRECTORY 0200000 /* Must be a directory. */
# define O_NOFOLLOW 0400000 /* Do not follow links. */
# define O_NOATIME 01000000 /* Do not set atime. */
# define O_CLOEXEC 02000000 /* Set close_on_exec. */
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 79309e2..068a4c7 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. */
@@ -329,7 +346,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);
diff --git a/utils/Makefile.in b/utils/Makefile.in
index a601721..6349aa7 100644
--- a/utils/Makefile.in
+++ b/utils/Makefile.in
@@ -14,7 +14,6 @@ CFLAGS-utils := \
-I$(top_srcdir)ldso/include \
-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
-DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\" \
- -DARCH_NATIVE_BIT=$(ARCH_NATIVE_BIT) \
-I$(top_srcdir)/$(KERNEL_HEADERS) \
-DNOT_IN_libc \
-B$(top_builddir)lib \
@@ -54,6 +53,7 @@ UTILS_CONFIG_FLAGS-$(LDSO_STANDALONE_SUPPORT) +=
-D__LDSO_STANDALONE_SUPPORT__
BUILD_CFLAGS-utils := \
-DUCLIBC_RUNTIME_PREFIX=\"$(RUNTIME_PREFIX)\" \
-DUCLIBC_LDSO=\"$(UCLIBC_LDSO)\" \
+ -DARCH_NATIVE_BIT=$(ARCH_NATIVE_BIT) \
$(UTILS_CONFIG_FLAGS-y)
BUILD_CFLAGS-ldconfig.host := \
-DBUILDING_LINKAGE \
hooks/post-receive
--
uClibc-ng - small C library for embedded systems