Bug 15546 - [4.0 Regression] Bootstrap stage3: Undefined references to basic_string
Summary: [4.0 Regression] Bootstrap stage3: Undefined references to basic_string
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: bootstrap (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Zack Weinberg
URL:
Keywords: build, wrong-code
Depends on: 15721
Blocks:
  Show dependency treegraph
 
Reported: 2004-05-19 23:34 UTC by James McKelvey
Modified: 2005-02-09 02:18 UTC (History)
3 users (show)

See Also:
Host: sparc-sun-solaris2.7
Target: sparc-sun-solaris2.7,ia64-suse-linux
Build: sparc-sun-solaris2.7
Known to work:
Known to fail:
Last reconfirmed: 2004-05-20 16:27:51


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James McKelvey 2004-05-19 23:34:27 UTC
Build failure in stage 3, latest CVS, linking abi_check

mushroom~...gcc-obj>uname -a
SunOS mushroom 5.7 Generic_106541-19 sun4u sparc SUNW,Ultra-2

mushroom~...gcc-obj>alias CONFIGURE
setenv CC gcc ; /mnt/home3/utilities/gcc/configure
--prefix=/mnt/home3/utilities --verbose --with-as=/mnt/home3/utilities/bin/as
--with-ld=/mnt/home3/utilities/bin/ld --with-gnu-as --with-gnu-ld
--disable-multilib --disable-libmudflap --enable-languages=c++

mushroom~...gcc-obj>alias BUILD
nice gmake CFLAGS='-O' BOOT_CFLAGS='-O' LIBCFLAGS='-g -O' CXXFLAGS='-O'
LIBCXXFLAGS='-g -O -fno-implicit-templates' bootstrap


/export/home/mckelvey/utilities/gcc-obj/gcc/g++ -shared-libgcc
-B/export/home/mckelvey/utilities/gcc-obj/gcc/ -nostdinc++
-B/mnt/home3/utilities/sparc-sun-solaris2.7/bin/
-B/mnt/home3/utilities/sparc-sun-solaris2.7/lib/ -isystem
/mnt/home3/utilities/sparc-sun-solaris2.7/include -isystem
/mnt/home3/utilities/sparc-sun-solaris2.7/sys-include -g -O2 -D_GLIBCXX_ASSERT
-ffunction-sections -fdata-sections -fmessage-length=0
-DLOCALEDIR=/export/home/mckelvey/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/po/share/locale
-O -o abi_check abi_check.o 
-L/export/home/mckelvey/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/src
-L/export/home/mckelvey/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/src/.libs
-lv3test
-L/export/home/mckelvey/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/testsuite
-lm -Wl,--rpath -Wl,/export/home/mckelvey/utilities/gcc-obj/gcc -Wl,--rpath
-Wl,/export/home/mckelvey/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/src/.libs
/export/home/mckelvey/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/testsuite/libv3test.a(testsuite_abi.o)(.gnu.linkonce.t._ZNSs12_S_constructIN9__gnu_cxx17__normal_iteratorIPcSsEEEES2_T_S4_RKSaIcESt20forward_iterator_tag+0xb8):
In function `char* std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_S_construct<__gnu_cxx::__normal_iterator<char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
>(__gnu_cxx::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
__gnu_cxx::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >, std::allocator<char> const&,
std::forward_iterator_tag)':
/mnt/home3/utilities/gcc/libstdc++-v3/testsuite/testsuite_abi.cc:210: undefined
reference to `std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_Rep::_S_terminal'
/export/home/mckelvey/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/testsuite/libv3test.a(testsuite_abi.o)(.gnu.linkonce.t._ZNSs12_S_constructIN9__gnu_cxx17__normal_iteratorIPcSsEEEES2_T_S4_RKSaIcESt20forward_iterator_tag+0xbc):/mnt/home3/utilities/gcc/libstdc++-v3/testsuite/testsuite_abi.cc:106:
undefined reference to `std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_Rep::_S_terminal'
/export/home/mckelvey/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/src/.libs/libstdc++.so:
undefined reference to `std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >::_Rep::_S_max_size'
/export/home/mckelvey/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/src/.libs/libstdc++.so:
undefined reference to `std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_Rep::_S_max_size'
collect2: ld returned 1 exit status
gmake[4]: *** [abi_check] Error 1
gmake[4]: Leaving directory
`/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/testsuite'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory
`/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory
`/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3'
gmake[1]: *** [all-target-libstdc++-v3] Error 2
gmake[1]: Leaving directory `/mnt/home3/utilities/gcc-obj'
gmake: *** [bootstrap] Error 2
Comment 1 Andrew Pinski 2004-05-19 23:54:45 UTC
Something is being miscompiled.
Comment 2 Andrew Pinski 2004-05-20 01:11:06 UTC
What was the last entry in the ChangeLog?
Comment 3 James McKelvey 2004-05-20 15:10:19 UTC
(In reply to comment #2)
> What was the last entry in the ChangeLog?

ChangeLog

2004-05-18  Kaz Kojima  <kkojima@gcc.gnu.org>

	PR bootstrap/15120
	* libtool.m4 (lt_cv_deplibs_check_method): Use pass_all on sh*.
	* */configure: Rebuilt.

gcc/ChangeLog
2004-05-19  Jeff Law <law@redhat.com>

	* tree-ssa-phiopt.c (value_replacement): Handle the case where
	the desired edge out of COND_BLOCK reaches OTHER_BLOCK rather than
	BB directly.

libstdc++-v3/ChangeLog
2004-05-18  Jonathan Wakely  <redi@gcc.gnu.org>

	* include/ext/stdio_filebuf.h: Update comments to reflect PR 11691.
Comment 4 James McKelvey 2004-05-20 15:16:18 UTC
(In reply to comment #1)
> Something is being miscompiled.

I'm using the compiler below, and building in a separate tree as recommended.

Reading specs from /mnt/home3/utilities/lib/gcc/sparc-sun-solaris2.7/3.5.0/specs
Configured with: /mnt/home3/utilities/gcc/configure
--prefix=/mnt/home3/utilities --verbose --with-as=/mnt/home3/utilities/bin/as
--with-ld=/mnt/home3/utilities/bin/ld --with-gnu-as --with-gnu-ld
--disable-multilib --enable-languages=c++
Thread model: posix
gcc version 3.5.0 20040324 (experimental)
Comment 5 Andrew Pinski 2004-05-20 15:19:13 UTC
This is a cgraph problem, it might be that some of the functions are not being marked as needed so 
they are not being outputed.
Comment 6 Andreas Schwab 2004-05-20 16:27:51 UTC
It's caused by Zack's cgraph patches, also happens on ia64. 
Comment 7 Andrew Pinski 2004-05-21 13:31:10 UTC
For x86_64, can someone test this patch:
Index: i386.c
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.668
diff -u -p -r1.668 i386.c
--- i386.c	17 May 2004 15:23:12 -0000	1.668
+++ i386.c	21 May 2004 13:30:26 -0000
@@ -6762,6 +6762,10 @@ output_pic_addr_const (FILE *file, rtx x
       break;
 
     case SYMBOL_REF:
+     /* Mark the decl as referenced so that cgraph will output the function.  */
+     if (SYMBOL_REF_DECL (x))
+       mark_decl_referenced (SYMBOL_REF_DECL (x));
+
       assemble_name (file, XSTR (x, 0));
       if (!TARGET_MACHO && code == 'P' && ! SYMBOL_REF_LOCAL_P (x))
 	fputs ("@PLT", file);
Comment 8 Zack Weinberg 2004-05-21 19:26:34 UTC
Subject: Re:  [3.5 Regression] Bootstrap stage3:
 Undefined references to basic_string


I am testing this patch along with a fix for the hash-tables-and-PCH
bug.

zw
Comment 9 Zack Weinberg 2004-05-22 18:13:28 UTC
Confirm Andrew's patch fixes the bug, will check it in shortly.
Comment 10 GCC Commits 2004-05-22 18:19:00 UTC
Subject: Bug 15546

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	zack@gcc.gnu.org	2004-05-22 18:18:51

Modified files:
	gcc            : ChangeLog 
	gcc/config/i386: i386.c 

Log message:
	2004-05-22  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR 15546
	* config/i386/i386.c (output_pic_addr_const <case SYMBOL_REF>):
	Call mark_decl_referenced on the SYMBOL_REF_DECL.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3727&r2=2.3728
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/i386/i386.c.diff?cvsroot=gcc&r1=1.668&r2=1.669

Comment 11 Zack Weinberg 2004-05-22 18:19:37 UTC
fixed.
Comment 12 Andreas Schwab 2004-05-22 19:57:02 UTC
Not fixed.  This bug is about sparc and ia64, not i386. 
Comment 13 Andrew Pinski 2004-05-22 20:17:30 UTC
I think this is C++ front-end bug, I am looking into it as there are a couple of failures on powerpc-
apple-darwin which were caused by the patch but not fixed by my patch to fix PPC.
Comment 14 Zack Weinberg 2004-05-22 20:47:47 UTC
Every call to assemble_name probably needs auditing.
Comment 15 Andrew Pinski 2004-05-22 20:51:32 UTC
Yes that fix was for x86/x86_64 but the regressions that used to be on PPC that looked related are 
fixed, Is this fixed with all of Zack's patches?
Comment 16 Andrew Pinski 2004-05-25 12:50:17 UTC
I think the following patch should fix ia64, can someone test it as I do not have access to a machine.
Index: ia64.h
===============================================================
====
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.h,v
retrieving revision 1.175
diff -u -p -r1.175 ia64.h
--- ia64.h	13 May 2004 06:40:00 -0000	1.175
+++ ia64.h	25 May 2004 12:48:41 -0000
@@ -1478,6 +1478,7 @@ do {							
		\
         fputs ("\tdata8.ua @iplt(", FILE);				\
       else								\
         fputs ("\tdata16.ua @iplt(", FILE);				\
+      mark_decl_referenced (DECL);					\
       assemble_name (FILE, XSTR (XEXP (DECL_RTL (DECL), 0), 0));
	\
       fputs (")\n", FILE);						\
       if (TARGET_ILP32)							\
Comment 17 Andreas Schwab 2004-05-25 14:31:46 UTC
Looks good. Bootstrap still running but libstdc++ has been successfully built. 
Comment 18 Zack Weinberg 2004-05-25 16:50:34 UTC
Subject: Re:  [3.5 Regression] Bootstrap stage3:
 Undefined references to basic_string


I'll approve this conditionally on someone verifying that it works -
it's the right form of patch for this problem.

zw
Comment 19 Andrew Pinski 2004-05-25 16:53:40 UTC
I am going to assume that these results here: <http://gcc.gnu.org/ml/gcc-testresults/2004-05/
msg01173.html> is after the patch, thanks Andreas for testing it so I am going to apply it now.
Comment 20 GCC Commits 2004-05-25 17:05:48 UTC
Subject: Bug 15546

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	pinskia@gcc.gnu.org	2004-05-25 17:05:46

Modified files:
	gcc            : ChangeLog 
	gcc/config/ia64: ia64.h 

Log message:
	2004-05-25  Andrew Pinski  <pinskia@physics.uc.edu>
	
	PR target/15546
	* config/ia64/ia64.h (ASM_OUTPUT_FDESC): Mark the DECL
	as needed to be outputted.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.3745&r2=2.3746
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/ia64/ia64.h.diff?cvsroot=gcc&r1=1.175&r2=1.176

Comment 21 Andrew Pinski 2004-05-25 17:08:38 UTC
I assume that this also fixed for sparc-sun-solaris2.7 as there was a testresults from that today: <http:
//gcc.gnu.org/ml/gcc-testresults/2004-05/msg01125.html>.  So closing as fixed.
Comment 22 James McKelvey 2004-06-01 23:02:48 UTC
Showed up again last Wednesday (couldn't report until today); repeats today with
latest CVS:

/mnt/home3/utilities/gcc-obj/gcc/g++ -shared-libgcc
-B/mnt/home3/utilities/gcc-obj/gcc/ -nostdinc++
-B/mnt/home3/utilities/sparc-sun-solaris2.7/bin/
-B/mnt/home3/utilities/sparc-sun-solaris2.7/lib/ -isystem
/mnt/home3/utilities/sparc-sun-solaris2.7/include -isystem
/mnt/home3/utilities/sparc-sun-solaris2.7/sys-include -g -O2 -D_GLIBCXX_ASSERT
-ffunction-sections -fdata-sections -fmessage-length=0
-DLOCALEDIR=/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/po/share/locale
-O -o abi_check abi_check.o 
-L/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/src
-L/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/src/.libs
-lv3test
-L/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/testsuite -lm
-Wl,--rpath -Wl,/mnt/home3/utilities/gcc-obj/gcc -Wl,--rpath
-Wl,/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/src/.libs
/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/testsuite/libv3test.a(testsuite_abi.o)(.gnu.linkonce.t._ZNSs12_S_constructIN9__gnu_cxx17__normal_iteratorIPcSsEEEES2_T_S4_RKSaIcESt20forward_iterator_tag+0xb8):
In function `char* std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_S_construct<__gnu_cxx::__normal_iterator<char*,
std::basic_string<char, std::char_traits<char>, std::allocator<char> > >
>(__gnu_cxx::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
__gnu_cxx::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >, std::allocator<char> const&,
std::forward_iterator_tag)':
/mnt/home3/utilities/gcc/libstdc++-v3/testsuite/testsuite_abi.cc:211: undefined
reference to `std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_Rep::_S_terminal'
/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/testsuite/libv3test.a(testsuite_abi.o)(.gnu.linkonce.t._ZNSs12_S_constructIN9__gnu_cxx17__normal_iteratorIPcSsEEEES2_T_S4_RKSaIcESt20forward_iterator_tag+0xbc):/mnt/home3/utilities/gcc/libstdc++-v3/testsuite/testsuite_abi.cc:106:
undefined reference to `std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_Rep::_S_terminal'
/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/src/.libs/libstdc++.so:
undefined reference to `std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >::_Rep::_S_max_size'
/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/src/.libs/libstdc++.so:
undefined reference to `std::basic_string<char, std::char_traits<char>,
std::allocator<char> >::_Rep::_S_max_size'
collect2: ld returned 1 exit status
gmake[4]: *** [abi_check] Error 1
gmake[4]: Leaving directory
`/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3/testsuite'
gmake[3]: *** [all-recursive] Error 1
gmake[3]: Leaving directory
`/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3'
gmake[2]: *** [all] Error 2
gmake[2]: Leaving directory
`/mnt/home3/utilities/gcc-obj/sparc-sun-solaris2.7/libstdc++-v3'
gmake[1]: *** [all-target-libstdc++-v3] Error 2
gmake[1]: Leaving directory `/mnt/home3/utilities/gcc-obj'
gmake: *** [bootstrap] Error 2
Comment 23 Andrew Pinski 2004-06-01 23:45:25 UTC
I almost think this is the same problem as PR 15721, why it does not effect anything except for solaris I 
do not know.
Comment 24 Andrew Pinski 2004-06-19 16:18:31 UTC
Can try again now that 15721 is fixed?
Comment 25 James McKelvey 2004-06-22 14:58:12 UTC
(In reply to comment #24)
> Can try again now that 15721 is fixed?

Builds fine now. Thanks!
Comment 26 Andrew Pinski 2004-06-22 15:27:08 UTC
Fixed.