This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
[libstdc++] minor fixes and improvements to check-abi
- From: Phil Edwards <phil at jaj dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 23 Aug 2002 15:35:07 -0400
- Subject: [libstdc++] minor fixes and improvements to check-abi
Fixes a minor shell syntax bug. Sets up a default baseline file and allows
overrides from configure.target. Gives more informative messages in common
or possibly-common check-abi mistakes.
I'm slightly confused why cross-targets would have been broken by the
configury changes. GLIBCPP_CONFIGURE_TESTSUITE now contains a test for
native builds, but GLIBCPP_CONFIGURE_TESTSUITE itself is only run in the
native build case.
Tested on i686-pc-linux-gnu... well, sortof. (Followup on /that/ in
a moment.) Applied to trunk. If this is all good after a day, I'll
copy it to the branch.
2002-08-23 Phil Edwards <pme@gcc.gnu.org>
* Makefile.am (check-abi): Specify current directory.
* acinclude.m4 (GLIBCPP_CONFIGURE_TESTSUITE): Fix shell syntax, use
abi_baseline_triplet in baseline_file.
* Makefile.in, aclocal.m4, configure: Regenerate.
* configure.target: Add abi_baseline_triplet with default.
* testsuite/abi_check.cc: More error checking.
Index: Makefile.am
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/Makefile.am,v
retrieving revision 1.32
diff -u -3 -p -r1.32 Makefile.am
--- Makefile.am 22 Aug 2002 20:05:55 -0000 1.32
+++ Makefile.am 23 Aug 2002 19:30:02 -0000
@@ -49,7 +49,7 @@ check-script-install: $(top_builddir)/mk
baseline_file = @baseline_file@
check-abi: $(top_builddir)/testsuite/abi_check
-(cd testsuite; \
- abi_check @baseline_file@)
+ ./abi_check ${baseline_file})
# These rules are messy, but are hella worth it.
doxygen:
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.215
diff -u -3 -p -r1.215 acinclude.m4
--- acinclude.m4 23 Aug 2002 03:39:47 -0000 1.215
+++ acinclude.m4 23 Aug 2002 19:30:03 -0000
@@ -2028,12 +2028,12 @@ AC_DEFUN(GLIBCPP_CONFIGURE_TESTSUITE, [
GLIBCPP_CHECK_STDLIB_DECL_AND_LINKAGE_3(setenv)
# Export file names for ABI checking.
- baseline_file="${glibcpp_srcdir}/config/abi/${target_alias}/baseline_symbols.txt"
+ baseline_file="${glibcpp_srcdir}/config/abi/${abi_baseline_triplet}/baseline_symbols.txt"
AC_SUBST(baseline_file)
# Don't do ABI checking unless native.
AM_CONDITIONAL(GLIBCPP_BUILD_ABI_CHECK,
- test x"$build" == x"$host" && test -z "$with_cross_host")
+ test x"$build" = x"$host" && test -z "$with_cross_host")
])
Index: configure.target
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.target,v
retrieving revision 1.48
diff -u -3 -p -r1.48 configure.target
--- configure.target 29 Jul 2002 23:26:00 -0000 1.48
+++ configure.target 23 Aug 2002 19:30:06 -0000
@@ -31,6 +31,9 @@
# c_compatibility if "C" compatibility headers are necessary,
# defaults to no.
#
+# abi_baseline_triplet directory name for ABI compat testing,
+# defaults to target (as per config.guess)
+#
# It possibly modifies the following variables:
#
# OPT_LDFLAGS extra flags to pass when linking the library, of
@@ -54,6 +57,8 @@ else
cpu_include_dir="cpu/generic"
fi
+abi_baseline_triplet=${target}
+
c_model=c_std
c_compatibility=no
@@ -71,6 +76,7 @@ case "${target_cpu}" in
cpu_include_dir="cpu/arm"
;;
i486 | i586 | i686 | i786)
+ # add athlons here maybe
cpu_include_dir="cpu/i486"
CPULIMITSH="cpu/i386"
;;
Index: testsuite/abi_check.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/abi_check.cc,v
retrieving revision 1.3
diff -u -3 -p -r1.3 abi_check.cc
--- testsuite/abi_check.cc 23 Aug 2002 02:57:11 -0000 1.3
+++ testsuite/abi_check.cc 23 Aug 2002 19:30:06 -0000
@@ -36,6 +36,8 @@
#include <fstream>
#include <iostream>
#include <cxxabi.h>
+#include <stdlib.h> // for system(3)
+#include <unistd.h> // for access(2)
struct symbol_info
{
@@ -225,6 +227,19 @@ int main(int argc, char** argv)
const char* baseline_file = argv[1];
const char* test_file = "current_symbols.txt";
const char* test_lib = "../src/.libs/libstdc++.so";
+
+ // Quick sanity/setup check
+ if (access(baseline_file, R_OK) != 0)
+ {
+ cerr << "Cannot read baseline file " << baseline_file << endl;
+ exit(1);
+ }
+ if (access(test_lib, R_OK) != 0)
+ {
+ cerr << "Cannot read library " << test_lib
+ << ", did you forget to build first?" << endl;
+ exit(1);
+ }
// Get list of symbols.
// Assume external symbol list computed "as if" by