[v3] enable check-abi summary

Benjamin Kosnik bkoz@redhat.com
Tue Jun 17 06:02:00 GMT 2003


This adds 'make check-abi' to 'make check' for libstdc++ on targets
with versioned shared libraries. The output has been tweaked to look
like something people are used to seeing from dejagnu, and all the
gory, verbose info about symbol versioning is now not shown by
default, but instead by 'make check-abi-verbose.'

Next step is to update the configs for 3.3.0. For new targets, I'd
appreciate it if a 3.2.0 baseline could be checked in first, then
updated to 3.3.0. For old targets, make sure that you have 0
incompatible before you check in the new file.

Since it's the only machine I have easy access to, I'll do i486-linux.
Andreas, please try the new i486-linux baseline, and see if it matches
what you're expecting. I suspect it will. 

best,
benjamin

tested x86/linux, various configurations

2003-06-16  Benjamin Kosnik  <bkoz@redhat.com>

	* Makefile.am (check-abi): Move...
	(new-abi-baseline): Move...
	* testsuite/Makefile.am: ...here.
	(new-abi-baseline): Conditionalize.
	(check-abi): Conditionalize.
	(check-abi-verbose): New.
	* Makefile.in: Regenerate.
	* testsuite/Makefile.in: Regenerate.	
	* configure.in: Consolidate testsuite configure bits.
	* acinclude.m4 (GLIBCPP_CONFIGURE_TESTSUITE): Same.
	* configure: Regenerate.
	* aclocal.m4: Regenerate.	
	* testsuite/abi_check.cc: Add --check-verbose.
	Only output detailed information if --check-verbose.

Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/Makefile.am,v
retrieving revision 1.40
diff -c -p -r1.40 Makefile.am
*** Makefile.am	12 Jun 2003 03:24:08 -0000	1.40
--- Makefile.am	17 Jun 2003 05:42:50 -0000
*************** check-script-install: $(top_builddir)/mk
*** 46,71 ****
  	  cd testsuite; \
  	  @glibcpp_builddir@/mkcheck 1)
  
- # Use 'new-abi-baseline' to create an initial symbol file.  Then run
- # 'check-abi' to test for changes against that file.
- baseline_file = @baseline_file@
- check-abi: $(top_builddir)/testsuite/abi_check
- 	-@(cd testsuite; \
- 	  @glibcpp_srcdir@/config/abi/extract_symvers \
- 	     ../src/.libs/libstdc++.so \
- 	     ./current_symbols.txt && \
- 	  ./abi_check --check ./current_symbols.txt ${baseline_file})
- 
- new-abi-baseline:
- 	-@(output=${baseline_file}; \
- 	  if test -f $${output}; then \
- 	    output=$${output}.new; \
- 	    t=`echo $${output} | sed 's=.*config/abi/=='`; \
- 	    echo "Baseline file already exists, writing to $${t} instead."; \
- 	  fi; \
- 	  @glibcpp_srcdir@/config/abi/extract_symvers \
- 	     src/.libs/libstdc++.so $${output})
- 
  # These rules are messy, but are hella worth it.
  doxygen:
  	-(srcdir=`cd ${top_srcdir}; ${PWD}`; \
--- 46,51 ----
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.244
diff -c -p -r1.244 acinclude.m4
*** acinclude.m4	16 Jun 2003 18:44:45 -0000	1.244
--- acinclude.m4	17 Jun 2003 05:42:52 -0000
*************** AC_DEFUN(GLIBCPP_CONFIGURE, [
*** 209,215 ****
    #glibcpp_pch_comp=no
    #enable_cheaders=c
    #c_compatibility=no
!   enable_abi_check=no
    #enable_symvers=no
  
    # Find platform-specific directories containing configuration info.  In
--- 209,215 ----
    #glibcpp_pch_comp=no
    #enable_cheaders=c
    #c_compatibility=no
!   #enable_abi_check=no
    #enable_symvers=no
  
    # Find platform-specific directories containing configuration info.  In
*************** dnl the testsuite_hooks.h header.
*** 2049,2068 ****
  dnl
  dnl GLIBCPP_CONFIGURE_TESTSUITE  [no args]
  AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
-   GLIBCPP_CHECK_SETRLIMIT
  
!   # Look for setenv, so that extended locale tests can be performed.
!   GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
  
    # Export file names for ABI checking.
    baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)/baseline_symbols.txt"
    AC_SUBST(baseline_file)
  
!   dnl XXX move to configure.host?
!   case "$target" in
!     *-*-cygwin* ) enable_abi_check=no ;;
!     * ) enable_abi_check=yes ;;
!   esac
  ])
  
  
