This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Duplicate symbols on HPPA HP-UX


When linking libstdc++ with the target hppa1.1-hp-hpux11.00 and using
the HP linker I am getting the following duplicate symbols:

/usr/ccs/bin/ld: Duplicate symbol "_GLOBAL__I__ZSt23lexicographical_compareIPKaS1_EbT_S2_T0_S3_" in files .libs/codecvt.o and .libs/ctype.o
/usr/ccs/bin/ld: Duplicate symbol "_GLOBAL__I__ZSt23lexicographical_compareIPKaS1_EbT_S2_T0_S3_" in files .libs/codecvt.o and .libs/io-inst.o
/usr/ccs/bin/ld: Duplicate symbol "_GLOBAL__I__ZSt23lexicographical_compareIPKaS1_EbT_S2_T0_S3_" in files .libs/codecvt.o and .libs/locale-inst.o
/usr/ccs/bin/ld: Duplicate symbols are not allowed in shared libraries
collect2: ld returned 1 exit status

I am not sure why others haven't seen this or exactly what change caused
this to appear, but it looks to me like the problem is in
include/bits/stl_algobase.h, where lexicographical_compare is not
declared to be inline.  Does the following patch look OK?  It fixes the
problem I am seeing and allows me to correctly build and link.  I will
check it in if someone approves it.

Steve Ellcey
sje@cup.hp.com

2003-10-03  Steve Ellcey  <sje@cup.hp.com>

	* include/bits/stl_algobase.h: (lexicographical_compare)
	Make inline.


*** gcc.orig/gcc/libstdc++-v3/include/bits/stl_algobase.h	Fri Oct  3 09:50:31 2003
--- gcc/gcc/libstdc++-v3/include/bits/stl_algobase.h	Fri Oct  3 09:51:24 2003
*************** namespace std
*** 706,712 ****
     *  then this is an inline call to @c memcmp.
    */
    template<typename _InputIterator1, typename _InputIterator2>
!     bool
      lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
  			    _InputIterator2 __first2, _InputIterator2 __last2)
      {
--- 706,712 ----
     *  then this is an inline call to @c memcmp.
    */
    template<typename _InputIterator1, typename _InputIterator2>
!     inline bool
      lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
  			    _InputIterator2 __first2, _InputIterator2 __last2)
      {
*************** namespace std
*** 741,747 ****
     *  comp parameter instead of @c <.
    */
    template<typename _InputIterator1, typename _InputIterator2, typename _Compare>
!     bool
      lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
  			    _InputIterator2 __first2, _InputIterator2 __last2,
  			    _Compare __comp)
--- 741,747 ----
     *  comp parameter instead of @c <.
    */
    template<typename _InputIterator1, typename _InputIterator2, typename _Compare>
!     inline bool
      lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1,
  			    _InputIterator2 __first2, _InputIterator2 __last2,
  			    _Compare __comp)


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