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 roland/libio-mtsafe created. glibc-2.16-ports-merge-210-ge37e4f3


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/libio-mtsafe has been created
        at  e37e4f3793c7936122c119eec5bf75596fcfd07c (commit)

- Log -----------------------------------------------------------------
http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e37e4f3793c7936122c119eec5bf75596fcfd07c

commit e37e4f3793c7936122c119eec5bf75596fcfd07c
Author: Roland McGrath <roland@hack.frob.com>
Date:   Thu Aug 16 09:59:49 2012 -0700

    Make libio compile without _IO_MTSAFE_IO.

diff --git a/ChangeLog b/ChangeLog
index 6f5ccbe..77a2640 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2012-08-16  Roland McGrath  <roland@hack.frob.com>
 
+	* libio/genops.c (_IO_unbuffer_write): Conditionalize locking code on
+	[_IO_MTSAFE_IO].
+	* libio/libioP.h [!_IO_MTSAFE_IO && !NOT_IN_libc]
+	(_IO_acquire_lock, _IO_acquire_lock_clear_flags2, _IO_release_lock):
+	New macros.
+
 	* Makeconfig [$(libc-reentrant) = yes] (libio-mtsafe): New variable.
 	* libio/Makefile (CPPFLAGS): Append $(libio-mtsafe) unconditionally
 	rather than -D_IO_MTSAFE_IO conditionally.
