This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch gentoo/2.23 updated. glibc-2.23-9-g1053a49


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, gentoo/2.23 has been updated
       via  1053a4902ebff0ba30098fdcad614d963de87c3d (commit)
       via  08ca6de9e4ae0df22c5153dd4473d148e3c43360 (commit)
       via  20cfe4c8c35fd3e59569e8bd10bf2d48a34b654b (commit)
       via  cbe36074e46395c3544ec3cfc0c8af4885edd055 (commit)
      from  9f0a71762084b0289e5988ea63830f9b6e006c39 (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=1053a4902ebff0ba30098fdcad614d963de87c3d

commit 1053a4902ebff0ba30098fdcad614d963de87c3d
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Tue Dec 29 17:54:31 2015 -0500

    sys/types.h: drop sys/sysmacros.h include
    
    We want to break apart this include path due to namespace pollution.
    https://sourceware.org/ml/libc-alpha/2015-11/msg00253.html

diff --git a/posix/sys/types.h b/posix/sys/types.h
index a728567..b3007db 100644
--- a/posix/sys/types.h
+++ b/posix/sys/types.h
@@ -217,9 +217,6 @@ typedef int register_t __attribute__ ((__mode__ (__word__)));
 
 /* It also defines `fd_set' and the FD_* macros for `select'.  */
 # include <sys/select.h>
-
-/* BSD defines these symbols, so we follow.  */
-# include <sys/sysmacros.h>
 #endif /* Use misc.  */
 
 

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=08ca6de9e4ae0df22c5153dd4473d148e3c43360

commit 08ca6de9e4ae0df22c5153dd4473d148e3c43360
Author: Stephanie J. Lockwood-Childs <wormo@gentoo.org>
Date:   Tue Mar 13 01:57:21 2007 -0400

    gentoo: support running tests under sandbox
    
    when glibc runs its tests, it does so by invoking the local library loader.
    in Gentoo, we build/run inside of our "sandbox" which itself is linked against
    libdl (so that it can load libraries and pull out symbols).  the trouble
    is that when you upgrade from an older glibc to the new one, often times
    internal symbols change name or abi.  this is normally OK as you cannot use
    libc.so from say version 2.3.6 but libpthread.so from say version 2.5, so
    we always say "keep all of the glibc libraries from the same build".  but
    when glibc runs its tests, it uses dynamic paths to point to its new local
    copies of libraries.  if the test doesnt use libdl, then glibc doesnt add
    its path, and when sandbox triggers the loading of libdl, glibc does so
    from the host system system.  this gets us into the case of all libraries
    are from the locally compiled version of glibc except for libdl.so.
    
    http://bugs.gentoo.org/56898

diff --git a/Makeconfig b/Makeconfig
index 87a22e8..6f4a678 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -647,7 +647,7 @@ comma = ,
 sysdep-library-path = \
 $(subst $(empty) ,:,$(strip $(patsubst -Wl$(comma)-rpath-link=%, %,\
 				       $(filter -Wl$(comma)-rpath-link=%,\
-						$(sysdep-LDFLAGS)))))
+						$(sysdep-LDFLAGS)))) $(common-objpfx)/dlfcn)
 # $(run-via-rtld-prefix) is a command that, when prepended to the name
 # of a program built with the newly built library, produces a command
 # that, executed on the host for which the library is built, runs that
diff --git a/iconvdata/run-iconv-test.sh b/iconvdata/run-iconv-test.sh
index 2e7105a..54217e6 100755
--- a/iconvdata/run-iconv-test.sh
+++ b/iconvdata/run-iconv-test.sh
@@ -31,7 +31,7 @@ temp2=$codir/iconvdata/iconv-test.yyy
 trap "rm -f $temp1 $temp2" 1 2 3 15
 
 # We have to have some directories in the library path.
-LIBPATH=$codir:$codir/iconvdata
+LIBPATH=$codir:$codir/iconvdata:$codir/dlfcn
 
 # How the start the iconv(1) program.
 ICONV='$codir/elf/ld.so --library-path $LIBPATH --inhibit-rpath ${from}.so \
diff --git a/nptl/tst-tls6.sh b/nptl/tst-tls6.sh
index f828008..4aef0d5 100755
--- a/nptl/tst-tls6.sh
+++ b/nptl/tst-tls6.sh
@@ -26,7 +26,7 @@ run_program_env=$1; shift
 logfile=$common_objpfx/nptl/tst-tls6.out
 
 # We have to find libc and nptl