--- 2049,2081 ----
  dnl
  dnl GLIBCPP_CONFIGURE_TESTSUITE  [no args]
  AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
  
!   if test  x"$GLIBCPP_IS_CROSS_COMPILING" = xfalse; then
!     # Do checks for memory limit functions.
!     GLIBCPP_CHECK_SETRLIMIT
! 
!     # Look for setenv, so that extended locale tests can be performed.
!     GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
!   fi
  
    # Export file names for ABI checking.
    baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_pair}\$(MULTISUBDIR)/baseline_symbols.txt"
    AC_SUBST(baseline_file)
  
!   # Determine if checking the ABI is desirable.
!   if test x$enable_symvers = xno; then
!     enable_abi_check=no
!   else
!     case "$host" in
!       *-*-cygwin*) 
! 	enable_abi_check=no ;;
!       *) 
!         enable_abi_check=yes ;;
!     esac
!   fi
! 
!   AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)	
!   AM_CONDITIONAL(GLIBCPP_TEST_ABI, test "$enable_abi_check" = yes)
  ])
  
  
Index: configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.in,v
retrieving revision 1.129
diff -c -p -r1.129 configure.in
*** configure.in	14 Jun 2003 05:35:55 -0000	1.129
--- configure.in	17 Jun 2003 05:42:53 -0000
*************** else
*** 431,444 ****
    ])
  
    AC_FUNC_MMAP
- 
-   # Establish limits on memory usage during 'make check'
-   GLIBCPP_CONFIGURE_TESTSUITE
  fi
  
! # This depends on the possibly-skipped linker test above.
  GLIBCPP_ENABLE_SYMVERS([yes])
  
  # Propagate the target-specific source directories through the build chain.
  # (Nothing currently uses cpu_include_dir directly; only ATOMICITYH 
  # uses it, and it only gets used in this file.)
--- 431,444 ----
    ])
  
    AC_FUNC_MMAP
  fi
  
! # This depends on GLIBCPP_CHECK_LINKER_FEATURES, but without it assumes no.
  GLIBCPP_ENABLE_SYMVERS([yes])
  
+ # This depends on GLIBCPP_ENABLE_SYMVERS and GLIBCPP_IS_CROSS_COMPILING.
+ GLIBCPP_CONFIGURE_TESTSUITE
+ 
  # Propagate the target-specific source directories through the build chain.
  # (Nothing currently uses cpu_include_dir directly; only ATOMICITYH 
  # uses it, and it only gets used in this file.)
