This is the mail archive of the libstdc++@gcc.gnu.org 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]
Other format: [Raw text]

Two-part patch for hppa64-hpux libstdc++ testsuite failures


A number of libstdc++ tests have been failing on hppa64-hpux with
weird link errors (complaining about the alignment of a symbol
changing).  This is a two-part bug.  First, libstdc++ is compiling its
testsuite's support routines (libv3test.a) with different options from
the test cases themselves; in particular, without -ffunction-sections
-fdata-sections.  This causes a template data object that's being
instantiated in both testsuite_hooks.cc and in some test cases, to get
issued as a COMMON symbol in one file and a .bss.NAME section symbol
in the other.  These have different alignments (which is itself a bug
but I see no way to fix it given the way common symbols are declared
on pa64) so the linker barfs.  The libstdc++ part of this patch
corrects that.

By itself, though, all this does is turn a single-architecture
alignment mismatch into a cross-platform multiply defined symbol
error, because now both files have the object as a .bss.NAME section
symbol, which does *not* have linkonce semantics.  (This is PR 14936.)
This doesn't happen on the mainline; the relevant change is one small
piece of a very large patch by Matt Austern which was applied to the
mainline on March 12.  So the gcc part of this patch extracts that fix
and backports it to the branch.

The net result in the libstdc++ testsuite for PA64:

-FAIL: 21_strings/basic_string/inserters_extractors/pod/10081-in.cc
-FAIL: 21_strings/basic_string/inserters_extractors/pod/10081-out.cc
-FAIL: 22_locale/numpunct/members/pod/1.cc
-FAIL: 22_locale/numpunct/members/pod/2.cc
-FAIL: 27_io/basic_istream/sentry/pod/1.cc
-FAIL: 27_io/basic_ostream/sentry/pod/1.cc

Bootstrapped i686-linux and hppa64-hpux11.11.  OK 3.4 branch?  The
libstdc++ tweaks should go on mainline too.  (N.B. We can't use := for
the Makefile variables that expand to $(shell ...) constructs because
then they get run too early.)

zw

gcc:
        PR 14936
        Backport from mainline:
        2004-03-12  Matt Austern  <austern@apple.com>

        * varasm.c (make_decl_one_only): Don't use DECL_COMMON if
        we're compiling for a SUPPORTS_ONE_ONLY target.

libstdc++:
        * testsuite/Makefile.am: Add definition of AM_CXXFLAGS.
        Change definition of CXX to use $(shell) instead of backticks.
        * testsuite/Makefile.in: Regenerate.

===================================================================
Index: libstdc++-v3/testsuite/Makefile.am
--- libstdc++-v3/testsuite/Makefile.am	18 Mar 2004 17:37:16 -0000	1.33.4.1
+++ libstdc++-v3/testsuite/Makefile.am	14 Apr 2004 01:10:19 -0000
@@ -30,7 +30,8 @@ AM_RUNTESTFLAGS =
 
 ## CXX is actually a "C" compiler. These are real C++ programs.
 testsuite_flags_script=${glibcxx_builddir}/scripts/testsuite_flags
-CXX=`${testsuite_flags_script} --build-cxx`
+CXX         = $(shell ${testsuite_flags_script} --build-cxx)
+AM_CXXFLAGS = $(shell ${testsuite_flags_script} --cxxflags)
 
 GLIBGCC_DIR=`$(CC) -print-libgcc-file-name | sed 's,/[^/]*$$,,'`
 GLIBCXX_DIR=${glibcxx_builddir}/src/.libs
===================================================================
Index: libstdc++-v3/testsuite/Makefile.in
--- libstdc++-v3/testsuite/Makefile.in	18 Mar 2004 17:37:16 -0000	1.69.4.1
+++ libstdc++-v3/testsuite/Makefile.in	14 Apr 2004 01:10:19 -0000
@@ -70,7 +70,7 @@ CPPFLAGS = @CPPFLAGS@
 CSTDIO_H = @CSTDIO_H@
 CTIME_CC = @CTIME_CC@
 CTIME_H = @CTIME_H@
-CXX = `${testsuite_flags_script} --build-cxx`
+CXX = $(shell ${testsuite_flags_script} --build-cxx)
 CXXCPP = @CXXCPP@
 CXXFLAGS = @CXXFLAGS@
 CYGPATH_W = @CYGPATH_W@
@@ -225,6 +225,7 @@ AM_MAKEFLAGS = -j1
 AM_RUNTESTFLAGS = 
 
 testsuite_flags_script = ${glibcxx_builddir}/scripts/testsuite_flags
+AM_CXXFLAGS = $(shell ${testsuite_flags_script} --cxxflags)
 
 GLIBGCC_DIR = `$(CC) -print-libgcc-file-name | sed 's,/[^/]*$$,,'`
 GLIBCXX_DIR = ${glibcxx_builddir}/src/.libs
===================================================================
Index: gcc/varasm.c
--- gcc/varasm.c	4 Apr 2004 22:50:27 -0000	1.405.2.2
+++ gcc/varasm.c	14 Apr 2004 01:10:19 -0000
@@ -4504,16 +4504,16 @@ make_decl_one_only (tree decl)
 
   TREE_PUBLIC (decl) = 1;
 
-  if (TREE_CODE (decl) == VAR_DECL
-      && (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node))
-    DECL_COMMON (decl) = 1;
-  else if (SUPPORTS_ONE_ONLY)
+  if (SUPPORTS_ONE_ONLY)
     {
 #ifdef MAKE_DECL_ONE_ONLY
       MAKE_DECL_ONE_ONLY (decl);
 #endif
       DECL_ONE_ONLY (decl) = 1;
     }
+  else if (TREE_CODE (decl) == VAR_DECL
+      && (DECL_INITIAL (decl) == 0 || DECL_INITIAL (decl) == error_mark_node))
+    DECL_COMMON (decl) = 1;
   else if (SUPPORTS_WEAK)
     DECL_WEAK (decl) = 1;
   else



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