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 ea86f1d8885335f2bd38a388d2ab762bd1e29427 (commit)
via 24e4dc6660057aa13c8d021f0dacf4f58bdf5245 (commit)
from eaf262586b97256ccc9ce02e3673d5f5114aae74 (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 ea86f1d8885335f2bd38a388d2ab762bd1e29427
Author: Bartosz Golaszewski <bartekgola(a)gmail.com>
Date: Wed Oct 14 17:14:01 2015 +0200
syncfs: add system call support
Add support for the syncfs() system call.
Signed-off-by: Bartosz Golaszewski <bartekgola(a)gmail.com>
commit 24e4dc6660057aa13c8d021f0dacf4f58bdf5245
Author: Bartosz Golaszewski <bartekgola(a)gmail.com>
Date: Wed Oct 14 17:14:00 2015 +0200
fanotify: add system call support
Add support for fanotify_init() and fanotify_mark() syscalls. The header
file is taken from glibc.
Signed-off-by: Bartosz Golaszewski <bartekgola(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
include/unistd.h | 2 +-
libc/sysdeps/linux/common/Makefile.in | 1 +
libc/sysdeps/linux/common/fanotify.c | 32 ++++++++++++++++++++
libc/sysdeps/linux/common/{getppid.c => syncfs.c} | 10 +++---
.../{x86_64/sys/perm.h => common/sys/fanotify.h} | 25 ++++++++-------
5 files changed, 52 insertions(+), 18 deletions(-)
create mode 100644 libc/sysdeps/linux/common/fanotify.c
copy libc/sysdeps/linux/common/{getppid.c => syncfs.c} (52%)
copy libc/sysdeps/linux/{x86_64/sys/perm.h => common/sys/fanotify.h} (59%)
diff --git a/include/unistd.h b/include/unistd.h
index 3793d2d..4701dab 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -1073,7 +1073,7 @@ extern char *getpass (const char *__prompt) __nonnull ((1));
extern int fsync (int __fd);
#endif /* Use BSD || X/Open || Unix98. */
-#if 0 /*def __USE_GNU */
+#if __USE_GNU
/* Make all changes done to all files on the file system associated
* with FD actually appear on disk. */
extern int syncfs (int __fd) __THROW;
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
index 8252598..b75b712 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -27,6 +27,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
eventfd.c \
eventfd_read.c \
eventfd_write.c \
+ fanotify.c \
getrandom.c \
inotify.c \
ioperm.c \
diff --git a/libc/sysdeps/linux/common/fanotify.c b/libc/sysdeps/linux/common/fanotify.c
new file mode 100644
index 0000000..431e0e5
--- /dev/null
+++ b/libc/sysdeps/linux/common/fanotify.c
@@ -0,0 +1,32 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fanotify interface for uClibc
+ *
+ * Copyright (C) 2015 by Bartosz Golaszewski <bartekgola(a)gmail.com>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/fanotify.h>
+
+#ifdef __NR_fanotify_init
+_syscall2(int, fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
+#endif
+
+#ifdef __NR_fanotify_mark
+# include <bits/wordsize.h>
+# include <fcntl.h>
+
+# if __WORDSIZE == 64
+_syscall5(int, fanotify_mark, int, fanotify_fd, unsigned int, flags,
+ uint64_t, mask, int, dirfd, const char *, pathname)
+# else
+int fanotify_mark(int fanotify_fd, unsigned int flags,
+ uint64_t mask, int dirfd, const char *pathname)
+{
+ return INLINE_SYSCALL(fanotify_mark, 6, fanotify_fd, flags,
+ OFF64_HI_LO(mask), dirfd, pathname);
+}
+# endif
+#endif
diff --git a/libc/sysdeps/linux/common/getppid.c b/libc/sysdeps/linux/common/syncfs.c
similarity index 52%
copy from libc/sysdeps/linux/common/getppid.c
copy to libc/sysdeps/linux/common/syncfs.c
index 9d85661..831f765 100644
--- a/libc/sysdeps/linux/common/getppid.c
+++ b/libc/sysdeps/linux/common/syncfs.c
@@ -1,15 +1,13 @@
/* vi: set sw=4 ts=4: */
/*
- * getppid() for uClibc
- *
- * Copyright (C) 2000-2006 by Erik Andersen <andersen(a)codepoet.org>
+ * Copyright (C) 2015 Bartosz Golaszewski <bartekgola(a)gmail.com>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <sys/syscall.h>
-#include <unistd.h>
-#ifdef __NR_getppid
-_syscall_noerr0(pid_t, getppid)
+#if defined(__NR_syncfs) && __USE_GNU
+#include <unistd.h>
+_syscall1(int, syncfs, int, fd)
#endif
diff --git a/libc/sysdeps/linux/x86_64/sys/perm.h b/libc/sysdeps/linux/common/sys/fanotify.h
similarity index 59%
copy from libc/sysdeps/linux/x86_64/sys/perm.h
copy to libc/sysdeps/linux/common/sys/fanotify.h
index cbfeaf8..5eec3e5 100644
--- a/libc/sysdeps/linux/x86_64/sys/perm.h
+++ b/libc/sysdeps/linux/common/sys/fanotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -15,21 +15,24 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SYS_PERM_H
+#ifndef _SYS_FANOTIFY_H
+#define _SYS_FANOTIFY_H 1
-#define _SYS_PERM_H 1
-#include <features.h>
+#include <stdint.h>
+#include <linux/fanotify.h>
-__BEGIN_DECLS
-/* Set port input/output permissions. */
-extern int ioperm (unsigned long int __from, unsigned long int __num,
- int __turn_on) __THROW;
+__BEGIN_DECLS
+/* Create and initialize fanotify group. */
+extern int fanotify_init (unsigned int __flags, unsigned int __event_f_flags)
+ __THROW;
-/* Change I/O privilege level. */
-extern int iopl (int __level) __THROW;
+/* Add, remove, or modify an fanotify mark on a filesystem object. */
+extern int fanotify_mark (int __fanotify_fd, unsigned int __flags,
+ uint64_t __mask, int __dfd, const char *__pathname)
+ __THROW;
__END_DECLS
-#endif /* _SYS_PERM_H */
+#endif /* sys/fanotify.h */
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 dfa593d4d881116723a4401b466ea964fb12327b (commit)
via b8cfcb3f9b565100c24b0f8de1e31a45dc4370a5 (commit)
from a3312d2264a8f84c854bf9cd0fb05634baba5e87 (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 dfa593d4d881116723a4401b466ea964fb12327b
Author: Bartosz Golaszewski <bartekgola(a)gmail.com>
Date: Wed Oct 14 17:14:01 2015 +0200
syncfs: add system call support
Add support for the syncfs() system call.
Signed-off-by: Bartosz Golaszewski <bartekgola(a)gmail.com>
commit b8cfcb3f9b565100c24b0f8de1e31a45dc4370a5
Author: Bartosz Golaszewski <bartekgola(a)gmail.com>
Date: Wed Oct 14 17:14:00 2015 +0200
fanotify: add system call support
Add support for fanotify_init() and fanotify_mark() syscalls. The header
file is taken from glibc.
Signed-off-by: Bartosz Golaszewski <bartekgola(a)gmail.com>
-----------------------------------------------------------------------
Summary of changes:
include/unistd.h | 2 +-
libc/sysdeps/linux/common/Makefile.in | 1 +
libc/sysdeps/linux/common/fanotify.c | 32 ++++++++++++++++++++
libc/sysdeps/linux/common/{getppid.c => syncfs.c} | 10 +++---
.../{x86_64/sys/perm.h => common/sys/fanotify.h} | 25 ++++++++-------
5 files changed, 52 insertions(+), 18 deletions(-)
create mode 100644 libc/sysdeps/linux/common/fanotify.c
copy libc/sysdeps/linux/common/{getppid.c => syncfs.c} (52%)
copy libc/sysdeps/linux/{x86_64/sys/perm.h => common/sys/fanotify.h} (59%)
diff --git a/include/unistd.h b/include/unistd.h
index 3793d2d..4701dab 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -1073,7 +1073,7 @@ extern char *getpass (const char *__prompt) __nonnull ((1));
extern int fsync (int __fd);
#endif /* Use BSD || X/Open || Unix98. */
-#if 0 /*def __USE_GNU */
+#if __USE_GNU
/* Make all changes done to all files on the file system associated
* with FD actually appear on disk. */
extern int syncfs (int __fd) __THROW;
diff --git a/libc/sysdeps/linux/common/Makefile.in b/libc/sysdeps/linux/common/Makefile.in
index 8252598..b75b712 100644
--- a/libc/sysdeps/linux/common/Makefile.in
+++ b/libc/sysdeps/linux/common/Makefile.in
@@ -27,6 +27,7 @@ CSRC-$(UCLIBC_LINUX_SPECIFIC) += \
eventfd.c \
eventfd_read.c \
eventfd_write.c \
+ fanotify.c \
getrandom.c \
inotify.c \
ioperm.c \
diff --git a/libc/sysdeps/linux/common/fanotify.c b/libc/sysdeps/linux/common/fanotify.c
new file mode 100644
index 0000000..431e0e5
--- /dev/null
+++ b/libc/sysdeps/linux/common/fanotify.c
@@ -0,0 +1,32 @@
+/* vi: set sw=4 ts=4: */
+/*
+ * fanotify interface for uClibc
+ *
+ * Copyright (C) 2015 by Bartosz Golaszewski <bartekgola(a)gmail.com>
+ *
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
+ */
+
+#include <sys/syscall.h>
+#include <sys/fanotify.h>
+
+#ifdef __NR_fanotify_init
+_syscall2(int, fanotify_init, unsigned int, flags, unsigned int, event_f_flags)
+#endif
+
+#ifdef __NR_fanotify_mark
+# include <bits/wordsize.h>
+# include <fcntl.h>
+
+# if __WORDSIZE == 64
+_syscall5(int, fanotify_mark, int, fanotify_fd, unsigned int, flags,
+ uint64_t, mask, int, dirfd, const char *, pathname)
+# else
+int fanotify_mark(int fanotify_fd, unsigned int flags,
+ uint64_t mask, int dirfd, const char *pathname)
+{
+ return INLINE_SYSCALL(fanotify_mark, 6, fanotify_fd, flags,
+ OFF64_HI_LO(mask), dirfd, pathname);
+}
+# endif
+#endif
diff --git a/libc/sysdeps/linux/common/getppid.c b/libc/sysdeps/linux/common/syncfs.c
similarity index 52%
copy from libc/sysdeps/linux/common/getppid.c
copy to libc/sysdeps/linux/common/syncfs.c
index 9d85661..831f765 100644
--- a/libc/sysdeps/linux/common/getppid.c
+++ b/libc/sysdeps/linux/common/syncfs.c
@@ -1,15 +1,13 @@
/* vi: set sw=4 ts=4: */
/*
- * getppid() for uClibc
- *
- * Copyright (C) 2000-2006 by Erik Andersen <andersen(a)codepoet.org>
+ * Copyright (C) 2015 Bartosz Golaszewski <bartekgola(a)gmail.com>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include <sys/syscall.h>
-#include <unistd.h>
-#ifdef __NR_getppid
-_syscall_noerr0(pid_t, getppid)
+#if defined(__NR_syncfs) && __USE_GNU
+#include <unistd.h>
+_syscall1(int, syncfs, int, fd)
#endif
diff --git a/libc/sysdeps/linux/x86_64/sys/perm.h b/libc/sysdeps/linux/common/sys/fanotify.h
similarity index 59%
copy from libc/sysdeps/linux/x86_64/sys/perm.h
copy to libc/sysdeps/linux/common/sys/fanotify.h
index cbfeaf8..5eec3e5 100644
--- a/libc/sysdeps/linux/x86_64/sys/perm.h
+++ b/libc/sysdeps/linux/common/sys/fanotify.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1999, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2010-2015 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -15,21 +15,24 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-#ifndef _SYS_PERM_H
+#ifndef _SYS_FANOTIFY_H
+#define _SYS_FANOTIFY_H 1
-#define _SYS_PERM_H 1
-#include <features.h>
+#include <stdint.h>
+#include <linux/fanotify.h>
-__BEGIN_DECLS
-/* Set port input/output permissions. */
-extern int ioperm (unsigned long int __from, unsigned long int __num,
- int __turn_on) __THROW;
+__BEGIN_DECLS
+/* Create and initialize fanotify group. */
+extern int fanotify_init (unsigned int __flags, unsigned int __event_f_flags)
+ __THROW;
-/* Change I/O privilege level. */
-extern int iopl (int __level) __THROW;
+/* Add, remove, or modify an fanotify mark on a filesystem object. */
+extern int fanotify_mark (int __fanotify_fd, unsigned int __flags,
+ uint64_t __mask, int __dfd, const char *__pathname)
+ __THROW;
__END_DECLS
-#endif /* _SYS_PERM_H */
+#endif /* sys/fanotify.h */
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, 1.0 has been updated
via eaf262586b97256ccc9ce02e3673d5f5114aae74 (commit)
from 62cab7dd7389db71bf9d0e2b7e84d5abf966b58a (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 eaf262586b97256ccc9ce02e3673d5f5114aae74
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Tue Oct 13 08:34:26 2015 +0200
or1k: add missing file
-----------------------------------------------------------------------
Summary of changes:
.../{linuxthreads => linuxthreads.old}/sysdeps/or1k/pt-machine.h | 0
1 file changed, 0 insertions(+), 0 deletions(-)
copy libpthread/{linuxthreads => linuxthreads.old}/sysdeps/or1k/pt-machine.h (100%)
diff --git a/libpthread/linuxthreads/sysdeps/or1k/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/or1k/pt-machine.h
similarity index 100%
copy from libpthread/linuxthreads/sysdeps/or1k/pt-machine.h
copy to libpthread/linuxthreads.old/sysdeps/or1k/pt-machine.h
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 annotated tag, v1.0.7 has been created
at 46890074b81071dbf49d482c9c6daf8983445ded (tag)
tagging 62cab7dd7389db71bf9d0e2b7e84d5abf966b58a (commit)
replaces v1.0.6
tagged by Waldemar Brodkorb
on Mon Oct 12 21:41:14 2015 +0200
- Log -----------------------------------------------------------------
release 1.0.7 - Leffe Blonde
Junling Zheng (1):
nptl_db/db_info: fix the incorrect initial size for dtvp
Max Filippov (2):
NPTL: fix CFLAGS for cancellation points
xtensa: support call0 ABI
Waldemar Brodkorb (6):
tst-mkostemps: fix test case on read-only root filesystem
Revert "tgmath.h: disable builtins"
add new architecture support for or1k
fix static binaries linked with pthread and compiled with ssp
restrict linuxthreads/nptl choice
bump version
Yuriy Kolerov (3):
libc: fix setting return value and errno in fallocate()
libc: fix sign extension in fallocate()
libc: posix_fallocate must return an error number on failure
-----------------------------------------------------------------------
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, 1.0 has been updated
via 62cab7dd7389db71bf9d0e2b7e84d5abf966b58a (commit)
from b8efd7f6963e2f527d22c840f42cead6dc08d136 (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 62cab7dd7389db71bf9d0e2b7e84d5abf966b58a
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Mon Oct 12 21:38:08 2015 +0200
bump version
-----------------------------------------------------------------------
Summary of changes:
Rules.mak | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Rules.mak b/Rules.mak
index 2cef9d9..4ba6fc5 100644
--- a/Rules.mak
+++ b/Rules.mak
@@ -126,7 +126,7 @@ export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_HEADERS MULTILIB_DIR
# Now config hard core
MAJOR_VERSION := 1
MINOR_VERSION := 0
-SUBLEVEL := 6
+SUBLEVEL := 7
EXTRAVERSION :=
VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL)
ABI_VERSION := $(MAJOR_VERSION)
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, 1.0 has been updated
via b8efd7f6963e2f527d22c840f42cead6dc08d136 (commit)
from 13a6cfff31774dd06b861f1f4a9b0e36fa5ac01d (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 b8efd7f6963e2f527d22c840f42cead6dc08d136
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Mon Oct 12 16:36:26 2015 +0200
restrict linuxthreads/nptl choice
For architectures supporting no MMU systems, allow to use
Linuxthreads. BFLAT does not support TLS right now, so NPTL
can not be used.
-----------------------------------------------------------------------
Summary of changes:
extra/Configs/Config.in | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index a9c01f1..ab6d01b 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -533,6 +533,7 @@ config LINUXTHREADS_OLD
# linuxthreads and linuxthreads.old need nanosleep()
select UCLIBC_HAS_REALTIME
depends on !TARGET_arc && \
+ !TARGET_arm && \
!TARGET_i386 && \
!TARGET_metag && \
!TARGET_mips && \
@@ -540,7 +541,8 @@ config LINUXTHREADS_OLD
!TARGET_sh && \
!TARGET_sparc && \
!TARGET_x86_64 && \
- !TARGET_xtensa
+ !TARGET_xtensa || \
+ !ARCH_USE_MMU
help
There are two versions of linuxthreads. The older (stable) version
has been in uClibc for quite a long time but hasn't seen too many
@@ -559,7 +561,8 @@ config LINUXTHREADS_NEW
!TARGET_sh && \
!TARGET_sparc && \
!TARGET_x86_64 && \
- !TARGET_xtensa
+ !TARGET_xtensa || \
+ !ARCH_USE_MMU
help
The new version has not been tested much, and lacks ports for arches
which glibc does not support (like bfin/frv/etc...), but is based on
@@ -585,7 +588,8 @@ config UCLIBC_HAS_THREADS_NATIVE
!TARGET_microblaze && \
!TARGET_nios2 && \
!TARGET_or1k && \
- !TARGET_vax
+ !TARGET_vax && \
+ ARCH_USE_MMU
help
If you want to compile uClibc with NPTL support, then answer Y.
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, 1.0 has been updated
via 13a6cfff31774dd06b861f1f4a9b0e36fa5ac01d (commit)
from 4d8e5484afb4978f672a8568ddd12e628fb02724 (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 13a6cfff31774dd06b861f1f4a9b0e36fa5ac01d
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Mon Oct 12 16:21:54 2015 +0200
fix static binaries linked with pthread and compiled with ssp
Move TLS initialization for static builds up to the calling
function as suggested by Daniel Fahlgren.
Reported-By: Daniel Fahlgren <daniel(a)fahlgren.se>
-----------------------------------------------------------------------
Summary of changes:
libc/misc/internals/__uClibc_main.c | 12 ++++++++++++
libpthread/nptl/init.c | 18 ------------------
2 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 1f1e601..632a252 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -32,6 +32,7 @@
#include <pthread-functions.h>
#include <not-cancel.h>
#include <atomic.h>
+#include <tls.h>
#endif
#ifdef __UCLIBC_HAS_THREADS__
#include <pthread.h>
@@ -132,6 +133,10 @@ extern void __pthread_initialize_minimal(void);
#endif
#endif
+#ifndef SHARED
+extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
+#endif
+
/* If __UCLIBC_FORMAT_SHARED_FLAT__, all array initialisation and finalisation
* is handled by the routines passed to __uClibc_main(). */
#if defined (__UCLIBC_CTOR_DTOR__) && !defined (__UCLIBC_FORMAT_SHARED_FLAT__)
@@ -243,6 +248,13 @@ void __uClibc_init(void)
__pagesize = PAGE_SIZE;
#ifdef __UCLIBC_HAS_THREADS__
+
+#if defined (__UCLIBC_HAS_THREADS_NATIVE__) && !defined (SHARED)
+ /* Unlike in the dynamically linked case the dynamic linker has not
+ taken care of initializing the TLS data structures. */
+ __libc_setup_tls (TLS_TCB_SIZE, TLS_TCB_ALIGN);
+#endif
+
/* Before we start initializing uClibc we have to call
* __pthread_initialize_minimal so we can use pthread_locks
* whenever they are needed.
diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c
index a9706d1..bcd49ed 100644
--- a/libpthread/nptl/init.c
+++ b/libpthread/nptl/init.c
@@ -60,15 +60,9 @@ int __have_futex_clock_realtime;
/* Version of the library, used in libthread_db to detect mismatches. */
static const char nptl_version[] __attribute_used__ = VERSION;
-
-#ifndef SHARED
-extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
-#endif
-
#ifdef SHARED
static void nptl_freeres (void);
-
static const struct pthread_functions pthread_functions =
{
.ptr_pthread_attr_destroy = __pthread_attr_destroy,
@@ -265,18 +259,6 @@ __pthread_initialize_minimal_internal (void)
return;
initialized = 1;
-#ifndef SHARED
- /* Unlike in the dynamically linked case the dynamic linker has not
- taken care of initializing the TLS data structures. */
- __libc_setup_tls (TLS_TCB_SIZE, TLS_TCB_ALIGN);
-
- /* We must prevent gcc from being clever and move any of the
- following code ahead of the __libc_setup_tls call. This function
- will initialize the thread register which is subsequently
- used. */
- __asm__ __volatile__ ("");
-#endif
-
/* Minimal initialization of the thread descriptor. */
struct pthread *pd = THREAD_SELF;
INTERNAL_SYSCALL_DECL (err);
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 a3312d2264a8f84c854bf9cd0fb05634baba5e87 (commit)
from fc3d5dc9840b02e73a189fc4f830dd5ef76f8b75 (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 a3312d2264a8f84c854bf9cd0fb05634baba5e87
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Mon Oct 12 16:21:54 2015 +0200
fix static binaries linked with pthread and compiled with ssp
Move TLS initialization for static builds up to the calling
function as suggested by Daniel Fahlgren.
Reported-By: Daniel Fahlgren <daniel(a)fahlgren.se>
-----------------------------------------------------------------------
Summary of changes:
libc/misc/internals/__uClibc_main.c | 12 ++++++++++++
libpthread/nptl/init.c | 18 ------------------
2 files changed, 12 insertions(+), 18 deletions(-)
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 1f1e601..632a252 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -32,6 +32,7 @@
#include <pthread-functions.h>
#include <not-cancel.h>
#include <atomic.h>
+#include <tls.h>
#endif
#ifdef __UCLIBC_HAS_THREADS__
#include <pthread.h>
@@ -132,6 +133,10 @@ extern void __pthread_initialize_minimal(void);
#endif
#endif
+#ifndef SHARED
+extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
+#endif
+
/* If __UCLIBC_FORMAT_SHARED_FLAT__, all array initialisation and finalisation
* is handled by the routines passed to __uClibc_main(). */
#if defined (__UCLIBC_CTOR_DTOR__) && !defined (__UCLIBC_FORMAT_SHARED_FLAT__)
@@ -243,6 +248,13 @@ void __uClibc_init(void)
__pagesize = PAGE_SIZE;
#ifdef __UCLIBC_HAS_THREADS__
+
+#if defined (__UCLIBC_HAS_THREADS_NATIVE__) && !defined (SHARED)
+ /* Unlike in the dynamically linked case the dynamic linker has not
+ taken care of initializing the TLS data structures. */
+ __libc_setup_tls (TLS_TCB_SIZE, TLS_TCB_ALIGN);
+#endif
+
/* Before we start initializing uClibc we have to call
* __pthread_initialize_minimal so we can use pthread_locks
* whenever they are needed.
diff --git a/libpthread/nptl/init.c b/libpthread/nptl/init.c
index a9706d1..bcd49ed 100644
--- a/libpthread/nptl/init.c
+++ b/libpthread/nptl/init.c
@@ -60,15 +60,9 @@ int __have_futex_clock_realtime;
/* Version of the library, used in libthread_db to detect mismatches. */
static const char nptl_version[] __attribute_used__ = VERSION;
-
-#ifndef SHARED
-extern void __libc_setup_tls (size_t tcbsize, size_t tcbalign);
-#endif
-
#ifdef SHARED
static void nptl_freeres (void);
-
static const struct pthread_functions pthread_functions =
{
.ptr_pthread_attr_destroy = __pthread_attr_destroy,
@@ -265,18 +259,6 @@ __pthread_initialize_minimal_internal (void)
return;
initialized = 1;
-#ifndef SHARED
- /* Unlike in the dynamically linked case the dynamic linker has not
- taken care of initializing the TLS data structures. */
- __libc_setup_tls (TLS_TCB_SIZE, TLS_TCB_ALIGN);
-
- /* We must prevent gcc from being clever and move any of the
- following code ahead of the __libc_setup_tls call. This function
- will initialize the thread register which is subsequently
- used. */
- __asm__ __volatile__ ("");
-#endif
-
/* Minimal initialization of the thread descriptor. */
struct pthread *pd = THREAD_SELF;
INTERNAL_SYSCALL_DECL (err);
hooks/post-receive
--
uClibc-ng - small C library for embedded systems
Hi,
I'm experiencing problems with uClibc-ng when creating static binaries
that uses threads. I originally reported this to the buildroot mailing
list but got redirected here instead.
The problem is when using a combination of stack protection, threads and
static binaries. The program will during start up get a sigsegv in
__pthread_initialize_minimal_internal(), and gdb says the instruction is
a
mov %fs:0x28,%rax
where %fs is 0x00. The reason for that is that the pthread library is
compiled with stack protection but __pthread_initialize_minimal_internal
is called before __libc_setup_tls in static binaries.
I have created an ugly patch to verify my hypothesis (attached). With
that patch the test program works, but what is the proper way to solve
this issue?
With uClibc 0.9.33.x the same thing happens. With glibc the program
works.
Best regards,
Daniel Fahlgren
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 fc3d5dc9840b02e73a189fc4f830dd5ef76f8b75 (commit)
from 916e50b36acaf1bc26fc7bd0972ac48e2ad9e2bf (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 fc3d5dc9840b02e73a189fc4f830dd5ef76f8b75
Author: Waldemar Brodkorb <wbx(a)uclibc-ng.org>
Date: Fri Oct 9 06:30:14 2015 +0200
restrict linuxthreads/nptl choice
For architectures supporting no MMU systems, allow to use
Linuxthreads. BFLAT does not support TLS right now, so NPTL
can not be used.
-----------------------------------------------------------------------
Summary of changes:
extra/Configs/Config.in | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in
index 56454ca..d22d1e7 100644
--- a/extra/Configs/Config.in
+++ b/extra/Configs/Config.in
@@ -501,6 +501,7 @@ config UCLIBC_HAS_LINUXTHREADS
# linuxthreads need nanosleep()
select UCLIBC_HAS_REALTIME
depends on !TARGET_arc && \
+ !TARGET_arm && \
!TARGET_i386 && \
!TARGET_metag && \
!TARGET_mips && \
@@ -508,7 +509,8 @@ config UCLIBC_HAS_LINUXTHREADS
!TARGET_sh && \
!TARGET_sparc && \
!TARGET_x86_64 && \
- !TARGET_xtensa
+ !TARGET_xtensa || \
+ !ARCH_USE_MMU
help
See here for information about linuxthreads:
http://en.wikipedia.org/wiki/LinuxThreads
@@ -531,7 +533,8 @@ config UCLIBC_HAS_THREADS_NATIVE
!TARGET_m68k && \
!TARGET_microblaze && \
!TARGET_nios2 && \
- !TARGET_or1k
+ !TARGET_or1k && \
+ ARCH_USE_MMU
help
If you want to compile uClibc with NPTL support, then answer Y.
hooks/post-receive
--
uClibc-ng - small C library for embedded systems