*************** ATOMICITY_INC_SRCDIR=config/${ATOMICITYH
*** 447,461 ****
  AC_SUBST(OS_INC_SRCDIR)
  AC_SUBST(ATOMICITY_INC_SRCDIR)
  
! # Set up cross-compile flags and all AM_CONDITIONALs.
  AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
  AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
  dnl from GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT:
  AM_CONDITIONAL(GLIBCPP_BUILD_LIBMATH,  test "$need_libmath" = yes)
- dnl from GLIBCPP_CHECK_WCHAR_T_SUPPORT:
- AM_CONDITIONAL(GLIBCPP_TEST_WCHAR_T, test "$enable_wchar_t" = yes)	
- dnl from GLIBCPP_CONFIGURE_TESTSUITE:
- AM_CONDITIONAL(GLIBCPP_BUILD_ABI_CHECK, test "$enable_abi_check" = yes)
   
  AC_CACHE_SAVE
  
--- 447,457 ----
  AC_SUBST(OS_INC_SRCDIR)
  AC_SUBST(ATOMICITY_INC_SRCDIR)
  
! # Determine cross-compile flags and all AM_CONDITIONALs.
  AC_SUBST(GLIBCPP_IS_CROSS_COMPILING)
  AM_CONDITIONAL(CANADIAN, test "$CANADIAN" = yes)
  dnl from GLIBCPP_CHECK_COMPLEX_MATH_SUPPORT:
  AM_CONDITIONAL(GLIBCPP_BUILD_LIBMATH,  test "$need_libmath" = yes)
   
  AC_CACHE_SAVE
  
Index: testsuite/Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/Makefile.am,v
retrieving revision 1.18
diff -c -p -r1.18 Makefile.am
*** testsuite/Makefile.am	12 May 2003 00:41:35 -0000	1.18
--- testsuite/Makefile.am	17 Jun 2003 05:42:53 -0000
*************** noinst_LIBRARIES = libv3test.a
*** 54,76 ****
  libv3test_a_SOURCES = testsuite_hooks.cc testsuite_allocator.cc
  
  ## Build support utilities.
! ## Only build this as native, as need to find startup files and libc to link.
! if GLIBCPP_BUILD_ABI_CHECK
  noinst_PROGRAMS = abi_check
  else
  noinst_PROGRAMS = 
  endif
  abi_check_SOURCES = abi_check.cc
  
  # Enable wchar_t tests if capable.
  if GLIBCPP_TEST_WCHAR_T
! all-local: stamp_wchar
  else
! all-local:
  endif
  
- stamp_wchar:
- 	touch testsuite_wchar_t
  
  # By adding these files here, automake will remove them for 'make clean'
  CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
--- 54,120 ----
  libv3test_a_SOURCES = testsuite_hooks.cc testsuite_allocator.cc
  
  ## Build support utilities.
! if GLIBCPP_TEST_ABI
  noinst_PROGRAMS = abi_check
  else
  noinst_PROGRAMS = 
  endif
  abi_check_SOURCES = abi_check.cc
  
+ all-local: stamp_wchar
+ 
  # Enable wchar_t tests if capable.
  if GLIBCPP_TEST_WCHAR_T
! stamp_wchar:
! 	touch testsuite_wchar_t
  else
! stamp_wchar:
! endif
! 
! # Override this so local rules are possible.
! check-am: 
! 	$(MAKE) $(AM_MAKEFLAGS) check-DEJAGNU; \
! 	$(MAKE) $(AM_MAKEFLAGS) check-local 
! 
! check-local: check-abi
! 
! baseline_file = @baseline_file@
! extract_symvers = @glibcpp_srcdir@/config/abi/extract_symvers
! 
! current_symbols.txt: ${extract_symvers} ../src/.libs/libstdc++.so
! 	  -@(${extract_symvers} ../src/.libs/libstdc++.so current_symbols.txt)
! 
! baseline_symbols:
! 	-@(output=${baseline_file}; \
! 	  if test ! -f $${output}; then \
! 	    echo "Baseline file doesn't exist."; \
! 	    echo "Try 'make new-abi-baseline' to create it."; \
! 	    exit 1; \
! 	  fi; \
! 	touch baseline_symbols)
! 
! new-abi-baseline: 
! 	-@(output=${baseline_file}; \
! 	  if test -f $${output}; then \
! 	    output=$${output}.new; \
! 	    t=`echo $${output} | sed 's=.*config/abi/=='`; \
! 	    echo "Baseline file already exists, writing to $${t} instead."; \
! 	  fi; \
! 	  ${extract_symvers} ../src/.libs/libstdc++.so $${output})
! 
! if GLIBCPP_TEST_ABI
! # Use 'new-abi-baseline' to create an initial symbol file.  Then run
! # 'check-abi' to test for changes against that file.
! check-abi: abi_check baseline_symbols current_symbols.txt
! 	-@(./abi_check --check ./current_symbols.txt ${baseline_file})
! 
! check-abi-verbose: abi_check baseline_symbols current_symbols.txt 
! 	-@(./abi_check --check-verbose ./current_symbols.txt ${baseline_file})
! else
! check-abi:
! check-abi-verbose:
  endif
  
  
  # By adding these files here, automake will remove them for 'make clean'
  CLEANFILES = *.txt *.tst *.exe core* filebuf_* tmp* ostream_* *.log *.sum \
Index: testsuite/abi_check.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/abi_check.cc,v
retrieving revision 1.16
diff -c -p -r1.16 abi_check.cc
*** testsuite/abi_check.cc	16 Jun 2003 22:09:03 -0000	1.16
--- testsuite/abi_check.cc	17 Jun 2003 05:42:53 -0000
*************** main(int argc, char** argv)
*** 313,329 ****
    using namespace std;
  
    // Get arguments.  (Heading towards getopt_long, I can feel it.)
!   string argv1;
!   if (argc < 4 || (string("--help") == (argv1 = argv[1])))
!     {
!       cerr << "Usage:  abi_check --check    cur baseline\n"
!               "                  --help\n\n"
!               "Where CUR is a file containing the current results from\n"
                "extract_symvers, and BASELINE is one from config/abi.\n"
  	   << endl;
        exit(1);
      }
! 
  
    // Quick sanity/setup check for arguments.
    const char* test_file = argv[2];
--- 313,332 ----
    using namespace std;
  
    // Get arguments.  (Heading towards getopt_long, I can feel it.)
!   bool verbose = false;
!   string argv1 = argc > 1 ? argv[1] : "";
!   if (argv1 == "--help" || argc < 4)
!     {
!       cerr << "usage: abi_check --check current baseline\n"
!               "                 --check-verbose current baseline\n"
!               "                 --help\n\n"
!               "Where CURRENT is a file containing the current results from\n"
                "extract_symvers, and BASELINE is one from config/abi.\n"
  	   << endl;
        exit(1);
      }
!   else if (argv1 == "--check-verbose")
!     verbose = true;
  
    // Quick sanity/setup check for arguments.
    const char* test_file = argv[2];
*************** main(int argc, char** argv)
*** 412,432 ****
      }
  
    // Report results.
