This is the mail archive of the libc-alpha@cygnus.com 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]

Patch to compile libstdc++ 2.8.1.1 with gcc 2.8.1 under glibc 2.1/2.0.95+



I'm appending a patch which I've also put on alpha:
ftp://alpha.gnu.org/gnu/libstdc++-2.8.1.1-glibc2.1-diff.gz

The patch is necessary for building with glibc 2.1 (which is not
available yet) and it's prereleases (2.0.99 is the current one).

Andreas

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This patch against libstdc++-2.8.1.1 allows libstdc++-2.8.1.1 to be
compiled by gcc 2.8.1 with glibc 2.1 and it's prereleases (glibc
2.0.95+).  All patches come from the libstdc++ part of egcs.

Andreas Jaeger <aj@arthur.rhein-neckar.de>

For config/ChangeLog:
Mon Aug 10 00:15:47 1998  HJ Lu (hjl@gnu.org)

       * mt-linux (CXXFLAGS_FOR_TARGET): Add -D_GNU_SOURCE.

Wed Apr 22 10:53:14 1998  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

       * mt-linux (CXXFLAGS_FOR_TARGET): Set this instead of CXXFLAGS.


For libio/ChangeLog:
1998-08-17  Ulrich Drepper  <drepper@cygnus.com>

        * strfile.h: Define __PMT if not already defined.

1998-08-03  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

        * libioP.h: Use __PMT in typedefs.
        * strfile.h: Likewise.

1998-06-29  Ulrich Drepper  <drepper@cygnus.com>

        * libio.h: Rewrite __PMT change so that it works with platforms
        defining __P but not __PMT.

        * libio.h (__PMT): New macro.  Defined like __P.  Use is for
        function pointers.

For libstdc++/ChangeLog:
1998-08-23  Mark Mitchell  <mark@markmitchell.com>

        [...]
        * cinst.cc: Likewise, for complex<float>, complex<double>,
        complex<long double>.
        


diff -ur libstdc++-2.8.1.1/config/mt-linux libstdc++-2.8.1.1-glibc2.1/config/mt-linux
--- libstdc++-2.8.1.1/config/mt-linux	Tue Sep 16 18:10:43 1997
+++ libstdc++-2.8.1.1-glibc2.1/config/mt-linux	Fri Oct 23 11:33:54 1998
@@ -1,2 +1,2 @@
 # When using glibc 2 on Linux we must always use vtable thunks.
-  CXXFLAGS=-O2 -g -fvtable-thunks
+CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -fvtable-thunks -D_GNU_SOURCE
diff -ur libstdc++-2.8.1.1/libio/libio.h libstdc++-2.8.1.1-glibc2.1/libio/libio.h
--- libstdc++-2.8.1.1/libio/libio.h	Tue Feb 24 15:08:44 1998
+++ libstdc++-2.8.1.1-glibc2.1/libio/libio.h	Fri Oct 23 10:57:27 1998
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991, 92, 93, 94, 95, 97, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1991, 92, 93, 94, 95, 97, 98 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
    Written by Per Bothner <bothner@cygnus.com>.
 
@@ -59,13 +59,21 @@
 #  include <sys/cdefs.h>
 # else
 #  ifdef __STDC__
-#   define __P(protos) protos
+#   define __P(p) p
 #  else
-#   define __P(protos) ()
+#   define __P(p) ()
 #  endif
 # endif
 #endif /*!__P*/
 
+#ifndef __PMT
+# ifdef __STDC__
+#  define __PMT(p) p
+# else
+#  define __PMT(p) ()
+# endif
+#endif /*!__P*/
+
 /* For backward compatibility */
 #ifndef _PARAMS
 # define _PARAMS(protos) __P(protos)
@@ -267,10 +275,10 @@
 /* Define the user-visible type, with user-friendly member names.  */
 typedef struct
 {
-  _IO_ssize_t (*read) __P ((struct _IO_FILE *, void *, _IO_ssize_t));
-  _IO_ssize_t (*write) __P ((struct _IO_FILE *, const void *, _IO_ssize_t));
-  _IO_fpos_t (*seek) __P ((struct _IO_FILE *, _IO_off_t, int));
-  int (*close) __P ((struct _IO_FILE *));
+  _IO_ssize_t (*read) __PMT ((struct _IO_FILE *, void *, _IO_ssize_t));
+  _IO_ssize_t (*write) __PMT ((struct _IO_FILE *, const void *, _IO_ssize_t));
+  _IO_fpos_t (*seek) __PMT ((struct _IO_FILE *, _IO_off_t, int));
+  int (*close) __PMT ((struct _IO_FILE *));
 } _IO_cookie_io_functions_t;
 
 /* Special file type for fopencookie function.  */
