This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: A Linux/libc 5 patch for egcs 1.1.2
- To: jlarmour at cygnus dot co dot uk (Jonathan Larmour)
- Subject: Re: A Linux/libc 5 patch for egcs 1.1.2
- From: hjl at lucon dot org (H.J. Lu)
- Date: Thu, 25 Feb 1999 13:50:34 -0800 (PST)
- Cc: law at cygnus dot com, egcs at egcs dot cygnus dot com, egcs-patches at egcs dot cygnus dot com
> This isn't the correct syntax shurely? Don't you mean:
>
> void _cleanup () __attribute__ ((weak, alias("_IO_cleanup")));
>
> Assuming I'm right, if egcs doesn't complain about the format syntax, it
> should.
>
I told you it was not tested :-(.
Thanks. Here is the new patch.
H.J.
---
Thu Feb 25 12:17:52 1998 H.J. Lu (hjl@gnu.org)
* config/linuxlibc1.mt (MT_CFLAGS): Add -D_G_STDIO_USES_LIBIO
-D_G_HAVE_WEAK_SYMBOL.
* genops.c: Add the proper weak alias if _G_STDIO_USES_LIBIO
and _G_HAVE_WEAK_SYMBOL are defined.
* iofclose.c: Likewise.
* iofeof.c: Likewise.
* ioferror.c: Likewise.
* iogetc.c: Likewise.
* ioputc.c: Likewise.
* iovsprintf.c: Likewise.
* iovsscanf.c: Likewise.
--- ../../../import/egcs-1.1.x/egcs/libio/config/linuxlibc1.mt Tue Feb 17 12:54:12 1998
+++ config/linuxlibc1.mt Sat Feb 6 15:04:17 1999
@@ -23,4 +23,4 @@ USER_INCLUDES=PlotFile.h SFile.h builtin
streambuf.h strfile.h strstream.h libio.h
# A bad kludge
-MT_CFLAGS=-D_G_HAVE_MMAP
+MT_CFLAGS=-D_G_HAVE_MMAP -D_G_STDIO_USES_LIBIO -D_G_HAVE_WEAK_SYMBOL
--- ../../../import/egcs-1.1.x/egcs/libio/./genops.c Mon Jun 8 02:50:20 1998
+++ ./genops.c Thu Feb 25 13:47:06 1999
@@ -937,6 +937,8 @@ __io_defs io_defs__;
#ifdef weak_alias
weak_alias (_IO_cleanup, _cleanup)
+#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
+void _cleanup () __attribute__ ((weak, alias ("_IO_cleanup")));
#endif
#ifdef text_set_element
--- ../../../import/egcs-1.1.x/egcs/libio/./iofclose.c Thu Oct 16 08:30:23 1997
+++ ./iofclose.c Thu Feb 25 13:47:17 1999
@@ -55,8 +55,6 @@ _IO_fclose (fp)
#ifdef weak_alias
weak_alias (_IO_fclose, fclose)
-#else
-#ifdef __linux__
-#pragma weak fclose = _IO_fclose
-#endif
+#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
+int fclose (_IO_FILE *) __attribute__ ((weak, alias("_IO_fclose")));
#endif
--- ../../../import/egcs-1.1.x/egcs/libio/./iofeof.c Sat Sep 6 00:42:56 1997
+++ ./iofeof.c Thu Feb 25 13:47:26 1999
@@ -40,4 +40,6 @@ _IO_feof (fp)
#ifdef weak_alias
weak_alias (_IO_feof, feof)
+#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
+int feof (_IO_FILE *) __attribute__ ((weak, alias("_IO_feof")));
#endif
--- ../../../import/egcs-1.1.x/egcs/libio/./ioferror.c Sat Sep 6 00:42:57 1997
+++ ./ioferror.c Thu Feb 25 13:47:35 1999
@@ -40,4 +40,6 @@ _IO_ferror (fp)
#ifdef weak_alias
weak_alias (_IO_ferror, ferror)
+#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
+int ferror (_IO_FILE *) __attribute__ ((weak, alias("_IO_ferror")));
#endif
--- ../../../import/egcs-1.1.x/egcs/libio/./iogetc.c Sat Sep 6 00:43:15 1997
+++ ./iogetc.c Thu Feb 25 13:47:42 1999
@@ -45,4 +45,6 @@ _IO_getc (fp)
#ifdef weak_alias
weak_alias (_IO_getc, getc)
+#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
+int getc (_IO_FILE *) __attribute__ ((weak, alias("_IO_getc")));
#endif
--- ../../../import/egcs-1.1.x/egcs/libio/./ioputc.c Sat Sep 6 00:43:25 1997
+++ ./ioputc.c Thu Feb 25 13:47:52 1999
@@ -39,4 +39,6 @@ _IO_putc (c, fp)
#ifdef weak_alias
weak_alias (_IO_putc, putc)
+#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
+int putc (int, _IO_FILE *) __attribute__ ((weak, alias("_IO_putc")));
#endif
--- ../../../import/egcs-1.1.x/egcs/libio/./iovsprintf.c Thu Oct 16 08:30:23 1997
+++ ./iovsprintf.c Thu Feb 25 13:48:03 1999
@@ -54,8 +54,7 @@ _IO_vsprintf (string, format, args)
#ifdef weak_alias
weak_alias (_IO_vsprintf, vsprintf)
-#else
-#ifdef __linux__
-#pragma weak vsprintf = _IO_vsprintf
-#endif
+#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
+int vsprintf (char *, const char *, _IO_va_list)
+ __attribute__ ((weak, alias("_IO_vsprintf")));
#endif
--- ../../../import/egcs-1.1.x/egcs/libio/./iovsscanf.c Wed Oct 22 18:17:55 1997
+++ ./iovsscanf.c Thu Feb 25 13:48:18 1999
@@ -51,8 +51,9 @@ _IO_vsscanf (string, format, args)
#ifdef weak_alias
weak_alias (_IO_vsscanf, __vsscanf)
weak_alias (_IO_vsscanf, vsscanf)
-#else
-#ifdef __linux__
-#pragma weak vsscanf = _IO_vsscanf
-#endif
+#elif defined(_G_STDIO_USES_LIBIO) && defined(_G_HAVE_WEAK_SYMBOL)
+int __vsscanf (const char *, const char *, _IO_va_list)
+ __attribute__ ((weak, alias("_IO_vsscanf")));
+int vsscanf (const char *, const char *, _IO_va_list)
+ __attribute__ ((weak, alias("_IO_vsscanf")));
#endif