From 1510f52e3e34d9ea54d94845199733c9afa1ea16 Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Thu, 16 Oct 1997 09:30:26 -0600 Subject: [PATCH] configure.in: Create compatibility code in bits/libc-lock.h file. * configure.in: Create compatibility code in bits/libc-lock.h file. * libio.h (_IO_LOCK_T): Handle glibc 2 when _IO_MTSAFE_IO is not defined. * filedoalloc.c (_IO_file_doallocate): Don't call _IO_cleanup_registration_needed if __linux__ is defined. * iofclose.c (fclose): Make it weak alias of _IO_fclose if __ELF__ is defined. * iovsprintf.c (vsprintf): Make it weak alias of _IO_vsprintf if __ELF__ is defined. * iovsscanf.c (vsscanf): Make it weak alias of _IO_vsscanf if __ELF__ is defined. * config/linuxlibc1.mt (MT_CFLAGS): Defined as -D_G_HAVE_MMAP. (IO_OBJECTS): Add filedoalloc.o fileops.o genops.o iofclose.o iovsprintf.o iovsscanf.o strops.o. From-SVN: r15931 --- libio/ChangeLog | 25 +++++++++++++++++++++++++ libio/config/linuxlibc1.mt | 7 ++++++- libio/configure.in | 3 +++ libio/filedoalloc.c | 2 +- libio/iofclose.c | 4 ++++ libio/iovsprintf.c | 4 ++++ libio/iovsscanf.c | 4 ++++ 7 files changed, 47 insertions(+), 2 deletions(-) diff --git a/libio/ChangeLog b/libio/ChangeLog index 1c2003fce204..0ee838da096b 100644 --- a/libio/ChangeLog +++ b/libio/ChangeLog @@ -1,3 +1,28 @@ +1997-10-15 Ulrich Drepper + + * configure.in: Create compatibility code in bits/libc-lock.h file. + +Thu Oct 9 07:08:41 1997 H.J. Lu (hjl@gnu.ai.mit.edu) + + * libio.h (_IO_LOCK_T): Handle glibc 2 when _IO_MTSAFE_IO is + not defined. + + * filedoalloc.c (_IO_file_doallocate): Don't call + _IO_cleanup_registration_needed if __linux__ is defined. + + * iofclose.c (fclose): Make it weak alias of _IO_fclose if + __ELF__ is defined. + + * iovsprintf.c (vsprintf): Make it weak alias of _IO_vsprintf + if __ELF__ is defined. + + * iovsscanf.c (vsscanf): Make it weak alias of _IO_vsscanf if + __ELF__ is defined. + + * config/linuxlibc1.mt (MT_CFLAGS): Defined as -D_G_HAVE_MMAP. + (IO_OBJECTS): Add filedoalloc.o fileops.o genops.o iofclose.o + iovsprintf.o iovsscanf.o strops.o. + Fri Oct 3 10:13:13 1997 Jason Merrill * iostream.cc, libio.h: Convert other uses of #ifdef diff --git a/libio/config/linuxlibc1.mt b/libio/config/linuxlibc1.mt index eaed5dabf088..378a9c92ef04 100644 --- a/libio/config/linuxlibc1.mt +++ b/libio/config/linuxlibc1.mt @@ -9,7 +9,9 @@ LIBIO_INCLUDE= # We have those in libc.a. -IO_OBJECTS=iogetc.o ioputc.o iofeof.o ioferror.o +IO_OBJECTS=iogetc.o ioputc.o iofeof.o ioferror.o \ + filedoalloc.o fileops.o genops.o iofclose.o \ + iovsprintf.o iovsscanf.o strops.o STDIO_WRAP_OBJECTS= OSPRIM_OBJECTS= STDIO_OBJECTS= @@ -19,3 +21,6 @@ USER_INCLUDES=PlotFile.h SFile.h builtinbuf.h editbuf.h fstream.h \ indstream.h iomanip.h iostream.h istream.h ostream.h \ parsestream.h pfstream.h procbuf.h stdiostream.h stream.h \ streambuf.h strfile.h strstream.h + +# A bad kludge +MT_CFLAGS=-D_G_HAVE_MMAP diff --git a/libio/configure.in b/libio/configure.in index ac94747f563d..2fc3a962afaa 100644 --- a/libio/configure.in +++ b/libio/configure.in @@ -54,6 +54,9 @@ case "${target}" in rm -fr bits mkdir bits echo "#include " > bits/libc-lock.h + echo 'asm (".weak _pthread_cleanup_pop_restore");' >> bits/libc-lock.h + echo 'asm (".weak _pthread_cleanup_push_defer");' >> bits/libc-lock.h + echo "#include " > bits/stdio-lock.h } ;; diff --git a/libio/filedoalloc.c b/libio/filedoalloc.c index f1b781e8a0fa..5c62280c14bb 100644 --- a/libio/filedoalloc.c +++ b/libio/filedoalloc.c @@ -75,7 +75,7 @@ _IO_file_doallocate (fp) char *p; struct stat st; -#ifndef _LIBC +#if !defined(_LIBC) && !defined(__linux__) /* If _IO_cleanup_registration_needed is non-zero, we should call the function it points to. This is to make sure _IO_cleanup gets called on exit. We call it from _IO_file_doallocate, since that is likely diff --git a/libio/iofclose.c b/libio/iofclose.c index 35f4a8b56916..b6f18e58c2cd 100644 --- a/libio/iofclose.c +++ b/libio/iofclose.c @@ -55,4 +55,8 @@ _IO_fclose (fp) #ifdef weak_alias weak_alias (_IO_fclose, fclose) +#else +#ifdef __linux__ +#pragma weak fclose = _IO_fclose +#endif #endif diff --git a/libio/iovsprintf.c b/libio/iovsprintf.c index 34919588ce10..7b82591974d4 100644 --- a/libio/iovsprintf.c +++ b/libio/iovsprintf.c @@ -54,4 +54,8 @@ _IO_vsprintf (string, format, args) #ifdef weak_alias weak_alias (_IO_vsprintf, vsprintf) +#else +#ifdef __linux__ +#pragma weak vsprintf = _IO_vsprintf +#endif #endif diff --git a/libio/iovsscanf.c b/libio/iovsscanf.c index 21600f53efb2..0db195c8c586 100644 --- a/libio/iovsscanf.c +++ b/libio/iovsscanf.c @@ -51,4 +51,8 @@ _IO_vsscanf (string, format, args) #ifdef weak_alias weak_alias (_IO_vsscanf, __vsscanf) weak_alias (_IO_vsscanf, vsscanf) +#else +#ifdef __ELF__ +#pragma weak vsscanf = _IO_vsscanf +#endif #endif