|
|
c6d234 |
commit 498a22333b835a598ccaed4656e97a0ec3573665
|
|
|
c6d234 |
Author: Roland McGrath <roland@hack.frob.com>
|
|
|
c6d234 |
Date: Fri Mar 14 10:44:34 2014 -0700
|
|
|
c6d234 |
|
|
|
c6d234 |
Compile with -Wundef.
|
|
|
c6d234 |
|
|
|
c6d234 |
Conflicts:
|
|
|
c6d234 |
Makeconfig
|
|
|
c6d234 |
(Textual conflict due to glibc-rh1418978-2-6.patch.)
|
|
|
c6d234 |
sysdeps/microblaze/nptl/tls.h
|
|
|
c6d234 |
(Our tree does not have a microblaze port, removed manually.)
|
|
|
c6d234 |
|
|
|
c6d234 |
diff --git a/Makeconfig b/Makeconfig
|
|
|
c6d234 |
index f23fd93febdf4a86..02f1cc1255c5ac07 100644
|
|
|
c6d234 |
--- a/Makeconfig
|
|
|
c6d234 |
+++ b/Makeconfig
|
|
|
c6d234 |
@@ -643,6 +643,7 @@ ifeq ($(all-warnings),yes)
|
|
|
c6d234 |
else
|
|
|
c6d234 |
+gccwarn := -Wall -Wwrite-strings -Winline
|
|
|
c6d234 |
endif
|
|
|
c6d234 |
++gccwarn += -Wundef
|
|
|
c6d234 |
+gccwarn-c = -Wstrict-prototypes -Werror=implicit-function-declaration
|
|
|
c6d234 |
|
|
|
c6d234 |
# We do not depend on the address of constants in different files to be
|
|
|
c6d234 |
diff --git a/include/errno.h b/include/errno.h
|
|
|
c6d234 |
index d26a9ee3ff320e3a..7df41dfc3166ef90 100644
|
|
|
c6d234 |
--- a/include/errno.h
|
|
|
c6d234 |
+++ b/include/errno.h
|
|
|
c6d234 |
@@ -6,6 +6,11 @@
|
|
|
c6d234 |
|
|
|
c6d234 |
# if IS_IN (rtld)
|
|
|
c6d234 |
# include <dl-sysdep.h>
|
|
|
c6d234 |
+# ifndef RTLD_PRIVATE_ERRNO
|
|
|
c6d234 |
+# error "dl-sysdep.h must define RTLD_PRIVATE_ERRNO!"
|
|
|
c6d234 |
+# endif
|
|
|
c6d234 |
+# else
|
|
|
c6d234 |
+# define RTLD_PRIVATE_ERRNO 0
|
|
|
c6d234 |
# endif
|
|
|
c6d234 |
|
|
|
c6d234 |
# if RTLD_PRIVATE_ERRNO
|
|
|
c6d234 |
diff --git a/include/stackinfo.h b/include/stackinfo.h
|
|
|
c6d234 |
new file mode 100644
|
|
|
c6d234 |
index 0000000000000000..b9b227848753ceb8
|
|
|
c6d234 |
--- /dev/null
|
|
|
c6d234 |
+++ b/include/stackinfo.h
|
|
|
c6d234 |
@@ -0,0 +1,42 @@
|
|
|
c6d234 |
+/* Details about the machine's stack: wrapper header.
|
|
|
c6d234 |
+ Copyright (C) 2014 Free Software Foundation, Inc.
|
|
|
c6d234 |
+ This file is part of the GNU C Library.
|
|
|
c6d234 |
+
|
|
|
c6d234 |
+ The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
+ modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
+ License as published by the Free Software Foundation; either
|
|
|
c6d234 |
+ version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
+
|
|
|
c6d234 |
+ The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
+ Lesser General Public License for more details.
|
|
|
c6d234 |
+
|
|
|
c6d234 |
+ You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
+ License along with the GNU C Library; if not, see
|
|
|
c6d234 |
+ <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
+
|
|
|
c6d234 |
+#ifndef _INCLUDE_STACKINFO_H
|
|
|
c6d234 |
+#define _INCLUDE_STACKINFO_H 1
|
|
|
c6d234 |
+
|
|
|
c6d234 |
+/* A sysdeps/.../stackinfo.h file defines details for the CPU.
|
|
|
c6d234 |
+ It is obliged to define either _STACK_GROWS_DOWN or _STACK_GROWS_UP. */
|
|
|
c6d234 |
+#include_next <stackinfo.h>
|
|
|
c6d234 |
+
|
|
|
c6d234 |
+#if defined _STACK_GROWS_DOWN && _STACK_GROWS_DOWN
|
|
|
c6d234 |
+# ifdef _STACK_GROWS_UP
|
|
|
c6d234 |
+# error "stackinfo.h should not define both!"
|
|
|
c6d234 |
+# else
|
|
|
c6d234 |
+# define _STACK_GROWS_UP 0
|
|
|
c6d234 |
+# endif
|
|
|
c6d234 |
+#elif defined _STACK_GROWS_UP && _STACK_GROWS_UP
|
|
|
c6d234 |
+# ifdef _STACK_GROWS_DOWN
|
|
|
c6d234 |
+# error "stackinfo.h should not define both!"
|
|
|
c6d234 |
+# else
|
|
|
c6d234 |
+# define _STACK_GROWS_DOWN 0
|
|
|
c6d234 |
+# endif
|
|
|
c6d234 |
+#else
|
|
|
c6d234 |
+# error "stackinfo.h must define _STACK_GROWS_UP or _STACK_GROWS_DOWN!"
|
|
|
c6d234 |
+#endif
|
|
|
c6d234 |
+
|
|
|
c6d234 |
+#endif /* include/stackinfo.h */
|
|
|
c6d234 |
diff --git a/nptl/sysdeps/i386/tls.h b/nptl/sysdeps/i386/tls.h
|
|
|
c6d234 |
index 90c7a534bfd0ed16..55877d71d2051d4c 100644
|
|
|
c6d234 |
--- a/nptl/sysdeps/i386/tls.h
|
|
|
c6d234 |
+++ b/nptl/sysdeps/i386/tls.h
|
|
|
c6d234 |
@@ -102,9 +102,6 @@ union user_desc_init
|
|
|
c6d234 |
};
|
|
|
c6d234 |
|
|
|
c6d234 |
|
|
|
c6d234 |
-/* Get the thread descriptor definition. */
|
|
|
c6d234 |
-# include <nptl/descr.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
/* This is the size of the initial TCB. Can't be just sizeof (tcbhead_t),
|
|
|
c6d234 |
because NPTL getpid, __libc_alloca_cutoff etc. need (almost) the whole
|
|
|
c6d234 |
struct pthread even when not linked with -lpthread. */
|
|
|
c6d234 |
@@ -122,6 +119,10 @@ union user_desc_init
|
|
|
c6d234 |
/* The TCB can have any size and the memory following the address the
|
|
|
c6d234 |
thread pointer points to is unspecified. Allocate the TCB there. */
|
|
|
c6d234 |
# define TLS_TCB_AT_TP 1
|
|
|
c6d234 |
+# define TLS_DTV_AT_TP 0
|
|
|
c6d234 |
+
|
|
|
c6d234 |
+/* Get the thread descriptor definition. */
|
|
|
c6d234 |
+# include <nptl/descr.h>
|
|
|
c6d234 |
|
|
|
c6d234 |
|
|
|
c6d234 |
/* Install the dtv pointer. The pointer passed is to the element with
|
|
|
c6d234 |
diff --git a/nptl/sysdeps/powerpc/tls.h b/nptl/sysdeps/powerpc/tls.h
|
|
|
c6d234 |
index 33efc7aea638f138..a04dfa89aa1ec73c 100644
|
|
|
c6d234 |
--- a/nptl/sysdeps/powerpc/tls.h
|
|
|
c6d234 |
+++ b/nptl/sysdeps/powerpc/tls.h
|
|
|
c6d234 |
@@ -49,6 +49,7 @@ typedef union dtv
|
|
|
c6d234 |
|
|
|
c6d234 |
/* The TP points to the start of the thread blocks. */
|
|
|
c6d234 |
# define TLS_DTV_AT_TP 1
|
|
|
c6d234 |
+# define TLS_TCB_AT_TP 0
|
|
|
c6d234 |
|
|
|
c6d234 |
/* We use the multiple_threads field in the pthread struct */
|
|
|
c6d234 |
#define TLS_MULTIPLE_THREADS_IN_TCB 1
|
|
|
c6d234 |
@@ -56,6 +57,7 @@ typedef union dtv
|
|
|
c6d234 |
/* Get the thread descriptor definition. */
|
|
|
c6d234 |
# include <nptl/descr.h>
|
|
|
c6d234 |
|
|
|
c6d234 |
+
|
|
|
c6d234 |
/* The stack_guard is accessed directly by GCC -fstack-protector code,
|
|
|
c6d234 |
so it is a part of public ABI. The dtv and pointer_guard fields
|
|
|
c6d234 |
are private. */
|
|
|
c6d234 |
diff --git a/nptl/sysdeps/s390/tls.h b/nptl/sysdeps/s390/tls.h
|
|
|
c6d234 |
index 4b1ce051c4a87652..580196b7bfee3046 100644
|
|
|
c6d234 |
--- a/nptl/sysdeps/s390/tls.h
|
|
|
c6d234 |
+++ b/nptl/sysdeps/s390/tls.h
|
|
|
c6d234 |
@@ -73,9 +73,6 @@ typedef struct
|
|
|
c6d234 |
/* Get system call information. */
|
|
|
c6d234 |
# include <sysdep.h>
|
|
|
c6d234 |
|
|
|
c6d234 |
-/* Get the thread descriptor definition. */
|
|
|
c6d234 |
-# include <nptl/descr.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
/* This is the size of the initial TCB. Can't be just sizeof (tcbhead_t),
|
|
|
c6d234 |
because NPTL getpid, __libc_alloca_cutoff etc. need (almost) the whole
|
|
|
c6d234 |
struct pthread even when not linked with -lpthread. */
|
|
|
c6d234 |
@@ -93,6 +90,10 @@ typedef struct
|
|
|
c6d234 |
/* The TCB can have any size and the memory following the address the
|
|
|
c6d234 |
thread pointer points to is unspecified. Allocate the TCB there. */
|
|
|
c6d234 |
# define TLS_TCB_AT_TP 1
|
|
|
c6d234 |
+# define TLS_DTV_AT_TP 0
|
|
|
c6d234 |
+
|
|
|
c6d234 |
+/* Get the thread descriptor definition. */
|
|
|
c6d234 |
+# include <nptl/descr.h>
|
|
|
c6d234 |
|
|
|
c6d234 |
|
|
|
c6d234 |
/* Install the dtv pointer. The pointer passed is to the element with
|
|
|
c6d234 |
diff --git a/nptl/sysdeps/sh/tls.h b/nptl/sysdeps/sh/tls.h
|
|
|
c6d234 |
index a7f53dfecf0ca6d6..4659af51c0be7595 100644
|
|
|
c6d234 |
--- a/nptl/sysdeps/sh/tls.h
|
|
|
c6d234 |
+++ b/nptl/sysdeps/sh/tls.h
|
|
|
c6d234 |
@@ -76,6 +76,7 @@ typedef struct
|
|
|
c6d234 |
|
|
|
c6d234 |
/* The TLS blocks start right after the TCB. */
|
|
|
c6d234 |
# define TLS_DTV_AT_TP 1
|
|
|
c6d234 |
+# define TLS_TCB_AT_TP 0
|
|
|
c6d234 |
|
|
|
c6d234 |
/* Get the thread descriptor definition. */
|
|
|
c6d234 |
# include <nptl/descr.h>
|
|
|
c6d234 |
diff --git a/nptl/sysdeps/sparc/tls.h b/nptl/sysdeps/sparc/tls.h
|
|
|
c6d234 |
index cfc9d96c67027caf..2ef0d4e1012259ad 100644
|
|
|
c6d234 |
--- a/nptl/sysdeps/sparc/tls.h
|
|
|
c6d234 |
+++ b/nptl/sysdeps/sparc/tls.h
|
|
|
c6d234 |
@@ -69,9 +69,6 @@ typedef struct
|
|
|
c6d234 |
/* Get system call information. */
|
|
|
c6d234 |
# include <sysdep.h>
|
|
|
c6d234 |
|
|
|
c6d234 |
-/* Get the thread descriptor definition. */
|
|
|
c6d234 |
-# include <nptl/descr.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
register struct pthread *__thread_self __asm__("%g7");
|
|
|
c6d234 |
|
|
|
c6d234 |
/* This is the size of the initial TCB. Can't be just sizeof (tcbhead_t),
|
|
|
c6d234 |
@@ -91,6 +88,10 @@ register struct pthread *__thread_self __asm__("%g7");
|
|
|
c6d234 |
/* The TCB can have any size and the memory following the address the
|
|
|
c6d234 |
thread pointer points to is unspecified. Allocate the TCB there. */
|
|
|
c6d234 |
# define TLS_TCB_AT_TP 1
|
|
|
c6d234 |
+# define TLS_DTV_AT_TP 0
|
|
|
c6d234 |
+
|
|
|
c6d234 |
+/* Get the thread descriptor definition. */
|
|
|
c6d234 |
+# include <nptl/descr.h>
|
|
|
c6d234 |
|
|
|
c6d234 |
/* Install the dtv pointer. The pointer passed is to the element with
|
|
|
c6d234 |
index -1 which contain the length. */
|
|
|
c6d234 |
diff --git a/nptl/sysdeps/x86_64/tls.h b/nptl/sysdeps/x86_64/tls.h
|
|
|
c6d234 |
index cfba4e142ac5dae8..37e9af71b80d18b0 100644
|
|
|
c6d234 |
--- a/nptl/sysdeps/x86_64/tls.h
|
|
|
c6d234 |
+++ b/nptl/sysdeps/x86_64/tls.h
|
|
|
c6d234 |
@@ -91,10 +91,6 @@ typedef struct
|
|
|
c6d234 |
/* Get system call information. */
|
|
|
c6d234 |
# include <sysdep.h>
|
|
|
c6d234 |
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Get the thread descriptor definition. */
|
|
|
c6d234 |
-# include <nptl/descr.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
#ifndef LOCK_PREFIX
|
|
|
c6d234 |
# ifdef UP
|
|
|
c6d234 |
# define LOCK_PREFIX /* nothing */
|
|
|
c6d234 |
@@ -120,6 +116,10 @@ typedef struct
|
|
|
c6d234 |
/* The TCB can have any size and the memory following the address the
|
|
|
c6d234 |
thread pointer points to is unspecified. Allocate the TCB there. */
|
|
|
c6d234 |
# define TLS_TCB_AT_TP 1
|
|
|
c6d234 |
+# define TLS_DTV_AT_TP 0
|
|
|
c6d234 |
+
|
|
|
c6d234 |
+/* Get the thread descriptor definition. */
|
|
|
c6d234 |
+# include <nptl/descr.h>
|
|
|
c6d234 |
|
|
|
c6d234 |
|
|
|
c6d234 |
/* Install the dtv pointer. The pointer passed is to the element with
|
|
|
c6d234 |
diff --git a/ports/sysdeps/hppa/nptl/tls.h b/ports/sysdeps/hppa/nptl/tls.h
|
|
|
c6d234 |
index 5eb55a53603bb31e..be14fe6599c9f41b 100644
|
|
|
c6d234 |
--- a/ports/sysdeps/hppa/nptl/tls.h
|
|
|
c6d234 |
+++ b/ports/sysdeps/hppa/nptl/tls.h
|
|
|
c6d234 |
@@ -51,6 +51,7 @@ typedef union dtv
|
|
|
c6d234 |
|
|
|
c6d234 |
/* The TP points to the start of the thread blocks. */
|
|
|
c6d234 |
# define TLS_DTV_AT_TP 1
|
|
|
c6d234 |
+# define TLS_TCB_AT_TP 0
|
|
|
c6d234 |
|
|
|
c6d234 |
/* Get the thread descriptor definition. */
|
|
|
c6d234 |
# include <nptl/descr.h>
|
|
|
c6d234 |
diff --git a/sysdeps/aarch64/nptl/tls.h b/sysdeps/aarch64/nptl/tls.h
|
|
|
c6d234 |
index 05135db57ab69ef6..e08ff732efcc4fa2 100644
|
|
|
c6d234 |
--- a/sysdeps/aarch64/nptl/tls.h
|
|
|
c6d234 |
+++ b/sysdeps/aarch64/nptl/tls.h
|
|
|
c6d234 |
@@ -48,6 +48,7 @@ typedef union dtv
|
|
|
c6d234 |
|
|
|
c6d234 |
/* The TP points to the start of the thread blocks. */
|
|
|
c6d234 |
# define TLS_DTV_AT_TP 1
|
|
|
c6d234 |
+# define TLS_TCB_AT_TP 0
|
|
|
c6d234 |
|
|
|
c6d234 |
/* Get the thread descriptor definition. */
|
|
|
c6d234 |
# include <nptl/descr.h>
|
|
|
c6d234 |
diff --git a/sysdeps/alpha/nptl/tls.h b/sysdeps/alpha/nptl/tls.h
|
|
|
c6d234 |
index 18c29c80fa369e35..f593ba7162954e99 100644
|
|
|
c6d234 |
--- a/sysdeps/alpha/nptl/tls.h
|
|
|
c6d234 |
+++ b/sysdeps/alpha/nptl/tls.h
|
|
|
c6d234 |
@@ -42,6 +42,7 @@ typedef union dtv
|
|
|
c6d234 |
|
|
|
c6d234 |
/* The TP points to the start of the thread blocks. */
|
|
|
c6d234 |
# define TLS_DTV_AT_TP 1
|
|
|
c6d234 |
+# define TLS_TCB_AT_TP 0
|
|
|
c6d234 |
|
|
|
c6d234 |
/* Get the thread descriptor definition. */
|
|
|
c6d234 |
# include <nptl/descr.h>
|
|
|
c6d234 |
diff --git a/sysdeps/arm/nptl/tls.h b/sysdeps/arm/nptl/tls.h
|
|
|
c6d234 |
index 52f695e58b22b406..00b1e53c33064a2e 100644
|
|
|
c6d234 |
--- a/sysdeps/arm/nptl/tls.h
|
|
|
c6d234 |
+++ b/sysdeps/arm/nptl/tls.h
|
|
|
c6d234 |
@@ -49,6 +49,7 @@ typedef union dtv
|
|
|
c6d234 |
|
|
|
c6d234 |
/* The TP points to the start of the thread blocks. */
|
|
|
c6d234 |
# define TLS_DTV_AT_TP 1
|
|
|
c6d234 |
+# define TLS_TCB_AT_TP 0
|
|
|
c6d234 |
|
|
|
c6d234 |
/* Get the thread descriptor definition. */
|
|
|
c6d234 |
# include <nptl/descr.h>
|
|
|
c6d234 |
diff --git a/sysdeps/ia64/nptl/tls.h b/sysdeps/ia64/nptl/tls.h
|
|
|
c6d234 |
index 77574e55db890043..f270f958bcfc53de 100644
|
|
|
c6d234 |
--- a/sysdeps/ia64/nptl/tls.h
|
|
|
c6d234 |
+++ b/sysdeps/ia64/nptl/tls.h
|
|
|
c6d234 |
@@ -87,6 +87,7 @@ register struct pthread *__thread_self __asm__("r13");
|
|
|
c6d234 |
|
|
|
c6d234 |
/* The DTV is allocated at the TP; the TCB is placed elsewhere. */
|
|
|
c6d234 |
# define TLS_DTV_AT_TP 1
|
|
|
c6d234 |
+# define TLS_TCB_AT_TP 0
|
|
|
c6d234 |
|
|
|
c6d234 |
/* Get the thread descriptor definition. */
|
|
|
c6d234 |
# include <nptl/descr.h>
|
|
|
c6d234 |
diff --git a/sysdeps/m68k/nptl/tls.h b/sysdeps/m68k/nptl/tls.h
|
|
|
c6d234 |
index 8b0909237b303695..7f4bbfb9162dd610 100644
|
|
|
c6d234 |
--- a/sysdeps/m68k/nptl/tls.h
|
|
|
c6d234 |
+++ b/sysdeps/m68k/nptl/tls.h
|
|
|
c6d234 |
@@ -49,6 +49,7 @@ typedef union dtv
|
|
|
c6d234 |
|
|
|
c6d234 |
/* The TP points to the start of the thread blocks. */
|
|
|
c6d234 |
# define TLS_DTV_AT_TP 1
|
|
|
c6d234 |
+# define TLS_TCB_AT_TP 0
|
|
|
c6d234 |
|
|
|
c6d234 |
/* Get the thread descriptor definition. */
|
|
|
c6d234 |
# include <nptl/descr.h>
|
|
|
c6d234 |
diff --git a/sysdeps/mach/hurd/i386/tls.h b/sysdeps/mach/hurd/i386/tls.h
|
|
|
c6d234 |
index d0a72f0e5c032820..8619820d3b0502b5 100644
|
|
|
c6d234 |
--- a/sysdeps/mach/hurd/i386/tls.h
|
|
|
c6d234 |
+++ b/sysdeps/mach/hurd/i386/tls.h
|
|
|
c6d234 |
@@ -26,6 +26,7 @@
|
|
|
c6d234 |
/* The TCB can have any size and the memory following the address the
|
|
|
c6d234 |
thread pointer points to is unspecified. Allocate the TCB there. */
|
|
|
c6d234 |
#define TLS_TCB_AT_TP 1
|
|
|
c6d234 |
+#define TLS_DTV_AT_TP 0
|
|
|
c6d234 |
|
|
|
c6d234 |
#ifndef __ASSEMBLER__
|
|
|
c6d234 |
|
|
|
c6d234 |
diff --git a/sysdeps/mips/nptl/tls.h b/sysdeps/mips/nptl/tls.h
|
|
|
c6d234 |
index 8a97437bad4752c4..669a79c0c64cb566 100644
|
|
|
c6d234 |
--- a/sysdeps/mips/nptl/tls.h
|
|
|
c6d234 |
+++ b/sysdeps/mips/nptl/tls.h
|
|
|
c6d234 |
@@ -62,6 +62,7 @@ typedef union dtv
|
|
|
c6d234 |
|
|
|
c6d234 |
/* The TP points to the start of the thread blocks. */
|
|
|
c6d234 |
# define TLS_DTV_AT_TP 1
|
|
|
c6d234 |
+# define TLS_TCB_AT_TP 0
|
|
|
c6d234 |
|
|
|
c6d234 |
/* Get the thread descriptor definition. */
|
|
|
c6d234 |
# include <nptl/descr.h>
|
|
|
c6d234 |
diff --git a/sysdeps/tile/nptl/tls.h b/sysdeps/tile/nptl/tls.h
|
|
|
c6d234 |
index 303a95e000fee30f..132de9021e5651f0 100644
|
|
|
c6d234 |
--- a/sysdeps/tile/nptl/tls.h
|
|
|
c6d234 |
+++ b/sysdeps/tile/nptl/tls.h
|
|
|
c6d234 |
@@ -49,6 +49,7 @@ typedef union dtv
|
|
|
c6d234 |
|
|
|
c6d234 |
/* The TP points to the start of the thread blocks. */
|
|
|
c6d234 |
# define TLS_DTV_AT_TP 1
|
|
|
c6d234 |
+# define TLS_TCB_AT_TP 0
|
|
|
c6d234 |
|
|
|
c6d234 |
/* We use the multiple_threads field in the pthread struct */
|
|
|
c6d234 |
#define TLS_MULTIPLE_THREADS_IN_TCB 1
|