-library_path=${common_objpfx}:${common_objpfx}nptl
+library_path=${common_objpfx}:${common_objpfx}nptl:${common_objpfx}/dlfcn
 tst_tls5="${test_via_rtld_prefix} ${common_objpfx}/nptl/tst-tls5"
 
 > $logfile

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=20cfe4c8c35fd3e59569e8bd10bf2d48a34b654b

commit 20cfe4c8c35fd3e59569e8bd10bf2d48a34b654b
Author: Carlos O'Donell <codonell@redhat.com>
Date:   Tue Jan 8 11:47:12 2013 -0500

    rtld: do not ignore arch-specific CFLAGS
    
    https://bugs.gentoo.org/452184
    http://sourceware.org/bugzilla/show_bug.cgi?id=15005
    http://sourceware.org/ml/libc-alpha/2013-01/msg00247.html

diff --git a/elf/Makefile b/elf/Makefile
index 63a5355..dfcefa9 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -467,7 +467,7 @@ CFLAGS-ldconfig.c = $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
 libof-ldconfig = ldconfig
 CFLAGS-dl-cache.c = $(SYSCONF-FLAGS)
 CFLAGS-cache.c = $(SYSCONF-FLAGS)
-CFLAGS-rtld.c = $(SYSCONF-FLAGS)
+CFLAGS-rtld.c += $(SYSCONF-FLAGS)
 
 cpp-srcs-left := $(all-rtld-routines:=.os)
 lib := rtld

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=cbe36074e46395c3544ec3cfc0c8af4885edd055

commit cbe36074e46395c3544ec3cfc0c8af4885edd055
Author: Carlos O'Donell <carlos@systemhalted.org>
Date:   Fri Aug 16 14:57:59 2013 -0400

    nptl: support thread stacks that grow up
    
    http://bugs.gentoo.org/301642

diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index c044b20..6b42b11 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -372,6 +372,13 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
   if (__glibc_unlikely (attr->flags & ATTR_FLAG_STACKADDR))
     {
       uintptr_t adj;
+      char *stackaddr = (char *) attr->stackaddr;
+
+      /* Assume the same layout as the _STACK_GROWS_DOWN case, with struct
+	 pthread at the top of the stack block.  Later we adjust the guard
+	 location and stack address to match the _STACK_GROWS_UP case.  */
+      if (_STACK_GROWS_UP)
+	stackaddr += attr->stacksize;
 
       /* If the user also specified the size of the stack make sure it
 	 is large enough.  */
@@ -381,11 +388,11 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 
       /* Adjust stack size for alignment of the TLS block.  */
 #if TLS_TCB_AT_TP
-      adj = ((uintptr_t) attr->stackaddr - TLS_TCB_SIZE)
+      adj = ((uintptr_t) stackaddr - TLS_TCB_SIZE)
 	    & __static_tls_align_m1;
       assert (size > adj + TLS_TCB_SIZE);
 #elif TLS_DTV_AT_TP
-      adj = ((uintptr_t) attr->stackaddr - __static_tls_size)
+      adj = ((uintptr_t) stackaddr - __static_tls_size)
 	    & __static_tls_align_m1;
       assert (size > adj);
 #endif
@@ -395,10 +402,10 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 	 the stack.  It is the user's responsibility to do this if it
 	 is wanted.  */
 #if TLS_TCB_AT_TP
-      pd = (struct pthread *) ((uintptr_t) attr->stackaddr
+      pd = (struct pthread *) ((uintptr_t) stackaddr
 			       - TLS_TCB_SIZE - adj);
 #elif TLS_DTV_AT_TP
-      pd = (struct pthread *) (((uintptr_t) attr->stackaddr
+      pd = (struct pthread *) (((uintptr_t) stackaddr
 				- __static_tls_size - adj)
 			       - TLS_PRE_TCB_SIZE);
 #endif
@@ -410,7 +417,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
       pd->specific[0] = pd->specific_1stblock;
 
       /* Remember the stack-related values.  */
-      pd->stackblock = (char *) attr->stackaddr - size;
+      pd->stackblock = (char *) stackaddr - size;
       pd->stackblock_size = size;
 
       /* This is a user-provided stack.  It will not be queued in the
@@ -634,7 +641,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 	  char *guard = mem + (((size - guardsize) / 2) & ~pagesize_m1);
 #elif _STACK_GROWS_DOWN
 	  char *guard = mem;
-# elif _STACK_GROWS_UP
+#elif _STACK_GROWS_UP
 	  char *guard = (char *) (((uintptr_t) pd - guardsize) & ~pagesize_m1);
 #endif
 	  if (mprotect (guard, guardsize, PROT_NONE) != 0)
@@ -734,7 +741,6 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
 # endif
 #else
   *stack = pd->stackblock;
-  assert (*stack > 0);
 #endif
 
   return 0;
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c
index 5216041..a834063 100644
--- a/nptl/pthread_create.c
+++ b/nptl/pthread_create.c
@@ -427,12 +427,25 @@ START_THREAD_DEFN
 #ifdef _STACK_GROWS_DOWN
   char *sp = CURRENT_STACK_FRAME;
   size_t freesize = (sp - (char *) pd->stackblock) & ~pagesize_m1;
-#else
-# error "to do"
-#endif
   assert (freesize < pd->stackblock_size);
   if (freesize > PTHREAD_STACK_MIN)
     __madvise (pd->stackblock, freesize - PTHREAD_STACK_MIN, MADV_DONTNEED);
+#else
+  /* Page aligned start of memory to free (higher than or equal
+     to current sp plus the minimum stack size).  */
+  void *freeblock = (void*)((size_t)(CURRENT_STACK_FRAME
+				     + PTHREAD_STACK_MIN
+				     + pagesize_m1)
+				    & ~pagesize_m1);
+  char *free_end = (char *) (((uintptr_t) pd - pd->guardsize) & ~pagesize_m1);
+  /* Is there any space to free?  */
+  if (free_end > (char *)freeblock)
+    {
+      size_t freesize = (size_t)(free_end - (char *)freeblock);
+      assert (freesize < pd->stackblock_size);
+      __madvise (freeblock, freesize, MADV_DONTNEED);
+    }
+#endif
 
   /* If the thread is detached free the TCB.  */
   if (IS_DETACHED (pd))
diff --git a/nptl/pthread_getattr_np.c b/nptl/pthread_getattr_np.c
index 8207cdc..fb906f0 100644
--- a/nptl/pthread_getattr_np.c
+++ b/nptl/pthread_getattr_np.c
@@ -58,7 +58,11 @@ pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
   if (__glibc_likely (thread->stackblock != NULL))
     {
       iattr->stacksize = thread->stackblock_size;
+#if _STACK_GROWS_DOWN
       iattr->stackaddr = (char *) thread->stackblock + iattr->stacksize;
+#else
+      iattr->stackaddr = (char *) thread->stackblock;
+#endif
     }
   else
     {
@@ -103,7 +107,9 @@ pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
 
 	      char *line = NULL;
 	      size_t linelen = 0;
+#if _STACK_GROWS_DOWN
 	      uintptr_t last_to = 0;
+#endif
 
 	      while (! feof_unlocked (fp))
 		{
@@ -127,17 +133,24 @@ pthread_getattr_np (pthread_t thread_id, pthread_attr_t *attr)
 		         stack extension request.  */
 		      iattr->stacksize = (iattr->stacksize
 					  & -(intptr_t) GLRO(dl_pagesize));
-
+#if _STACK_GROWS_DOWN
 		      /* The limit might be too high.  */
 		      if ((size_t) iattr->stacksize
 			  > (size_t) iattr->stackaddr - last_to)
 			iattr->stacksize = (size_t) iattr->stackaddr - last_to;
-
+#else
+		      /* The limit might be too high.  */
+		      if ((size_t) iattr->stacksize
+			  > to - (size_t) iattr->stackaddr)
+			iattr->stacksize = to - (size_t) iattr->stackaddr;
+#endif
 		      /* We succeed and no need to look further.  */
 		      ret = 0;
 		      break;
 		    }
+#if _STACK_GROWS_DOWN
 		  last_to = to;
+#endif
 		}
 
 	      free (line);

-----------------------------------------------------------------------

Summary of changes:
 Makeconfig                  |    2 +-
 elf/Makefile                |    2 +-
 iconvdata/run-iconv-test.sh |    2 +-
 nptl/allocatestack.c        |   20 +++++++++++++-------
 nptl/pthread_create.c       |   19 ++++++++++++++++---
 nptl/pthread_getattr_np.c   |   17 +++++++++++++++--
 nptl/tst-tls6.sh            |    2 +-
 posix/sys/types.h           |    3 ---
 8 files changed, 48 insertions(+), 19 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]