diff --git a/libio/genops.c b/libio/genops.c
index c8297ff..0a81a5d 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -952,6 +952,7 @@ _IO_unbuffer_write (void)
 	  /* Iff stream is un-orientated, it wasn't used. */
 	  && fp->_mode != 0)
 	{
+#ifdef _IO_MTSAFE_IO
 	  int cnt;
 #define MAXTRIES 2
 	  for (cnt = 0; cnt < MAXTRIES; ++cnt)
@@ -961,6 +962,7 @@ _IO_unbuffer_write (void)
 	      /* Give the other thread time to finish up its use of the
 		 stream.  */
 	      __sched_yield ();
+#endif
 
 	  if (! dealloc_buffers && !(fp->_flags & _IO_USER_BUF))
 	    {
@@ -974,8 +976,10 @@ _IO_unbuffer_write (void)
 
 	  _IO_SETBUF (fp, NULL, 0);
 
+#ifdef _IO_MTSAFE_IO
 	  if (cnt < MAXTRIES && fp->_lock != NULL)
 	    _IO_lock_unlock (*fp->_lock);
+#endif
 	}
 
       /* Make sure that never again the wide char functions can be
diff --git a/libio/libioP.h b/libio/libioP.h
index 486c670..aa2b3bf 100644
--- a/libio/libioP.h
+++ b/libio/libioP.h
@@ -933,3 +933,17 @@ _IO_acquire_lock_clear_flags2_fct (_IO_FILE **p)
   if ((fp->_flags & _IO_USER_LOCK) == 0)
     _IO_funlockfile (fp);
 }
+
+#if !defined _IO_MTSAFE_IO && !defined NOT_IN_libc
+# define _IO_acquire_lock(_fp)						      \
+  do {									      \
+    _IO_FILE *_IO_acquire_lock_file = NULL
+# define _IO_acquire_lock_clear_flags2(_fp)				      \
+  do {									      \
+    _IO_FILE *_IO_acquire_lock_file = (_fp)
+# define _IO_release_lock(_fp)						      \
+    if (_IO_acquire_lock_file != NULL)					      \
+      _IO_acquire_lock_file->_flags2 &= ~(_IO_FLAGS2_FORTIFY		      \
+                                          | _IO_FLAGS2_SCANF_STD);	      \
+  } while (0)
+#endif
diff --git a/misc/Makefile b/misc/Makefile
index d1c0a02..d35654c 100644
--- a/misc/Makefile
+++ b/misc/Makefile
@@ -95,7 +95,6 @@ CFLAGS-getsysstats.c = -fexceptions
 CFLAGS-getusershell.c = -fexceptions
 CFLAGS-err.c = -fexceptions
 CFLAGS-tst-tsearch.c = $(stack-align-test-flags)
-CFLAGS-mntent_r.c = -D_IO_MTSAFE_IO
 
 include ../Rules
 
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 8a8cbb8..eb84863 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,8 +1,13 @@
 2012-08-15  Roland McGrath  <roland@hack.frob.com>
 
+2012-08-15  Roland McGrath  <roland@hack.frob.com>
+
+2012-08-15  Roland McGrath  <roland@hack.frob.com>
+
 	* Makefile (CFLAGS-flockfile.c): Use $(libio-mtsafe) instead
 	of -D_IO_MTSAFE_IO.
 	(CFLAGS-ftrylockfile.c, CFLAGS-funlockfile.c): Likewise.
+	* sysdeps/unix/sysv/linux/Makefile (CFLAGS-fork.c): Likewise.
 
 2012-08-16  Joseph Myers  <joseph@codesourcery.com>
 
diff --git a/nptl/sysdeps/unix/sysv/linux/Makefile b/nptl/sysdeps/unix/sysv/linux/Makefile
index 64a3f4f..d24a9bc 100644
--- a/nptl/sysdeps/unix/sysv/linux/Makefile
+++ b/nptl/sysdeps/unix/sysv/linux/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc.
+# Copyright (C) 2002-2012 Free Software Foundation, Inc.
 # This file is part of the GNU C Library.
 # Contributed by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -29,7 +29,7 @@ gen-as-const-headers += lowlevelcond.sym lowlevelrwlock.sym \
 endif
 
 ifeq ($(subdir),posix)
-CFLAGS-fork.c = -D_IO_MTSAFE_IO
+CFLAGS-fork.c = $(libio-mtsafe)
 CFLAGS-getpid.o = -fomit-frame-pointer
 CFLAGS-getpid.os = -fomit-frame-pointer
 endif

http://sources.redhat.com/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e0b2478e4e2720c68ec784ba1198ddd7c44a364f

commit e0b2478e4e2720c68ec784ba1198ddd7c44a364f
Author: Roland McGrath <roland@hack.frob.com>
Date:   Thu Aug 16 10:00:11 2012 -0700

    Clean up definition of _LIBC_REENTRANT and _IO_MTSAFE_IO.

diff --git a/ChangeLog b/ChangeLog
index b844d51..6f5ccbe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,43 @@
+2012-08-16  Roland McGrath  <roland@hack.frob.com>
+
+	* Makeconfig [$(libc-reentrant) = yes] (libio-mtsafe): New variable.
+	* libio/Makefile (CPPFLAGS): Append $(libio-mtsafe) unconditionally
+	rather than -D_IO_MTSAFE_IO conditionally.
+	* stdio-common/Makefile (CPPFLAGS): Likewise.
+	* wcsmbs/Makefile (CPPFLAGS): Likewise.
+	* stdlib/Makefile (CFLAGS-strfmon.c, CFLAGS-strfmon_l.c):
+	Use $(libio-mtsafe).
+	* debug/Makefile (CFLAGS-sprintf_chk.c): Use $(libio-mtsafe) instead
+	of -D_IO_MTSAFE_IO.
+	(CFLAGS-snprintf_chk.c, CFLAGS-vsprintf_chk.c): Likewise.
+	(CFLAGS-vsnprintf_chk.c, CFLAGS-asprintf_chk.c): Likewise.
+	(CFLAGS-vasprintf_chk.c, CFLAGS-obprintf_chk.c): Likewise.
+	(CFLAGS-dprintf_chk.c, CFLAGS-vdprintf_chk.c): Likewise.
+	(CFLAGS-printf_chk.c, CFLAGS-fprintf_chk.c): Likewise.
+	(CFLAGS-vprintf_chk.c, CFLAGS-vfprintf_chk.c): Likewise.
+	(CFLAGS-gets_chk.c, CFLAGS-fgets_chk.c): Likewise.
+	(CFLAGS-fgets_u_chk.c, CFLAGS-fread_chk.c): Likewise.
+	(CFLAGS-fread_u_chk.c): Likewise.
+	(CFLAGS-swprintf_chk.c, CFLAGS-vswprintf_chk.c): Likewise.
+	(CFLAGS-wprintf_chk.c, CFLAGS-fwprintf_chk.c): Likewise.
+	(CFLAGS-vwprintf_chk.c, CFLAGS-vfwprintf_chk.c): Likewise.
+	(CFLAGS-fgetws_chk.c, CFLAGS-fgetws_u_chk.c): Likewise.
+	* grp/Makefile (CFLAGS-fgetgrent_r.c, CFLAGS-putgrent.c): Likewise.
+	* gshadow/Makefile (CFLAGS-fgetsgent_r.c, CFLAGS-putsgent.c): Likewise.
+	* misc/Makefile (CFLAGS-mntent_r.c): Likewise.
+	* pwd/Makefile (CFLAGS-fgetpwent_r.c): Likewise.
+	* shadow/Makefile (CFLAGS-fgetspent_r.c, CFLAGS-putspent.c): Likewise.
+
+	* libio/Makefile: Test [$(libc-reentrant) = yes]
+	instead of [$(filter %REENTRANT, $(defines)) nonempty].
+
+	* Makeconfig
+	[$(libc-reentrant) = yes] (defines): Append -D_LIBC_REENTRANT.
+	* sysdeps/pthread/configure: File removed.
+	* sysdeps/pthread/Makeconfig: New file.
+	* sysdeps/mach/hurd/Makeconfig (libc-reentrant): New variable.
+	* sysdeps/mach/hurd/configure.in: Don't touch DEFINES here.
+
 2012-08-16  Joseph Myers  <joseph@codesourcery.com>
 
 	* stdlib/longlong.h: Update from GCC.
diff --git a/Makeconfig b/Makeconfig
index 10df8ee..57f35f9 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -1005,6 +1005,13 @@ endif
 sysd-rules-targets := $(sort $(foreach p,$(sysd-rules-patterns),\
 					 $(firstword $(subst :, ,$p))))
 
+# A sysdeps Makeconfig fragment may set libc-reentrant to yes.
+ifeq (yes,$(libc-reentrant))
+defines += -D_LIBC_REENTRANT
+
+libio-mtsafe = -D_IO_MTSAFE_IO
+endif
+
 endif # Makeconfig not yet included
 
 # Local Variables:
diff --git a/debug/Makefile b/debug/Makefile
index 4c01a66..f4e38b4 100644
--- a/debug/Makefile
+++ b/debug/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2001,2004-2008, 2009, 2011, 2012 Free Software Foundation, Inc.
+# Copyright (C) 1998-2012 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
@@ -48,32 +48,32 @@ routines  = backtrace backtracesyms backtracesymsfd noophooks \
 static-only-routines := warning-nop stack_chk_fail_local
 
 CFLAGS-backtrace.c = -fno-omit-frame-pointer
-CFLAGS-sprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-snprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-vsprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-vsnprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-asprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-vasprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-obprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-dprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-vdprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-printf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-vprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-vfprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-gets_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fgets_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fgets_u_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fread_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fread_u_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-swprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-vswprintf_chk.c = -D_IO_MTSAFE_IO
-CFLAGS-wprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fwprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-vwprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-vfwprintf_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fgetws_chk.c = -D_IO_MTSAFE_IO $(exceptions)
-CFLAGS-fgetws_u_chk.c = -D_IO_MTSAFE_IO $(exceptions)
+CFLAGS-sprintf_chk.c = $(libio-mtsafe)
+CFLAGS-snprintf_chk.c = $(libio-mtsafe)
+CFLAGS-vsprintf_chk.c = $(libio-mtsafe)
+CFLAGS-vsnprintf_chk.c = $(libio-mtsafe)
+CFLAGS-asprintf_chk.c = $(libio-mtsafe)
+CFLAGS-vasprintf_chk.c = $(libio-mtsafe)
+CFLAGS-obprintf_chk.c = $(libio-mtsafe)
+CFLAGS-dprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-vdprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-printf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-vprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-vfprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-gets_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fgets_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fgets_u_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fread_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fread_u_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-swprintf_chk.c = $(libio-mtsafe)
+CFLAGS-vswprintf_chk.c = $(libio-mtsafe)
+CFLAGS-wprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fwprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-vwprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-vfwprintf_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fgetws_chk.c = $(libio-mtsafe) $(exceptions)
+CFLAGS-fgetws_u_chk.c = $(libio-mtsafe) $(exceptions)
 CFLAGS-read_chk.c = -fexceptions -fasynchronous-unwind-tables
 CFLAGS-pread_chk.c = -fexceptions -fasynchronous-unwind-tables
 CFLAGS-pread64_chk.c = -fexceptions -fasynchronous-unwind-tables
diff --git a/grp/Makefile b/grp/Makefile
index 127310f..384faa0 100644
--- a/grp/Makefile
+++ b/grp/Makefile
@@ -1,5 +1,4 @@
-# Copyright (C) 1991,1992,1996-2000,2003,2004,2012
-# Free Software Foundation, Inc.
+# Copyright (C) 1991-2012 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
@@ -44,8 +43,8 @@ CFLAGS-getgrnam_r.c = -DUSE_NSCD=1 -fexceptions
 CFLAGS-getgrent_r.c = -fexceptions
 CFLAGS-getgrent.c = -fexceptions
 CFLAGS-fgetgrent.c = -fexceptions
-CFLAGS-fgetgrent_r.c = -fexceptions -D_IO_MTSAFE_IO
-CFLAGS-putgrent.c = -fexceptions -D_IO_MTSAFE_IO
+CFLAGS-fgetgrent_r.c = -fexceptions $(libio-mtsafe)
+CFLAGS-putgrent.c = -fexceptions $(libio-mtsafe)
 CFLAGS-initgroups.c = -DUSE_NSCD=1 -fexceptions
 CFLAGS-getgrgid.c = -fexceptions
 
diff --git a/gshadow/Makefile b/gshadow/Makefile
index a482c5d..2cb714f 100644
--- a/gshadow/Makefile
+++ b/gshadow/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 2009 Free Software Foundation, Inc.
+# Copyright (C) 2009-2012 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
@@ -29,8 +29,8 @@ tests = tst-gshadow
 CFLAGS-getsgent_r.c = -fexceptions
 CFLAGS-getsgent.c = -fexceptions
 CFLAGS-fgetsgent.c = -fexceptions
-CFLAGS-fgetsgent_r.c = -fexceptions -D_IO_MTSAFE_IO
-CFLAGS-putsgent.c = -fexceptions -D_IO_MTSAFE_IO
+CFLAGS-fgetsgent_r.c = -fexceptions $(libio-mtsafe)
+CFLAGS-putsgent.c = -fexceptions $(libio-mtsafe)
 CFLAGS-getsgnam.c = -fexceptions
 CFLAGS-getsgnam_r.c = -fexceptions
 
diff --git a/libio/Makefile b/libio/Makefile
index 02efe1b..c555dd0 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -70,14 +70,14 @@ routines += oldiofopen oldiofdopen oldiofclose oldiopopen oldpclose \
 	    oldiofsetpos64
 endif
 
-ifneq (,$(filter %REENTRANT, $(defines)))
+ifeq (yes,$(libc-reentrant))
 routines += clearerr_u feof_u ferror_u fputc_u getc_u getchar_u		      \
 	    iofflush_u putc_u putchar_u peekc iofread_u iofwrite_u iofgets_u  \
 	    iofputs_u
-
-CPPFLAGS += -D_IO_MTSAFE_IO
 endif
 
+CPPFLAGS += $(libio-mtsafe)
+
 # Support for exception handling.
 CFLAGS-fileops.c = $(exceptions)
 CFLAGS-fputc.c = $(exceptions)
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 6f55272..8a8cbb8 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,9 @@
+2012-08-15  Roland McGrath  <roland@hack.frob.com>
+
+	* Makefile (CFLAGS-flockfile.c): Use $(libio-mtsafe) instead
+	of -D_IO_MTSAFE_IO.
+	(CFLAGS-ftrylockfile.c, CFLAGS-funlockfile.c): Likewise.
+
 2012-08-16  Joseph Myers  <joseph@codesourcery.com>
 
 	* pthread_cond_timedwait.c (__pthread_cond_timedwait)
diff --git a/nptl/Makefile b/nptl/Makefile
index ef8e874..8cd168d 100644
--- a/nptl/Makefile
+++ b/nptl/Makefile
@@ -341,9 +341,9 @@ extra-objs += $(crti-objs) $(crtn-objs)
 extra-objs += pt-crti.o
 endif
 
-CFLAGS-flockfile.c = -D_IO_MTSAFE_IO
-CFLAGS-ftrylockfile.c = -D_IO_MTSAFE_IO
-CFLAGS-funlockfile.c = -D_IO_MTSAFE_IO
+CFLAGS-flockfile.c = $(libio-mtsafe)
+CFLAGS-ftrylockfile.c = $(libio-mtsafe)
+CFLAGS-funlockfile.c = $(libio-mtsafe)
 
 link-libc-static := $(common-objpfx)libc.a $(static-gnulib) \
 		    $(common-objpfx)libc.a
diff --git a/pwd/Makefile b/pwd/Makefile
index 1da4059..52a917f 100644
--- a/pwd/Makefile
+++ b/pwd/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1991,1996-1999,2003,2004 Free Software Foundation, Inc.
+# Copyright (C) 1991-2012 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
@@ -36,6 +36,6 @@ CFLAGS-getpwnam_r.c = -DUSE_NSCD=1
 CFLAGS-getpwent_r.c = -fexceptions
 CFLAGS-getpwent.c = -fexceptions
 CFLAGS-getpw.c = -fexceptions
-CFLAGS-fgetpwent_r.c = -D_IO_MTSAFE_IO
+CFLAGS-fgetpwent_r.c = $(libio-mtsafe)
 
 endif
diff --git a/shadow/Makefile b/shadow/Makefile
index 7c17a7f..4b17b29 100644
--- a/shadow/Makefile
+++ b/shadow/Makefile
@@ -1,4 +1,4 @@
-# Copyright (C) 1996, 2003, 2004, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2012 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
@@ -30,8 +30,8 @@ tests = tst-shadow
 CFLAGS-getspent_r.c = -fexceptions
 CFLAGS-getspent.c = -fexceptions
 CFLAGS-fgetspent.c = -fexceptions
-CFLAGS-fgetspent_r.c = -fexceptions -D_IO_MTSAFE_IO
-CFLAGS-putspent.c = -fexceptions -D_IO_MTSAFE_IO
+CFLAGS-fgetspent_r.c = -fexceptions $(libio-mtsafe)
+CFLAGS-putspent.c = -fexceptions $(libio-mtsafe)
 CFLAGS-getspnam.c = -fexceptions
 CFLAGS-getspnam_r.c = -fexceptions
 
diff --git a/stdio-common/Makefile b/stdio-common/Makefile
index a29924b..5d7ab53 100644
--- a/stdio-common/Makefile
+++ b/stdio-common/Makefile
@@ -123,9 +123,7 @@ scanf13-ENV = LOCPATH=$(common-objpfx)localedata
 bug14-ENV = LOCPATH=$(common-objpfx)localedata
 tst-grouping-ENV = LOCPATH=$(common-objpfx)localedata
 
-ifneq (,$(filter %REENTRANT, $(defines)))
-CPPFLAGS += -D_IO_MTSAFE_IO
-endif
+CPPFLAGS += $(libio-mtsafe)
 
 $(objpfx)tst-setvbuf1.out: tst-setvbuf1.expect $(objpfx)tst-setvbuf1
 	$(built-program-cmd) > $@ 2>&1
diff --git a/stdio-common/isoc99_scanf.c b/stdio-common/isoc99_scanf.c
index 2e04e70..2bd1e51 100644
--- a/stdio-common/isoc99_scanf.c
+++ b/stdio-common/isoc99_scanf.c
@@ -28,13 +28,17 @@ __isoc99_scanf (const char *format, ...)
   va_list arg;
   int done;
 
+#ifdef _IO_MTSAFE_IO
   _IO_acquire_lock_clear_flags2 (stdin);
+#endif
   stdin->_flags2 |= _IO_FLAGS2_SCANF_STD;
 
   va_start (arg, format);
   done = _IO_vfscanf (stdin, format, arg, NULL);
   va_end (arg);
 
+#ifdef _IO_MTSAFE_IO
   _IO_release_lock (stdin);
+#endif
   return done;
 }
diff --git a/stdlib/Makefile b/stdlib/Makefile
index 10674f2..39cab17 100644
--- a/stdlib/Makefile
+++ b/stdlib/Makefile
@@ -100,10 +100,8 @@ CFLAGS-system.c = -fexceptions
 CFLAGS-system.os = -fomit-frame-pointer
 CFLAGS-fmtmsg.c = -fexceptions
 
-ifneq (,$(filter %REENTRANT, $(defines)))
-CFLAGS-strfmon.c = -D_IO_MTSAFE_IO
-CFLAGS-strfmon_l.c = -D_IO_MTSAFE_IO
-endif
+CFLAGS-strfmon.c = $(libio-mtsafe)
+CFLAGS-strfmon_l.c = $(libio-mtsafe)
 
 CFLAGS-tst-bsearch.c = $(stack-align-test-flags)
 CFLAGS-tst-qsort.c = $(stack-align-test-flags)
diff --git a/sysdeps/mach/hurd/Makeconfig b/sysdeps/mach/hurd/Makeconfig
index 1b65bb0..fe3b7c5 100644
--- a/sysdeps/mach/hurd/Makeconfig
+++ b/sysdeps/mach/hurd/Makeconfig
@@ -2,3 +2,6 @@
 # See Makefile in this directory for the rule that builds this.
 # We must define this variable earlier than sysdeps Makefiles are included.
 static-start-installed-name = crt0.o
+
+# GNU libc on the Hurd is always reentrant.
+libc-reentrant = yes
diff --git a/sysdeps/mach/hurd/configure.in b/sysdeps/mach/hurd/configure.in
index 6220142..ad915a5 100644
--- a/sysdeps/mach/hurd/configure.in
+++ b/sysdeps/mach/hurd/configure.in
@@ -1,8 +1,5 @@
 GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
 
-# GNU libc on the Hurd is always reentrant.
-DEFINES="$DEFINES -D_LIBC_REENTRANT"
-
 dnl We need this setting because of the need for PLT calls in ld.so.
 AC_DEFINE([NO_HIDDEN])
 
diff --git a/sysdeps/pthread/Makeconfig b/sysdeps/pthread/Makeconfig
new file mode 100644
index 0000000..2b564ea
--- /dev/null
+++ b/sysdeps/pthread/Makeconfig
@@ -0,0 +1,2 @@
+# Compile libc code to do internal locking.
+libc-reentrant = yes
diff --git a/sysdeps/pthread/configure b/sysdeps/pthread/configure
deleted file mode 100644
index e39d311..0000000
--- a/sysdeps/pthread/configure
+++ /dev/null
@@ -1,3 +0,0 @@
-# Local configure fragment for sysdeps/pthread.
-
-DEFINES="$DEFINES -D_LIBC_REENTRANT"
diff --git a/wcsmbs/Makefile b/wcsmbs/Makefile
index 983fd76..7402ec9 100644
--- a/wcsmbs/Makefile
+++ b/wcsmbs/Makefile
@@ -72,9 +72,8 @@ CFLAGS-isoc99_wscanf.c += $(exceptions)
 CFLAGS-isoc99_fwscanf.c += $(exceptions)
 CFLAGS-isoc99_vwscanf.c += $(exceptions)
 CFLAGS-isoc99_vfwscanf.c += $(exceptions)
-ifneq (,$(filter %REENTRANT, $(defines)))
-CPPFLAGS += -D_IO_MTSAFE_IO
-endif
+
+CPPFLAGS += $(libio-mtsafe)
 
 # We need to find the default version of strtold_l in stdlib.
 CPPFLAGS-wcstold_l.c = -I../stdlib

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


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]