* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@15931
138bc75d-0d04-0410-961f-
82ee72b054a4
+1997-10-15 Ulrich Drepper <drepper@cygnus.com>
+
+ * 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 <jason@yorick.cygnus.com>
* iostream.cc, libio.h: Convert other uses of #ifdef
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=
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
rm -fr bits
mkdir bits
echo "#include <libc-lock.h>" > 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 <stdio-lock.h>" > bits/stdio-lock.h
}
;;
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
#ifdef weak_alias
weak_alias (_IO_fclose, fclose)
+#else
+#ifdef __linux__
+#pragma weak fclose = _IO_fclose
+#endif
#endif
#ifdef weak_alias
weak_alias (_IO_vsprintf, vsprintf)
+#else
+#ifdef __linux__
+#pragma weak vsprintf = _IO_vsprintf
+#endif
#endif
#ifdef weak_alias
weak_alias (_IO_vsscanf, __vsscanf)
weak_alias (_IO_vsscanf, vsscanf)
+#else
+#ifdef __ELF__
+#pragma weak vsscanf = _IO_vsscanf
+#endif
#endif