@@ -340,7 +348,7 @@
 extern _IO_size_t _IO_sgetn __P ((_IO_FILE *, void *, _IO_size_t));
 
 #if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-extern _IO_fpos64_t _IO_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));      
+extern _IO_fpos64_t _IO_seekoff __P ((_IO_FILE *, _IO_off64_t, int, int));
 extern _IO_fpos64_t _IO_seekpos __P ((_IO_FILE *, _IO_fpos64_t, int));
 #else
 extern _IO_fpos_t _IO_seekoff __P ((_IO_FILE *, _IO_off_t, int, int));
diff -ur libstdc++-2.8.1.1/libio/libioP.h libstdc++-2.8.1.1-glibc2.1/libio/libioP.h
--- libstdc++-2.8.1.1/libio/libioP.h	Tue Feb 24 15:08:44 1998
+++ libstdc++-2.8.1.1-glibc2.1/libio/libioP.h	Fri Oct 23 10:54:15 1998
@@ -91,20 +91,20 @@
 /* The 'finish' function does any final cleaning up of an _IO_FILE object.
    It does not delete (free) it, but does everything else to finalize it/
    It matches the streambuf::~streambuf virtual destructor.  */
-typedef void (*_IO_finish_t) __P ((_IO_FILE *, int)); /* finalize */
+typedef void (*_IO_finish_t) __PMT ((_IO_FILE *, int)); /* finalize */
 #define _IO_FINISH(FP) JUMP1 (__finish, FP, 0)
 
 /* The 'overflow' hook flushes the buffer.
    The second argument is a character, or EOF.
    It matches the streambuf::overflow virtual function. */
-typedef int (*_IO_overflow_t) __P ((_IO_FILE *, int));
+typedef int (*_IO_overflow_t) __PMT ((_IO_FILE *, int));
 #define _IO_OVERFLOW(FP, CH) JUMP1 (__overflow, FP, CH)
 
 /* The 'underflow' hook tries to fills the get buffer.
    It returns the next character (as an unsigned char) or EOF.  The next
    character remains in the get buffer, and the get position is not changed.
    It matches the streambuf::underflow virtual function. */
-typedef int (*_IO_underflow_t) __P ((_IO_FILE *));
+typedef int (*_IO_underflow_t) __PMT ((_IO_FILE *));
 #define _IO_UNDERFLOW(FP) JUMP0 (__underflow, FP)
 
 /* The 'uflow' hook returns the next character in the input stream
@@ -116,20 +116,20 @@
 
 /* The 'pbackfail' hook handles backing up.
    It matches the streambuf::pbackfail virtual function. */
-typedef int (*_IO_pbackfail_t) __P ((_IO_FILE *, int));
+typedef int (*_IO_pbackfail_t) __PMT ((_IO_FILE *, int));
 #define _IO_PBACKFAIL(FP, CH) JUMP1 (__pbackfail, FP, CH)
 
 /* The 'xsputn' hook writes upto N characters from buffer DATA.
    Returns the number of character actually written.
    It matches the streambuf::xsputn virtual function. */
