This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch roland/nacl-port/master updated. 3a0a6b73bcc929f2a1167c7c23d36f630fdc615f
- From: roland at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 17 Dec 2014 18:35:30 -0000
- Subject: GNU C Library master sources branch roland/nacl-port/master updated. 3a0a6b73bcc929f2a1167c7c23d36f630fdc615f
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 "GNU C Library master sources".
The branch, roland/nacl-port/master has been updated
via 3a0a6b73bcc929f2a1167c7c23d36f630fdc615f (commit)
via ccca0e6e2bd824370e4b9d98893324bfd532cf91 (commit)
via b297a3d5132f512c9c1712d90fdf399011a6eb63 (commit)
via 0f4ffde865f93f55600d54fc8363c6ef8d5ea7ef (commit)
via 668e4ca1618ea7a4f577376789668ce9ac039b85 (commit)
via 60cef00a955b4fdd13aee925fa83d10854f0ffbd (commit)
via eae0768b87dd92e1fa2235dc67c6d0eb4f4200cd (commit)
via 0669f237aeff5d8a48e9ba9900aa76db3a356eae (commit)
from b1a79512dd4f2c56210dfb371428b931e4539abe (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 -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=3a0a6b73bcc929f2a1167c7c23d36f630fdc615f
commit 3a0a6b73bcc929f2a1167c7c23d36f630fdc615f
Author: Roland McGrath <roland@hack.frob.com>
Date: Wed Dec 17 10:35:02 2014 -0800
NPTL thread creation
diff --git a/sysdeps/nacl/createthread.c b/sysdeps/nacl/createthread.c
new file mode 100644
index 0000000..89a58a7
--- /dev/null
+++ b/sysdeps/nacl/createthread.c
@@ -0,0 +1,46 @@
+/* Low-level thread creation for NPTL. NaCl version.
+ Copyright (C) 2014 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <nacl-interfaces.h>
+
+/* See the comments in pthread_create.c for the requirements for these
+ two macros and the create_thread function. */
+
+#define START_THREAD_DEFN \
+ static void __attribute__ ((noreturn)) start_thread (void)
+#define START_THREAD_SELF THREAD_SELF
+
+/* pthread_create.c defines this using START_THREAD_DEFN
+ We need a forward declaration here so we can take its address. */
+static void start_thread (void) __attribute__ ((noreturn));
+
+static int
+create_thread (struct pthread *pd, const struct pthread_attr *attr,
+ bool stopped_start, STACK_VARIABLES_PARMS, bool *thread_ran)
+{
+ pd->stopped_start = stopped_start;
+ if (__glibc_unlikely (stopped_start))
+ /* We make sure the thread does not run far by forcing it to get a
+ lock. We lock it here too so that the new thread cannot continue
+ until we tell it to. */
+ lll_lock (pd->lock, LLL_PRIVATE);
+
+ TLS_DEFINE_INIT_TP (tp, pd);
+
+ return __nacl_irt_thread.thread_create (&start_thread, stackaddr, tp);
+}
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=ccca0e6e2bd824370e4b9d98893324bfd532cf91
commit ccca0e6e2bd824370e4b9d98893324bfd532cf91
Author: Roland McGrath <roland@hack.frob.com>
Date: Wed Dec 17 10:34:44 2014 -0800
Placeholder sigaction.c
diff --git a/sysdeps/nacl/sigaction.c b/sysdeps/nacl/sigaction.c
new file mode 100644
index 0000000..8fb9f82
--- /dev/null
+++ b/sysdeps/nacl/sigaction.c
@@ -0,0 +1,2 @@
+/* This placeholder file prevents nptl/sigaction.c from being compiled.
+ For NaCl, there is no need for a separate sigaction in libpthread. */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=b297a3d5132f512c9c1712d90fdf399011a6eb63
commit b297a3d5132f512c9c1712d90fdf399011a6eb63
Author: Roland McGrath <roland@hack.frob.com>
Date: Wed Dec 17 10:34:26 2014 -0800
Hack up futex layer to get things building again.
diff --git a/sysdeps/nacl/lowlevellock-futex.h b/sysdeps/nacl/lowlevellock-futex.h
index 85fd9b4..ec856df 100644
--- a/sysdeps/nacl/lowlevellock-futex.h
+++ b/sysdeps/nacl/lowlevellock-futex.h
@@ -23,15 +23,19 @@
#include <time.h>
+#pragma GCC diagnostic ignored "-Wunused-value" /* XXX */
+
/* Values for 'private' parameter of locking macros. Note pthreadP.h
optimizes for these exact values, though they are not required. */
#define LLL_PRIVATE 0
#define LLL_SHARED 128
+#define FUTEX_PRIVATE_FLAG 0 /* XXX */
+
/* Wait while *FUTEXP == VAL for an lll_futex_wake call on FUTEXP. */
#define lll_futex_wait(futexp, val, private) \
- (- __nacl_irt_futex.futex_wait_abs (futexp, val, NULL))
+ (- __nacl_irt_futex.futex_wait_abs ((volatile int *) (futexp), val, NULL))
/* Wait until a lll_futex_wake call on FUTEXP, or TIMEOUT elapses. */
#define lll_futex_timed_wait(futexp, val, timeout, private) \
@@ -54,7 +58,8 @@
_to = &_ts; \
} \
if (_err == 0) \
- _err = __nacl_irt_futex.futex_wait_abs (futexp, val, _to); \
+ _err = __nacl_irt_futex.futex_wait_abs \
+ ((volatile int *) (futexp), val, _to); \
-_err; \
})
@@ -62,7 +67,7 @@
#define lll_futex_wake(futexp, nr, private) \
({ \
int _woken; \
- - __nacl_irt_futex.futex_wake (futexp, nr, &_woken); \
+ - __nacl_irt_futex.futex_wake ((volatile int *) (futexp), nr, &_woken); \
})
/* NaCl does not support the requeue operation. The only use of this is in
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0f4ffde865f93f55600d54fc8363c6ef8d5ea7ef
commit 0f4ffde865f93f55600d54fc8363c6ef8d5ea7ef
Author: Roland McGrath <roland@hack.frob.com>
Date: Wed Dec 17 10:33:55 2014 -0800
Adapt to bits/stat.h changes.
diff --git a/sysdeps/nacl/xstatconv.h b/sysdeps/nacl/xstatconv.h
index 1bfbb73..2567242 100644
--- a/sysdeps/nacl/xstatconv.h
+++ b/sysdeps/nacl/xstatconv.h
@@ -25,19 +25,8 @@ struct stat;
/* stat.h uses nacl_abi_off_t, but irt.h defines only nacl_irt_off_t. */
typedef nacl_irt_off_t nacl_abi_off_t;
-/* We use this header to define struct nacl_abi_stat. But we must avoid
- its excess declarations, and defining these names away is (marginally)
- cleaner than #undef'ing __native_client__. */
-#undef stat
-#define stat __avoid_nacl_stat
-#undef fstat
-#define fstat __avoid_nacl_fstat
-#undef lstat
-#define lstat __avoid_nacl_lstat
-#include <native_client/src/trusted/service_runtime/include/sys/stat.h>
-#undef stat
-#undef fstat
-#undef lstat
+/* We use this header to define struct nacl_abi_stat. */
+#include <native_client/src/trusted/service_runtime/include/bits/stat.h>
extern int __xstat_conv (int vers, const struct nacl_abi_stat *, void *)
internal_function attribute_hidden;
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=668e4ca1618ea7a4f577376789668ce9ac039b85
commit 668e4ca1618ea7a4f577376789668ce9ac039b85
Author: Roland McGrath <roland@hack.frob.com>
Date: Wed Nov 12 14:29:17 2014 -0800
Use basic futex ops.
diff --git a/sysdeps/nacl/lowlevellock-futex.h b/sysdeps/nacl/lowlevellock-futex.h
new file mode 100644
index 0000000..85fd9b4
--- /dev/null
+++ b/sysdeps/nacl/lowlevellock-futex.h
@@ -0,0 +1,82 @@
+/* Low-level locking access to futex facilities. Stub version.
+ Copyright (C) 2014 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library. If not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _LOWLEVELLOCK_FUTEX_H
+#define _LOWLEVELLOCK_FUTEX_H 1
+
+#include <nacl-interfaces.h>
+#include <time.h>
+
+
+/* Values for 'private' parameter of locking macros. Note pthreadP.h
+ optimizes for these exact values, though they are not required. */
+#define LLL_PRIVATE 0
+#define LLL_SHARED 128
+
+
+/* Wait while *FUTEXP == VAL for an lll_futex_wake call on FUTEXP. */
+#define lll_futex_wait(futexp, val, private) \
+ (- __nacl_irt_futex.futex_wait_abs (futexp, val, NULL))
+
+/* Wait until a lll_futex_wake call on FUTEXP, or TIMEOUT elapses. */
+#define lll_futex_timed_wait(futexp, val, timeout, private) \
+ ({ \
+ /* This timeout is relative, but the IRT call wants it absolute. */ \
+ const struct timespec *_to = (timeout); \
+ struct timespec _ts; \
+ int _err = 0; \
+ if (_to != NULL \
+ && __glibc_likely ((_err = __nacl_irt_clock.clock_gettime \
+ (CLOCK_REALTIME, &_ts)) == 0)) \
+ { \
+ _ts.tv_sec -= _to->tv_sec; \
+ _ts.tv_nsec -= _to->tv_nsec; \
+ while (_ts.tv_nsec < 0) \
+ { \
+ _ts.tv_nsec += 1000000000; \
+ --_ts.tv_sec; \
+ } \
+ _to = &_ts; \
+ } \
+ if (_err == 0) \
+ _err = __nacl_irt_futex.futex_wait_abs (futexp, val, _to); \
+ -_err; \
+ })
+
+/* Wake up up to NR waiters on FUTEXP. */
+#define lll_futex_wake(futexp, nr, private) \
+ ({ \
+ int _woken; \
+ - __nacl_irt_futex.futex_wake (futexp, nr, &_woken); \
+ })
+
+/* NaCl does not support the requeue operation. The only use of this is in
+ pthread_cond_broadcast, which handles an error return by falling back to
+ plain lll_futex_wake. */
+#define lll_futex_requeue(futexp, nr_wake, nr_move, mutex, val, private) \
+ ((futexp), (nr_wake), (nr_move), (mutex), (val), (private), -ENOSYS)
+
+/* NaCl does not support the special wake-unlock operation. The only use
+ of this is in pthread_cond_signal, which handles an error return by
+ falling back to plain lll_futex_wake. */
+/* Wake up up to NR_WAKE waiters on FUTEXP and NR_WAKE2 on FUTEXP2. */
+#define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
+ ((futexp), (nr_wake), (nr_wake2), (futexp2), (private), -ENOSYS)
+
+
+#endif /* lowlevellock-futex.h */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=60cef00a955b4fdd13aee925fa83d10854f0ffbd
commit 60cef00a955b4fdd13aee925fa83d10854f0ffbd
Author: Roland McGrath <roland@hack.frob.com>
Date: Wed Nov 12 14:28:43 2014 -0800
Define THREAD_SYSINFO macros.
diff --git a/sysdeps/nacl/tls.h b/sysdeps/nacl/tls.h
index 36d0b5b..dcfa2e8 100644
--- a/sysdeps/nacl/tls.h
+++ b/sysdeps/nacl/tls.h
@@ -29,6 +29,13 @@
# define TLS_INIT_TP(tcbp) \
((*__nacl_irt_tls.tls_init) (tcbp) == 0 ? NULL : "tls_init call failed")
+/* Our use of dl_sysinfo is rather different from the Linux syscall
+ entry-point case. We never need a thread-local copy of the value. */
+# undef SETUP_THREAD_SYSINFO
+# undef CHECK_THREAD_SYSINFO
+# define SETUP_THREAD_SYSINFO(pd) ((void) (pd))
+# define CHECK_THREAD_SYSINFO(pd) ((void) (pd))
+
#endif /* __ASSEMBLER__ */
#endif /* tls.h */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=eae0768b87dd92e1fa2235dc67c6d0eb4f4200cd
commit eae0768b87dd92e1fa2235dc67c6d0eb4f4200cd
Author: Roland McGrath <roland@hack.frob.com>
Date: Wed Nov 12 14:28:27 2014 -0800
Adapt to nacl internal header changes.
diff --git a/sysdeps/nacl/xstatconv.h b/sysdeps/nacl/xstatconv.h
index 5ea437c..1bfbb73 100644
--- a/sysdeps/nacl/xstatconv.h
+++ b/sysdeps/nacl/xstatconv.h
@@ -18,6 +18,8 @@
#include <nacl-interfaces.h>
+#define NACL_IN_TOOLCHAIN_HEADERS
+
struct stat;
/* stat.h uses nacl_abi_off_t, but irt.h defines only nacl_irt_off_t. */
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=0669f237aeff5d8a48e9ba9900aa76db3a356eae
commit 0669f237aeff5d8a48e9ba9900aa76db3a356eae
Author: Roland McGrath <roland@hack.frob.com>
Date: Wed Oct 15 13:32:33 2014 -0700
shlib-versions revamp
diff --git a/sysdeps/arm/nacl/shlib-versions b/sysdeps/arm/nacl/shlib-versions
new file mode 100644
index 0000000..9d94784
--- /dev/null
+++ b/sysdeps/arm/nacl/shlib-versions
@@ -0,0 +1,4 @@
+# Library=version Earliest symbol set (optional)
+# --------------- ------------------------------
+
+ld=ld-nacl-arm.so.1
diff --git a/sysdeps/nacl/shlib-versions b/sysdeps/nacl/shlib-versions
index 2ab1f3c..dc122bf 100644
--- a/sysdeps/nacl/shlib-versions
+++ b/sysdeps/nacl/shlib-versions
@@ -1,17 +1,9 @@
-# Configuration DEFAULT Earliest symbol set
-# ------------- --------------- ------------------------------
-.*-.*-nacl.* DEFAULT GLIBC_2.19
+# DEFAULT Earliest symbol set
+# ------- -------------------
+DEFAULT GLIBC_2.20
-# Configuration ABI Identifier for ABI data files
-# ------------- ---------- -----------------------------
-.*-.*-nacl.* ABI nacl
+# Library=version Earliest symbol set (optional)
+# --------------- ------------------------------
-# Configuration Library=version Earliest symbol set (optional)
-# ------------- --------------- ------------------------------
-
-.*-.*-nacl.* libc=1
-.*-.*-nacl.* libm=1
-
-arm.*-.*-nacl.* ld=ld-nacl-arm.so.1
-i.86-.*-nacl.* ld=ld-nacl-x86-32.so.1
-x86_64-.*-nacl.* ld=ld-nacl-x86-64.so.1
+libc=1
+libm=1
-----------------------------------------------------------------------
Summary of changes:
sysdeps/arm/nacl/shlib-versions | 4 ++
sysdeps/nacl/createthread.c | 46 +++++++++++++++++++
sysdeps/nacl/lowlevellock-futex.h | 87 +++++++++++++++++++++++++++++++++++++
sysdeps/nacl/shlib-versions | 22 +++------
sysdeps/nacl/sigaction.c | 2 +
sysdeps/nacl/tls.h | 7 +++
sysdeps/nacl/xstatconv.h | 17 ++------
7 files changed, 157 insertions(+), 28 deletions(-)
create mode 100644 sysdeps/arm/nacl/shlib-versions
create mode 100644 sysdeps/nacl/createthread.c
create mode 100644 sysdeps/nacl/lowlevellock-futex.h
create mode 100644 sysdeps/nacl/sigaction.c
hooks/post-receive
--
GNU C Library master sources