[Glibc-bsd-commits] r1660 - trunk/glibc-2.3-head

Petr Salinger ps-guest at costa.debian.org
Fri Sep 22 20:21:22 UTC 2006


Author: ps-guest
Date: 2006-09-22 20:21:21 +0000 (Fri, 22 Sep 2006)
New Revision: 1660

Added:
   trunk/glibc-2.3-head/glibc25-gai_misc.h
   trunk/glibc-2.3-head/glibc25-nocancel-sysdeps.diff
Modified:
   trunk/glibc-2.3-head/NOTES
   trunk/glibc-2.3-head/NOTES-2.4
Log:
* prepare for upcoming glibc 2.5 release (Sep 29.)
	http://sourceware.org/ml/libc-hacker/2006-09/msg00038.html



Modified: trunk/glibc-2.3-head/NOTES
===================================================================
--- trunk/glibc-2.3-head/NOTES	2006-09-22 11:00:54 UTC (rev 1659)
+++ trunk/glibc-2.3-head/NOTES	2006-09-22 20:21:21 UTC (rev 1660)
@@ -32,48 +32,11 @@
 ../src/configure --prefix=/opt/tst --enable-add-ons=linuxthreads --with-tls --with-__thread i486-kfreebsd
 
 
-roadmap:
-========
-
-- [DONE] initial sysdeps dir based on glibc-kbsd-2.3/sysdeps/unix/bsd/bsd4.4/kfreebsd/ 
-- [DONE] initial linuxthreads dir based on glibc-2.3/patches/020_linuxthreads.diff
-- [DONE] integrate kfreebsd-sysdeps.dpatch from glibc-2.3.5.diff into sysdeps and linuxthreads dirs
-- [DONE] initial patches dir based on glibc-2.3.5.diff
-- [DONE] integrate remaining parts of kfreebsd-sysdeps.dpatch
-
-- [DONE] make glibc buildable (at this point, it doesn't have to work, only build)
-
-- [DONE] upgrade syscalls.list (from kernel 5.4 or 6.0): 
-- [DONE] port remaining patches from glibc-2.3/patches/
-- [DONE] port remaining patches from web/patches/glibc-2.3.5.diff
-- [DONE] enable TLS
-
-- make glibc functional
-
-- prepare integration into debian glibc package
-
-- prepare amd64 version
-
-
-status:
-=======
-- compile - OK
-- execute (via  /opt/tst/lib/ld-2.3.6.so --library-path /opt/tst/lib $cmd) 
-	OK	/opt/tst/lib/libc-2.3.6.so 
-	OK	/bin/cat /proc/self/maps 
-	OK	/bin/sed --help
-	OK	/bin/grep  ....
-
-- execute (in chroot)
-
-	OK	/bin/bash 
-
-
 problems:
 =========
 
 * thread cancelation
-   cancelable functions are not properly marked in syscalls.list, ...
+   cancelable functions might not be properly marked in syscalls.list, ...
    informal list of such functions is include in linuxthreads/tst-cancel4.c, nptl/tst-cancel4.c
         beware, the test doesn't cover all affected functions
    see also http://h71000.www7.hp.com/doc/73final/6493/6101pro_030.html#unix_thread_cancel
@@ -103,113 +66,4 @@
 make[2]: *** [/build/glibc-2.3-head/build/rt/tst-timer5.o] Error 1
 
 * directly executing dynamic libraries (same problem with 2.3.0 too)
-
-  libraries (as is also dynamic loader) are loaded at base addr 0
-
-  can be examined by
-  /opt/tst/lib/ld-2.3.6.so --library-path /opt/tst/lib /bin/cat/proc/self/maps
-
-
-  due this problem fails bash
- /opt/tst/lib/ld-2.3.6.so --library-path /opt/tst/lib /bin/bash     
-
- bash: xmalloc: ../bash/locale.c:68: cannot allocate 2 bytes (0 bytes allocated)
-
- 14647 ld-2.3.6.so CALL  open(0x80c1ea2,0x6,0)
- 14647 ld-2.3.6.so NAMI  "/dev/tty"
- 14647 ld-2.3.6.so RET   open 3
- 14647 ld-2.3.6.so CALL  close(0x3)
- 14647 ld-2.3.6.so RET   close 0
- 14647 ld-2.3.6.so CALL  __sysctl(0xbfbfe7e8,0x2,0x201601ac,0xbfbfe7f0,0,0)
- 14647 ld-2.3.6.so RET   __sysctl 0
- 14647 ld-2.3.6.so CALL  break(0x20162000)
- 14647 ld-2.3.6.so RET   break -1 errno 12 Cannot allocate memory
-
-
-On Linux:
-
-$ /bin/cat /proc/self/maps 
-08048000-0804c000 r-xp 00000000 21:08 1746245                            /bin/cat
-0804c000-0804d000 rwxp 00003000 21:08 1746245                            /bin/cat
-0804d000-0806e000 rwxp 0804d000 00:00 0                                  [heap]
-55555000-5556b000 r-xp 00000000 21:08 2007380                            /lib/ld-2.3.2.so
-5556b000-5556c000 rwxp 00015000 21:08 2007380                            /lib/ld-2.3.2.so
-5556c000-5556d000 rwxp 5556c000 00:00 0 
-5557b000-556a5000 r-xp 00000000 21:08 2007449                            /lib/tls/i686/cmov/libc-2.3.2.so
-556a5000-556ae000 rwxp 00129000 21:08 2007449                            /lib/tls/i686/cmov/libc-2.3.2.so
-556ae000-556b1000 rwxp 556ae000 00:00 0 
-ffffb000-ffffe000 rw-p ffffb000 00:00 0                                  [stack]
-ffffe000-fffff000 r-xp ffffe000 00:00 0 
-
-$  /lib/ld-2.3.2.so /bin/cat /proc/self/maps 
-08048000-0804c000 r-xp 00000000 21:08 1746245                            /bin/cat
-0804c000-0804d000 rwxp 00003000 21:08 1746245                            /bin/cat
-55555000-55556000 rwxp 55555000 00:00 0 
-55564000-5568e000 r-xp 00000000 21:08 2007449                            /lib/tls/i686/cmov/libc-2.3.2.so
-5568e000-55697000 rwxp 00129000 21:08 2007449                            /lib/tls/i686/cmov/libc-2.3.2.so
-55697000-5569a000 rwxp 55697000 00:00 0 
-56555000-5656b000 r-xp 00000000 21:08 2007380                            /lib/ld-2.3.2.so
-5656b000-5656c000 rwxp 00015000 21:08 2007380                            /lib/ld-2.3.2.so
-5656c000-5658d000 rwxp 5656c000 00:00 0                                  [heap]
-ffffb000-ffffe000 rw-p ffffb000 00:00 0                                  [stack]
-ffffe000-fffff000 r-xp ffffe000 00:00 0 
-
-
-On kFreeBSD:
-
-$ /bin/cat /proc/self/maps
-08048000-0804c000 r-xp 00005000 00:00 94537     /bin/cat
-0804c000-0804d000 rw-p 00003000 00:00 0
-0804d000-0804f000 rwxp 00003000 00:00 0
-2804c000-2805f000 r-xp 00016000 00:00 94584     /lib/ld-2.3.so
-2805f000-28060000 rw-p 00001000 00:00 0
-28060000-28066000 r-xp 00006000 00:00 72476     /etc/ld.so.cache
-28066000-28180000 r-xp 0011f000 00:00 94587     /lib/libc-2.3.so
-28180000-28184000 rwxp 0011f000 00:00 94587     /lib/libc-2.3.so
-28184000-28188000 rwxp 00004000 00:00 0
-bfbe0000-bfc00000 rwxp 00020000 00:00 0
-
-$ /lib/ld-2.3.so /bin/cat /proc/self/maps 
-00000000-00013000 r-xp 00016000 00:00 94584     /lib/ld-2.3.so
-00013000-00014000 rw-p 00001000 00:00 0
-08048000-0804c000 r-xp 00005000 00:00 94537     /bin/cat
-0804c000-0804d000 rwxp 00005000 00:00 94537     /bin/cat
-20013000-20019000 r-xp 00006000 00:00 72476     /etc/ld.so.cache
-20019000-20133000 r-xp 0011f000 00:00 94587     /lib/libc-2.3.so
-20133000-20137000 rwxp 0011f000 00:00 94587     /lib/libc-2.3.so
-20137000-2023b000 rwxp 00104000 00:00 0
-bfbe0000-bfc00000 rwxp 00020000 00:00 0
-
-
-on kFreeBSD, with Linux emulation:
-
-$ /compat/linux/bin/cat /proc/self/maps
-08048000-0804c000 r-xp 00005000 00:00 450090     /usr/compat/linux/bin/cat
-0804c000-0804d000 rw-p 00022000 00:00 0
-0804d000-0806e000 rwxp 00022000 00:00 0
-2804c000-28061000 r-xp 00016000 00:00 899679     /usr/compat/linux/lib/ld-linux.so.2
-28061000-28062000 rw-p 00016000 00:00 899679     /usr/compat/linux/lib/ld-linux.so.2
-28062000-28063000 rw-p 00001000 00:00 0
-28089000-28196000 r-xp 00118000 00:00 450089     /usr/compat/linux/lib/libc.so.6
-28196000-2819d000 r-xp 00118000 00:00 450089     /usr/compat/linux/lib/libc.so.6
-2819d000-281a0000 rwxp 00118000 00:00 450089     /usr/compat/linux/lib/libc.so.6
-281a0000-281a2000 rwxp 00002000 00:00 0
-281a2000-28303000 r-xp 00161000 00:00 1275117     /usr/lib/locale/locale-archive
-bfbe0000-bfc00000 rwxp 00020000 00:00 0
-
-$ /compat/linux/lib/ld-linux.so.2 /compat/linux/bin/cat /proc/self/maps
-00000000-00015000 r-xp 00016000 00:00 899679     /usr/compat/linux/lib/ld-linux.so.2
-00015000-00016000 rw-p 00016000 00:00 899679     /usr/compat/linux/lib/ld-linux.so.2
-00016000-00017000 rw-p 00022000 00:00 0
-00017000-00038000 rwxp 00022000 00:00 0
-08048000-0804c000 r-xp 00005000 00:00 450090     /usr/compat/linux/bin/cat
-0804c000-0804d000 rwxp 00005000 00:00 450090     /usr/compat/linux/bin/cat
-2003b000-20148000 r-xp 00118000 00:00 450089     /usr/compat/linux/lib/libc.so.6
-20148000-2014f000 r-xp 00118000 00:00 450089     /usr/compat/linux/lib/libc.so.6
-2014f000-20152000 rwxp 00118000 00:00 450089     /usr/compat/linux/lib/libc.so.6
-20152000-20154000 rwxp 00002000 00:00 0
-20154000-202b5000 r-xp 00161000 00:00 1275117     /usr/lib/locale/locale-archive
-bfbe0000-bfc00000 rwxp 00020000 00:00 0
-
-As the problem also occurs with the Linux emulation, the problem is
-probably in the kernel.
+  fixed in our kernel 6.1

Modified: trunk/glibc-2.3-head/NOTES-2.4
===================================================================
--- trunk/glibc-2.3-head/NOTES-2.4	2006-09-22 11:00:54 UTC (rev 1659)
+++ trunk/glibc-2.3-head/NOTES-2.4	2006-09-22 20:21:21 UTC (rev 1660)
@@ -18,7 +18,9 @@
 	glibc24-extra-sysdeps.diff
 	glibc24-memusage_no_mremap.diff
 	glibc24-ftw.diff
+	glibc25-nocancel-sysdeps.diff
 	glibc25-queue.h
+	glibc25-gai_misc.h
 
 	
 test build:
@@ -76,11 +78,15 @@
 	i386/sysdep.h - drop definition of SETUP_PIC_REG(reg)
 	dl-osinfo.h - add function _dl_setup_stack_chk_guard()
 
+* add another _not_cancel() functions - by glibc25-nocancel-sysdeps.diff
+
+* add/fix file linuxthreads/sysdeps/pthread/gai_misc.h - by glibc25-gai_misc.h
+
 ../src/configure --enable-add-ons=linuxthreads --with-tls --with-__thread i486-kfreebsd --prefix=...
 
 "make check" results:
 ---------------------
-(as of 2006-06-26)
+(as of 2006-09-18)
 
   requires (and tests) Linux specific O_NOATIME
 make[2]: *** [/build/g24/build/dirent/tst-fdopendir.o] Error 1

Added: trunk/glibc-2.3-head/glibc25-gai_misc.h
===================================================================
--- trunk/glibc-2.3-head/glibc25-gai_misc.h	                        (rev 0)
+++ trunk/glibc-2.3-head/glibc25-gai_misc.h	2006-09-22 20:21:21 UTC (rev 1660)
@@ -0,0 +1,69 @@
+/* Copyright (C) 2006 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, write to the Free
+   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
+
+/* We define a special synchronization primitive for AIO.  POSIX
+   conditional variables would be ideal but the pthread_cond_*wait
+   operations do not return on EINTR.  This is a requirement for
+   correct aio_suspend and lio_listio implementations.  */
+
+#include <assert.h>
+#include <signal.h>
+
+#undef DONT_NEED_GAI_MISC_COND
+
+#define gai_start_notify_thread __gai_start_notify_thread
+#define gai_create_helper_thread __gai_create_helper_thread
+
+extern inline void
+__gai_start_notify_thread (void)
+{
+  sigset_t ss;
+  sigemptyset (&ss);
+  __sigprocmask(SIG_SETMASK, &ss, NULL);
+}
+
+extern inline int
+__gai_create_helper_thread (pthread_t *threadp, void *(*tf) (void *),
+			    void *arg)
+{
+  pthread_attr_t attr;
+
+  /* Make sure the thread is created detached.  */
+  pthread_attr_init (&attr);
+  pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
+
+  /* The helper thread needs only very little resources.  */
+  (void) pthread_attr_setstacksize (&attr, PTHREAD_STACK_MIN);
+
+  /* Block all signals in the helper thread.  To do this thoroughly we
+     temporarily have to block all signals here.  */
+  sigset_t ss;
+  sigset_t oss;
+  sigfillset (&ss);
+  __sigprocmask(SIG_SETMASK, &ss, &oss);
+
+  int ret = pthread_create (threadp, &attr, tf, arg);
+
+  /* Restore the signal mask.  */
+  __sigprocmask(SIG_SETMASK, &oss, NULL);
+
+  (void) pthread_attr_destroy (&attr);
+  return ret;
+}
+
+#include_next <gai_misc.h>

Added: trunk/glibc-2.3-head/glibc25-nocancel-sysdeps.diff
===================================================================
--- trunk/glibc-2.3-head/glibc25-nocancel-sysdeps.diff	                        (rev 0)
+++ trunk/glibc-2.3-head/glibc25-nocancel-sysdeps.diff	2006-09-22 20:21:21 UTC (rev 1660)
@@ -0,0 +1,70 @@
+Index: linuxthreads/kfreebsd/pt-sigsuspend.S
+===================================================================
+--- linuxthreads/kfreebsd/pt-sigsuspend.S	(revision 1659)
++++ linuxthreads/kfreebsd/pt-sigsuspend.S	(working copy)
+@@ -23,3 +23,7 @@
+ PSEUDO_NOERRNO(__pthread_sigsuspend, sigsuspend, 1)
+ 	ret_NOERRNO
+ PSEUDO_END_NOERRNO(__pthread_sigsuspend)
++
++PSEUDO(__syscall_sigsuspend, sigsuspend, 1)
++	ret
++PSEUDO_END(__syscall_sigsuspend)
+Index: sysdeps/kfreebsd/not-cancel.h
+===================================================================
+--- sysdeps/kfreebsd/not-cancel.h	(revision 1659)
++++ sysdeps/kfreebsd/not-cancel.h	(working copy)
+@@ -74,3 +74,15 @@
+ /* Uncancelable waitpid.  */
+ # define waitpid_not_cancel(pid, stat_loc, options) \
+   INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL)
++
++/* Uncancelable pause.  */
++# define pause_not_cancel() \
++  __pause_nocancel ()
++
++/* Uncancelable nanosleep.  */
++# define nanosleep_not_cancel(requested_time, remaining) \
++  INLINE_SYSCALL (nanosleep, 2, requested_time, remaining)
++
++/* Uncancelable sigsuspend.  */
++#define sigsuspend_not_cancel(set) \
++  INLINE_SYSCALL (sigsuspend, 1, set)
+Index: sysdeps/kfreebsd/syscalls-inline.h
+===================================================================
+--- sysdeps/kfreebsd/syscalls-inline.h	(revision 1659)
++++ sysdeps/kfreebsd/syscalls-inline.h	(working copy)
+@@ -21,9 +21,12 @@
+ #define KFREEBSD_INLINE_SYSCALLS_H
+ 
+ #include <sys/types.h>
++#define __need_sigset_t
++#include <signal.h>
+ 
+ struct iovec;
+ struct rusage;
++struct timespec;
+ 
+ int __syscall_open(const char *path, int flags, ...);
+ int __syscall_close(int fd);
+@@ -35,5 +38,7 @@
+ int __syscall_fcntl(int fd, int cmd, ...);
+ int __syscall_fork(void);
+ int __syscall_wait4(int pid, int *status, int options, struct rusage *rusage);
++int __syscall_sigsuspend (const sigset_t *set);
++int __syscall_nanosleep (const struct timespec *requested_time, struct timespec *remaining);
+ 
+ #endif
+Index: sysdeps/kfreebsd/syscalls.list
+===================================================================
+--- sysdeps/kfreebsd/syscalls.list	(revision 1659)
++++ sysdeps/kfreebsd/syscalls.list	(working copy)
+@@ -144,6 +144,8 @@
+ sys_connect	-       connect	                i:ipi	__syscall_connect
+ sys_bind        -       bind                    i:ipi   __syscall_bind
+ sys_sendto      -       sendto          	i:ibnibn __syscall_sendto
++sys_nanosleep	EXTRA	nanosleep		i:pp	__syscall_nanosleep
++sys_sigsuspend	EXTRA	sigsuspend		i:p	__syscall_sigsuspend
+ swapcontext	-	swapcontext		i:pp	__swapcontext	swapcontext
+ swapon		-	swapon			i:s	swapon
+ swapoff		-	swapoff			i:s	swapoff




More information about the Glibc-bsd-commits mailing list