-typedef _IO_size_t (*_IO_xsputn_t) __P ((_IO_FILE *FP, const void *DATA,
+typedef _IO_size_t (*_IO_xsputn_t) __PMT ((_IO_FILE *FP, const void *DATA,
 					 _IO_size_t N));
 #define _IO_XSPUTN(FP, DATA, N) JUMP2 (__xsputn, FP, DATA, N)
 
 /* The 'xsgetn' hook reads upto N characters into buffer DATA.
    Returns the number of character actually read.
    It matches the streambuf::xsgetn virtual function. */
-typedef _IO_size_t (*_IO_xsgetn_t) __P ((_IO_FILE *FP, void *DATA,
+typedef _IO_size_t (*_IO_xsgetn_t) __PMT ((_IO_FILE *FP, void *DATA,
 					 _IO_size_t N));
 #define _IO_XSGETN(FP, DATA, N) JUMP2 (__xsgetn, FP, DATA, N)
 
@@ -139,10 +139,10 @@
    It matches the streambuf::seekoff virtual function.
    It is also used for the ANSI fseek function. */
 #if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-typedef _IO_fpos64_t (*_IO_seekoff_t) __P ((_IO_FILE *FP, _IO_off64_t OFF,
+typedef _IO_fpos64_t (*_IO_seekoff_t) __PMT ((_IO_FILE *FP, _IO_off64_t OFF,
 					  int DIR, int MODE));
 #else
-typedef _IO_fpos_t (*_IO_seekoff_t) __P ((_IO_FILE *FP, _IO_off_t OFF,
+typedef _IO_fpos_t (*_IO_seekoff_t) __PMT ((_IO_FILE *FP, _IO_off_t OFF,
 					  int DIR, int MODE));
 #endif
 #define _IO_SEEKOFF(FP, OFF, DIR, MODE) JUMP3 (__seekoff, FP, OFF, DIR, MODE)
@@ -153,27 +153,27 @@
    It is also used for the ANSI fgetpos and fsetpos functions.  */
 /* The _IO_seek_cur and _IO_seek_end options are not allowed. */
 #if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-typedef _IO_fpos64_t (*_IO_seekpos_t) __P ((_IO_FILE *, _IO_fpos64_t, int));
+typedef _IO_fpos64_t (*_IO_seekpos_t) __PMT ((_IO_FILE *, _IO_fpos64_t, int));
 #else
-typedef _IO_fpos_t (*_IO_seekpos_t) __P ((_IO_FILE *, _IO_fpos_t, int));
+typedef _IO_fpos_t (*_IO_seekpos_t) __PMT ((_IO_FILE *, _IO_fpos_t, int));
 #endif
 #define _IO_SEEKPOS(FP, POS, FLAGS) JUMP2 (__seekpos, FP, POS, FLAGS)
 
 /* The 'setbuf' hook gives a buffer to the file.
    It matches the streambuf::setbuf virtual function. */
-typedef _IO_FILE* (*_IO_setbuf_t) __P ((_IO_FILE *, char *, _IO_ssize_t));
+typedef _IO_FILE* (*_IO_setbuf_t) __PMT ((_IO_FILE *, char *, _IO_ssize_t));
 #define _IO_SETBUF(FP, BUFFER, LENGTH) JUMP2 (__setbuf, FP, BUFFER, LENGTH)
 
 /* The 'sync' hook attempts to synchronize the internal data structures
    of the file with the external state.
    It matches the streambuf::sync virtual function. */
-typedef int (*_IO_sync_t) __P ((_IO_FILE *));
+typedef int (*_IO_sync_t) __PMT ((_IO_FILE *));
 #define _IO_SYNC(FP) JUMP0 (__sync, FP)
 
 /* The 'doallocate' hook is used to tell the file to allocate a buffer.
    It matches the streambuf::doallocate virtual function, which is not
    in the ANSI/ISO C++ standard, but is part traditional implementations. */
-typedef int (*_IO_doallocate_t) __P ((_IO_FILE *));
+typedef int (*_IO_doallocate_t) __PMT ((_IO_FILE *));
 #define _IO_DOALLOCATE(FP) JUMP0 (__doallocate, FP)
 
 /* The following four hooks (sysread, syswrite, sysclose, sysseek, and
@@ -191,14 +191,14 @@
    an existing buffer.  It generalizes the Unix read(2) function.
    It matches the streambuf::sys_read virtual function, which is
    specific to this implementation. */
-typedef _IO_ssize_t (*_IO_read_t) __P ((_IO_FILE *, void *, _IO_ssize_t));
+typedef _IO_ssize_t (*_IO_read_t) __PMT ((_IO_FILE *, void *, _IO_ssize_t));
 #define _IO_SYSREAD(FP, DATA, LEN) JUMP2 (__read, FP, DATA, LEN)
 
 /* The 'syswrite' hook is used to write data from an existing buffer
    to an external file.  It generalizes the Unix write(2) function.
    It matches the streambuf::sys_write virtual function, which is
    specific to this implementation. */
-typedef _IO_ssize_t (*_IO_write_t) __P ((_IO_FILE *,const void *,_IO_ssize_t));
+typedef _IO_ssize_t (*_IO_write_t) __PMT ((_IO_FILE *,const void *,_IO_ssize_t));
 #define _IO_SYSWRITE(FP, DATA, LEN) JUMP2 (__write, FP, DATA, LEN)
 
 /* The 'sysseek' hook is used to re-position an external file.
@@ -206,9 +206,9 @@
    It matches the streambuf::sys_seek virtual function, which is
    specific to this implementation. */
 #if defined(_G_IO_IO_FILE_VERSION) && _G_IO_IO_FILE_VERSION == 0x20001
-typedef _IO_fpos64_t (*_IO_seek_t) __P ((_IO_FILE *, _IO_off64_t, int));
+typedef _IO_fpos64_t (*_IO_seek_t) __PMT ((_IO_FILE *, _IO_off64_t, int));
 #else
-typedef _IO_fpos_t (*_IO_seek_t) __P ((_IO_FILE *, _IO_off_t, int));
+typedef _IO_fpos_t (*_IO_seek_t) __PMT ((_IO_FILE *, _IO_off_t, int));
 #endif
 #define _IO_SYSSEEK(FP, OFFSET, MODE) JUMP2 (__seek, FP, OFFSET, MODE)
 
@@ -216,26 +216,26 @@
    external file.  It generalizes the Unix close(2) function.
    It matches the streambuf::sys_close virtual function, which is
    specific to this implementation. */
-typedef int (*_IO_close_t) __P ((_IO_FILE *)); /* finalize */
+typedef int (*_IO_close_t) __PMT ((_IO_FILE *)); /* finalize */
 #define _IO_SYSCLOSE(FP) JUMP0 (__close, FP)
 
 /* The 'sysstat' hook is used to get information about an external file
    into a struct stat buffer.  It generalizes the Unix fstat(2) call.
    It matches the streambuf::sys_stat virtual function, which is
    specific to this implementation. */
-typedef int (*_IO_stat_t) __P ((_IO_FILE *, void *));
+typedef int (*_IO_stat_t) __PMT ((_IO_FILE *, void *));
 #define _IO_SYSSTAT(FP, BUF) JUMP1 (__stat, FP, BUF)
 
 #if _G_IO_IO_FILE_VERSION == 0x20001
 /* The 'showmany' hook can be used to get an image how much input is
    available.  In many cases the answer will be 0 which means unknown
    but some cases one can provide real information.  */
-typedef int (*_IO_showmanyc_t) __P ((_IO_FILE *));
+typedef int (*_IO_showmanyc_t) __PMT ((_IO_FILE *));
 #define _IO_SHOWMANYC(FP) JUMP0 (__showmanyc, FP)
 
 /* The 'imbue' hook is used to get information about the currently
    installed locales.  */
-typedef void (*_IO_imbue_t) __P ((_IO_FILE *, void *));
+typedef void (*_IO_imbue_t) __PMT ((_IO_FILE *, void *));
 #define _IO_IMBUE(FP, LOCALE) JUMP1 (__imbue, FP, LOCALE)
 #endif
 
@@ -450,7 +450,7 @@
 			      int __sign_mode, int __fill));
 
 extern _IO_FILE *_IO_list_all;
-extern void (*_IO_cleanup_registration_needed) __P ((void));
+extern void (*_IO_cleanup_registration_needed) __PMT ((void));
 
 #ifndef EOF
 # define EOF (-1)
diff -ur libstdc++-2.8.1.1/libio/strfile.h libstdc++-2.8.1.1-glibc2.1/libio/strfile.h
--- libstdc++-2.8.1.1/libio/strfile.h	Sat Sep  6 09:43:55 1997
+++ libstdc++-2.8.1.1-glibc2.1/libio/strfile.h	Fri Oct 23 10:50:29 1998
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1993, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU IO Library.
 
    This library is free software; you can redistribute it and/or
@@ -28,8 +28,16 @@
 Merge into  libio.h ?
 #endif
 
-typedef void *(*_IO_alloc_type) __P ((_IO_size_t));
-typedef void (*_IO_free_type) __P ((void*));
+#ifndef __PMT
+# ifdef __STDC__
+#  define __PMT(p) p
+# else
+#  define __PMT(p) ()
+# endif
+#endif /*!__P*/
+
+typedef void *(*_IO_alloc_type) __PMT ((_IO_size_t));
+typedef void (*_IO_free_type) __PMT ((void*));
 
 struct _IO_str_fields
 {
diff -ur libstdc++-2.8.1.1/libstdc++/cinst.cc libstdc++-2.8.1.1-glibc2.1/libstdc++/cinst.cc
--- libstdc++-2.8.1.1/libstdc++/cinst.cc	Fri Aug 22 00:58:32 1997
+++ libstdc++-2.8.1.1-glibc2.1/libstdc++/cinst.cc	Fri Oct 23 12:11:03 1998
@@ -32,7 +32,6 @@
 typedef const c& ccr;
 
 #ifdef MAIN
-template class complex<f>;
 template c& __doapl (c*, ccr);
 template c& __doaml (c*, ccr);
 template c& __doami (c*, ccr);
@@ -151,5 +150,5 @@
 template istream& operator>> (istream&, complex<f>&);
 #endif
 #ifdef INSERT
-template ostream& operator<< (ostream&, complex<f>);
+template ostream& operator<< (ostream&, const complex<f>&);
 #endif

-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]