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]

libstdc++ build question (Duplicate symbols)


I am having trouble building libstdc++-v3 on HP-UX IA64 and was
wondering if anyone could shed some light on what I am seeing.

There are two oddities that I see, I don't know if one or the other or
both is a bug.

The first is when I compile src/ios.cc, it includes ios, which includes
bits/localefwd.h which includes string, which includes basic_string.h
which has the template class basic_string.

If I compile this with -O0 everything appears fine, if I compile this
with -O2 I get a definition of the function _ZNKSs6_M_repEv, or (from
c++filt):

	std::basic_string<char, std::char_traits<char>,
		std::allocator<char> >::_M_rep() const

Why should I get this only when optimizing?

This might not be a problem except that I get another definition of this
when I compile src/functexcept.cc (with -O2) because it also includes
string (via an include of ios) and the HP linker does not like two
definitions of a function when building a shared library.

I am not sure if I should never be getting this in either file, or
always be getting it but only in one file.

Any help?  I tried using -fno-inline and -fno-inline-functions, these
didn't seem to affect the existence of this function.   The build is
being done with -fdata-sections and -ffunction-sections.

Steve Ellcey
sje@cup.hp.com


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