This is the mail archive of the libstdc++@sources.redhat.com mailing list for the libstdc++ project.


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

V3 PATCH: Turn on --enable-cstdio=stdio by default



V3 is set up so that you can implement the basic I/O facilities using
an I/O package of your choosing.  Right now, there are two I/O
packages: one that uses libio, and one that uses `fopen' and friends
form the C stdio library.

The libio version is incompatible with the new ABI due to its manual
construction of vtables, etc.  (The cleanest way to fix this would be
to implement _IO_FILE in C++, making the various functions truly
virtual.  Note that IA64 C++ ABI vtables are not expressible in C,
despite the fact that I argued that they should be.  Therefore, it is
simply not possible to continue to have libio written in C, using the
kinds of tricks employed presently.)

For the time being, this means that we need to use the C I/O so that
we can transition to the new ABI.  We lose some performance, and
support for wide characters; recall, however, that V2 did not support
wide-characters so we are not really going backwards relative to GCC
2.95.x.  Kudos to Benjamin for providing the C stdio implementation to
ease transition to the new ABI.

I anticipate switching to the new ABI by default within a week or so.
I will test on various machines, and then throw the switch.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2000-11-16  Mark Mitchell  <mark@codesourcery.com>

	* acinclude.m4 (GLIBCPP_ENABLE_CSTDIO): Make 
	--enable-cstdio=stdio the default.  Disable wide character support
	in that event.
	* configure.in: Move GLIBCPP_ENABLE_C_MBCHAR after
	(GLIBCPP_ENABLE_CSTDIO).
	* config/c_io_stdio.h: Don't include <libio.h>, don't define
	__c_wfile_type.
	* aclocal.m4: Regenerated.
	* configure: Likewise.
	* Makefile.in: Likewise.
	* libio/Makefile.in: Likewise.
	* libmath/Makefile.in: Likewise.
	* libsupc++/Makefile.in: Likewise.
	* src/Makefile.in: Likewise.
	
Index: libstdc++-v3/acinclude.m4
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/acinclude.m4,v
retrieving revision 1.92
diff -c -p -r1.92 acinclude.m4
*** acinclude.m4	2000/11/16 01:44:01	1.92
--- acinclude.m4	2000/11/17 00:52:20
*************** AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
*** 1238,1245 ****
  
    dnl Check if a valid I/O package
    case x${enable_cstdio_flag} in
!     xlibio | x | xno | xnone | xyes)
!       # default
        CSTDIO_H=config/c_io_libio.h
        CSTDIO_CC=config/c_io_libio.cc
        AC_MSG_RESULT(libio)
--- 1238,1244 ----
  
    dnl Check if a valid I/O package
    case x${enable_cstdio_flag} in
!     xlibio)
        CSTDIO_H=config/c_io_libio.h
        CSTDIO_CC=config/c_io_libio.cc
        AC_MSG_RESULT(libio)
*************** AC_DEFUN(GLIBCPP_ENABLE_CSTDIO, [
*** 1294,1305 ****
           fi
        fi
        ;;
!     xstdio)
        CSTDIO_H=config/c_io_stdio.h
        CSTDIO_CC=config/c_io_stdio.cc
        AC_MSG_RESULT(stdio)
  
        need_libio=no
        ;;
      *)
        echo "$enable_cstdio is an unknown io package" 1>&2
--- 1293,1309 ----
           fi
        fi
        ;;
!     xstdio | x | xno | xnone | xyes)
!       # default
        CSTDIO_H=config/c_io_stdio.h
        CSTDIO_CC=config/c_io_stdio.cc
        AC_MSG_RESULT(stdio)
  
+       # We're not using stdio.
        need_libio=no
+       need_wlibio=no
+       # Wide characters are not supported with this package.
+       enable_c_mbchar=no
        ;;
      *)
        echo "$enable_cstdio is an unknown io package" 1>&2
Index: libstdc++-v3/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/configure.in,v
retrieving revision 1.33
diff -c -p -r1.33 configure.in
*** configure.in	2000/11/16 01:44:02	1.33
--- configure.in	2000/11/17 00:52:25
*************** GLIBCPP_CHECK_COMPILER_VERSION
*** 31,38 ****
  
  # Enable all the crazy c++ stuff.  C_MBCHAR must come early.
  GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
- GLIBCPP_ENABLE_C_MBCHAR([yes])
  GLIBCPP_ENABLE_CSTDIO
  GLIBCPP_ENABLE_LONG_LONG([yes])
  GLIBCPP_ENABLE_SHADOW([no])
  GLIBCPP_ENABLE_THREADS
--- 31,38 ----
  
  # Enable all the crazy c++ stuff.  C_MBCHAR must come early.
  GLIBCPP_ENABLE_DEBUG($USE_MAINTAINER_MODE)
  GLIBCPP_ENABLE_CSTDIO
+ GLIBCPP_ENABLE_C_MBCHAR([yes])
  GLIBCPP_ENABLE_LONG_LONG([yes])
  GLIBCPP_ENABLE_SHADOW([no])
  GLIBCPP_ENABLE_THREADS
Index: libstdc++-v3/config/c_io_stdio.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/config/c_io_stdio.h,v
retrieving revision 1.4
diff -c -p -r1.4 c_io_stdio.h
*** c_io_stdio.h	2000/11/16 09:26:14	1.4
--- c_io_stdio.h	2000/11/17 00:52:25
***************
*** 35,46 ****
  #include <stdio.h>
  #include <bits/c++threads.h>
  
- #if _GLIBCPP_USE_WCHAR_T
- // Even though we use the C stdio facilities for ordinary streams,
- // we still use libio for wide-character support.
- #include <libio.h>
- #endif
- 
  namespace std {
  
  // from fpos.h
--- 35,40 ----
*************** namespace std {
*** 61,72 ****
  // from basic_file.h
  #define _GLIBCPP_BASIC_FILE_ENCAPSULATION 1
    typedef FILE __c_file_type;
- 
- 
- #ifdef _GLIBCPP_USE_WCHAR_T
-   typedef _IO_wide_data __c_wfile_type;
-   extern "C" struct __c_libio_codecvt { };
- #endif 
  
  // from ios_base.h
    struct __ios_flags
--- 55,60 ----

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