!   if (added_names.size())
      {
        cout << added_names.size() << " added symbols " << endl;
        for (size_t j = 0; j < added_names.size() ; ++j)
  	report_symbol_info(test_symbols[added_names[j]], j + 1);
      }
    
!   if (missing_names.size())
      {
        cout << missing_names.size() << " missing symbols " << endl;
        for (size_t j = 0; j < missing_names.size() ; ++j)
  	report_symbol_info(baseline_symbols[missing_names[j]], j + 1);
      }
    
!   if (incompatible.size ())
      {
        cout << incompatible.size() << " incompatible symbols " << endl;
        for (size_t j = 0; j < incompatible.size() ; ++j)
--- 415,435 ----
      }
  
    // Report results.
!   if (verbose && added_names.size())
      {
        cout << added_names.size() << " added symbols " << endl;
        for (size_t j = 0; j < added_names.size() ; ++j)
  	report_symbol_info(test_symbols[added_names[j]], j + 1);
      }
    
!   if (verbose && missing_names.size())
      {
        cout << missing_names.size() << " missing symbols " << endl;
        for (size_t j = 0; j < missing_names.size() ; ++j)
  	report_symbol_info(baseline_symbols[missing_names[j]], j + 1);
      }
    
!   if (verbose && incompatible.size())
      {
        cout << incompatible.size() << " incompatible symbols " << endl;
        for (size_t j = 0; j < incompatible.size() ; ++j)
*************** main(int argc, char** argv)
*** 441,451 ****
  	}
      }
    
!   cout << "\n\t\t=== libstdc++-v3 check-abi Summary for " << baseline_file 
!        << " ===" << endl << endl;
    cout << "# of added symbols:\t\t " << added_names.size() << endl;
    cout << "# of missing symbols:\t\t " << missing_names.size() << endl;
    cout << "# of incompatible symbols:\t " << incompatible.size() << endl;
  
    return 0;
  }
--- 444,456 ----
  	}
      }
    
!   cout << "\n\t\t=== libstdc++-v3 check-abi Summary ===" << endl;
!   cout << endl;
    cout << "# of added symbols:\t\t " << added_names.size() << endl;
    cout << "# of missing symbols:\t\t " << missing_names.size() << endl;
    cout << "# of incompatible symbols:\t " << incompatible.size() << endl;
+   cout << endl;
+   cout << "using: " << baseline_file << endl;
  
    return 0;
  }



More information about the Gcc-patches mailing list