diff --git a/gnu/dist/libio/config/linuxlibc1.mt b/gnu/dist/libio/config/linuxlibc1.mt index 90fa427225e3..742cbf185342 100644 --- a/gnu/dist/libio/config/linuxlibc1.mt +++ b/gnu/dist/libio/config/linuxlibc1.mt @@ -23,4 +23,4 @@ USER_INCLUDES=PlotFile.h SFile.h builtinbuf.h editbuf.h fstream.h \ 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 diff --git a/gnu/dist/libio/genops.c b/gnu/dist/libio/genops.c index cbd8f0f1ea22..b899e150afab 100644 --- a/gnu/dist/libio/genops.c +++ b/gnu/dist/libio/genops.c @@ -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 diff --git a/gnu/dist/libio/iofclose.c b/gnu/dist/libio/iofclose.c index b6f18e58c2cd..7db336c5d539 100644 --- a/gnu/dist/libio/iofclose.c +++ b/gnu/dist/libio/iofclose.c @@ -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 diff --git a/gnu/dist/libio/iofeof.c b/gnu/dist/libio/iofeof.c index d06de044fba5..7bf8cba285be 100644 --- a/gnu/dist/libio/iofeof.c +++ b/gnu/dist/libio/iofeof.c @@ -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 diff --git a/gnu/dist/libio/ioferror.c b/gnu/dist/libio/ioferror.c index 855627ade66d..3019e796a1f6 100644 --- a/gnu/dist/libio/ioferror.c +++ b/gnu/dist/libio/ioferror.c @@ -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 diff --git a/gnu/dist/libio/iogetc.c b/gnu/dist/libio/iogetc.c index f7465f1914b1..6a11e47334dc 100644 --- a/gnu/dist/libio/iogetc.c +++ b/gnu/dist/libio/iogetc.c @@ -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 diff --git a/gnu/dist/libio/ioputc.c b/gnu/dist/libio/ioputc.c index 3c35c365f07a..38a3ec9a00b7 100644 --- a/gnu/dist/libio/ioputc.c +++ b/gnu/dist/libio/ioputc.c @@ -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 diff --git a/gnu/dist/libio/iovsprintf.c b/gnu/dist/libio/iovsprintf.c index 7b82591974d4..617a5888405d 100644 --- a/gnu/dist/libio/iovsprintf.c +++ b/gnu/dist/libio/iovsprintf.c @@ -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 diff --git a/gnu/dist/libio/iovsscanf.c b/gnu/dist/libio/iovsscanf.c index beb0bc3a6b22..6bdc3ccf0182 100644 --- a/gnu/dist/libio/iovsscanf.c +++ b/gnu/dist/libio/iovsscanf.c @@ -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