This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


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

PATCH: Make libstdc++-v3 testable



I configured for libstdcxx-v3, and found that running `make check-g++'
didn't work very well.  Wrong -I flags, etc.  Here's the goo needed to
fix that.  The basic idea is that since we tell configure what library
we want to use, there's no point in trying to figure that out
dynamically at test-time.

Next, I'll start fixing up the bugs that show up with libstdc++-v3
enabled; most appear to be bugs in the testsuite, rather than in the
compiler or library.  In parallel, we're starting to test libstdc++-v3
on an IRIX 6.5 system, and a Solaris 2.x system as well.  

Once those work reasonable well, I'm planning on cutting over the
default.  That's been weeks away for months, and I'm getting
frustruated.  So, we're going to switch, and then I'm going to hope
that people will be incentivized to fix the problems on their
platforms.  (Of course, you'll be able to work around by using
--disable-libstdcxx-v3, so that's not as draconian as it sounds.)
--

Frankly, the whole way this testing stuff works is just insanely ugly,
and we end up testing the compiler with all kinds of funny flags that
aren't the same as what users really do.  It's easy to make this
better, in theory:

  - Make sure nothing has any hard-coded path dependencies.

  - Have every component in the tree install itself in a common 
    staging area somewhere in the objdir, exactly as it will be when
    finally installed.

  - Test using that area (no need to pass magic -I flags or anything,
    the right thing will automatically happen).
   
  - To install, simply tar up that directory and plunk it down where
    you really wanted it.

After GCC 3.0, we will have to see about doing something like this...

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

2000-10-25  Mark Mitchell  <mark@codesourcery.com>

	* Makefile.in (site.exp): Define HAVE_LIBSTDCXX_V3.
	* configure.in (enable-libstdcxx-v3): Arrange to have
	HAVE_LIBSTDCXX_V3 substituted into the output files.

2000-10-25  Mark Mitchell  <mark@codesourcery.com>

	* lib/g++.exp (g++_include_flags): Trust HAVE_LIBSTDCXX_V3
	to tell us whether or not we are using V3.

2000-10-25  Mark Mitchell  <mark@codesourcery.com>

	* Makefile.in (check): Don't make mkcheck executable.
	(check-install): Likewise.
	* configure.in (AC_OUTPUT): Make mkcheck executable.
	* mkcheck.in (top_srcdir): New variable.
	(INC_PATH): Set the path to the backward and ext directories
	correctly.
	
Index: gcc/Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/Makefile.in,v
retrieving revision 1.526
diff -c -p -r1.526 Makefile.in
*** Makefile.in	2000/10/21 01:47:05	1.526
--- Makefile.in	2000/10/26 02:49:51
*************** site.exp: ./config.status Makefile
*** 2593,2598 ****
--- 2593,2599 ----
  # CFLAGS is set even though it's empty to show we reserve the right to set it.
  	@echo "set CFLAGS \"\"" >> ./tmp0
  	@echo "set CXXFLAGS \"-I$(objdir)/../$(target_subdir)libio -I\$$srcdir/../libg++/src -I\$$srcdir/../libio -I\$$srcdir/../libstdc++ -I\$$srcdir/../libstdc++/stl -L$(objdir)/../$(target_subdir)libg++ -L$(objdir)/../$(target_subdir)libstdc++\"" >> ./tmp0
+ 	@echo "set HAVE_LIBSTDCXX_V3 @HAVE_LIBSTDCXX_V3@" >> ./tmp0
  # If newlib has been configured, we need to pass -B to gcc so it can find
  # newlib's crt0.o if it exists.  This will cause a "path prefix not used"
  # message if it doesn't, but the testsuite is supposed to ignore the message -
Index: gcc/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/gcc/configure.in,v
retrieving revision 1.435
diff -c -p -r1.435 configure.in
*** configure.in	2000/10/18 19:57:53	1.435
--- configure.in	2000/10/26 02:50:01
*************** AC_ARG_ENABLE(libstdcxx-v3,
*** 4898,4910 ****
--- 4898,4913 ----
  
  if test x$enable_libstdcxx_v3 = xyes; then
    AC_MSG_RESULT(v3)
+   HAVE_LIBSTDCXX_V3=1
    ac_esn=1
  else
    AC_MSG_RESULT(v2)
+   HAVE_LIBSTDCXX_V3=0
    ac_esn=0
  fi
  AC_DEFINE_UNQUOTED(ENABLE_STD_NAMESPACE, $ac_esn,
    [Define to 1 if you want to enable namespaces (-fhonor-std) by default.])
+ AC_SUBST(HAVE_LIBSTDCXX_V3)
  
  dnl Very limited version of automake's enable-maintainer-mode
  
Index: gcc/testsuite/lib/g++.exp
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/lib/g++.exp,v
retrieving revision 1.11
diff -c -p -r1.11 g++.exp
*** g++.exp	2000/08/30 18:46:56	1.11
--- g++.exp	2000/10/26 02:50:15
*************** proc g++_version { } {
*** 68,97 ****
  #
  proc g++_include_flags { args } {
      global srcdir
  
      if [is_remote host] {
!       return ""
      }
  
-     set gccpath [get_multilibs]
-     set libio_dir ""
-     set flags ""
- 
      set dir [lookfor_file ${srcdir} libg++]
      if { ${dir} != "" } {
        append flags "-I${dir} -I${dir}/src "
      }
!     set odir_v2 [lookfor_file ${gccpath} libstdc++]
!     set sdir_v2 [lookfor_file ${srcdir} libstdc++]
!     if { ${odir_v2} != "" } {
!       append flags "-I${sdir_v2} -I${sdir_v2}/stl "
!     } else {
        set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
        set sdir_v3 [lookfor_file ${srcdir} libstdc++-v3]
!       if { ${odir_v3} != "" } {
!         append flags [exec ${odir_v3}/mkcheck 2 ${odir_v3} ${sdir_v3}]
!       }
!       # else we're probably testing an already-installed GCC.
      }
  
      return "$flags"
--- 68,96 ----
  #
  proc g++_include_flags { args } {
      global srcdir
+     global HAVE_LIBSTDCXX_V3
  
+     set flags ""
+ 
      if [is_remote host] {
!       return "${flags}"
      }
  
      set dir [lookfor_file ${srcdir} libg++]
      if { ${dir} != "" } {
        append flags "-I${dir} -I${dir}/src "
      }
! 
!     set gccpath [get_multilibs]
! 
!     if { ${HAVE_LIBSTDCXX_V3} } {
        set odir_v3 [lookfor_file ${gccpath} libstdc++-v3]
        set sdir_v3 [lookfor_file ${srcdir} libstdc++-v3]
!       append flags [exec ${odir_v3}/mkcheck 2 ${odir_v3} ${sdir_v3}]
!     } else {
!       set odir_v2 [lookfor_file ${gccpath} libstdc++]
!       set sdir_v2 [lookfor_file ${srcdir} libstdc++]
!       append flags "-I${sdir_v2} -I${sdir_v2}/stl "
      }
  
      return "$flags"
Index: libstdc++-v3/Makefile.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/Makefile.in,v
retrieving revision 1.31
diff -c -p -r1.31 Makefile.in
*** Makefile.in	2000/10/17 10:12:20	1.31
--- Makefile.in	2000/10/26 02:50:16
***************
*** 1,6 ****
  # Makefile.in generated automatically by automake 1.4 from Makefile.am
  
! # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
  # This Makefile.in is free software; the Free Software Foundation
  # gives unlimited permission to copy and/or distribute it,
  # with or without modifications, as long as this notice is preserved.
--- 1,6 ----
  # Makefile.in generated automatically by automake 1.4 from Makefile.am
  
! # Copyright (C) 1994, 1995-8, 1999, 2000 Free Software Foundation, Inc.
  # This Makefile.in is free software; the Free Software Foundation
  # gives unlimited permission to copy and/or distribute it,
  # with or without modifications, as long as this notice is preserved.
*************** mostlyclean distclean maintainer-clean
*** 407,417 ****
  # because then the paths will be full pathnames, not relative
  # pathnames. (-Wl,--rpath seems to like this better.)
  check:  $(top_builddir)/mkcheck
- 	chmod +x  $(top_builddir)/mkcheck
  	$(top_builddir)/mkcheck 0 `pwd` $(top_srcdir)
  
  check-install: $(top_builddir)/mkcheck
- 	chmod +x  $(top_builddir)/mkcheck
  	$(top_builddir)/mkcheck 1 `pwd` $(top_srcdir) $(prefix)
  
  # Multilib Makefile bits.
--- 407,415 ----
Index: libstdc++-v3/configure.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/configure.in,v
retrieving revision 1.24
diff -c -p -r1.24 configure.in
*** configure.in	2000/10/21 19:40:17	1.24
--- configure.in	2000/10/26 02:50:20
*************** AC_OUTPUT(mkcheck Makefile src/Makefile 
*** 221,227 ****
  [if test -n "$CONFIG_FILES"; then
    ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
    grep '^MULTISUBDIR =' Makefile >> src/Makefile
! fi],
  srcdir=${srcdir}
  host=${host}
  target=${target}
--- 221,229 ----
  [if test -n "$CONFIG_FILES"; then
    ac_file=Makefile . ${glibcpp_basedir}/../config-ml.in
    grep '^MULTISUBDIR =' Makefile >> src/Makefile
! fi
! chmod +x mkcheck
! ],
  srcdir=${srcdir}
  host=${host}
  target=${target}
Index: libstdc++-v3/mkcheck.in
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/mkcheck.in,v
retrieving revision 1.24
diff -c -p -r1.24 mkcheck.in
*** mkcheck.in	2000/10/18 23:26:22	1.24
--- mkcheck.in	2000/10/26 02:50:21
*************** if [ $WHICH -eq 1 ]; then 
*** 54,59 ****
--- 54,60 ----
  fi
  
  # INC_PATH == include path to new headers for use on gcc command-line
+ top_srcdir=@top_srcdir@
  C_DIR="`basename @C_INCLUDE_DIR@`"
  if [ $WHICH != "1" ]; then
    INC_PATH="@CSHADOW_FLAGS@ -I$BUILD_DIR -I$BUILD_DIR/libio \
*************** elif [ $WHICH -eq 1 ]; then
*** 65,71 ****
  fi
  
  if [ $WHICH -eq 2 ]; then
!   echo $INC_PATH -I$SRC_DIR/backward -I$SRC_DIR/ext
    exit 0;
  fi
  
--- 66,72 ----
  fi
  
  if [ $WHICH -eq 2 ]; then
!   echo $INC_PATH -I$SRC_DIR/include/backward -I$SRC_DIR/include/ext
    exit 0;
  fi
  

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