+2011-03-04 Benjamin Kosnik <bkoz@chula>
+
+ * src/Makefile.am (inst_sources): Make source instantion files
+ conditional.
+ (XTEMPLATE_FLAGS): Make -fno-implicit-templates conditional.
+ * src/Makefile.in: Regenerate.
+ * src/valarray-inst.cc: Move to..
+ * src/valarray.cc: ...this.
+ * acinclude.m4 (GLIBCXX_ENABLE_EXTERN_TEMPLATE]): Define.
+ * configure.ac (GLIBCXX_ENABLE_EXTERN_TEMPLATE): Use it.
+ * configure: Regenerate.
+ * include/Makefile.am (stamp-extern-template): Add.
+ * include/Makefile.in: Regenerate.
+
+ * doc/xml/manual/configure.xml: Document --enable-extern-template.
+
+ * include/bits/locale_classes.tcc: Adjust comment.
+ * include/bits/locale_facets.tcc: Same.
+ * include/bits/basic_ios.tcc: Same.
+ * include/bits/istream.tcc: Same.
+ * include/bits/codecvt.h: Same.
+ * include/bits/ostream.tcc: Same.
+ * include/bits/sstream.tcc: Same.
+ * include/bits/c++config: Same.
+ * include/bits/basic_string.tcc: Same.
+ * include/bits/ostream_insert.h: Same.
+ * include/bits/locale_facets_nonio.tcc: Same.
+ * include/bits/streambuf.tcc: Same.
+ * include/bits/allocator.h: Same.
+ * include/bits/fstream.tcc: Same.
+
+ * testsuite/ext/profile/mutex_extensions_neg.cc: Adjust line numbers.
+
2011-03-02 Benjamin Kosnik <bkoz@redhat.com>
- * testsuite/Makefile.am: Make clean fixups.
- * testsuite/Makefile.in: Regenerate.
+ * testsuite/Makefile.am: Make clean fixups.
+ * testsuite/Makefile.in: Regenerate.
2011-03-02 Marc Glisse <marc.glisse@normalesup.org>
fi
])
+dnl
+dnl Use extern templates.
+dnl
+dnl --enable-extern-template defines _GLIBCXX_EXTERN_TEMPLATE to 1
+dnl --disable-extern-template defines _GLIBCXX_EXTERN_TEMPLATE to 0
+
+dnl + Usage: GLIBCXX_ENABLE_TEMPLATE[(DEFAULT)]
+dnl Where DEFAULT is `yes' or `no'.
+dnl
+AC_DEFUN([GLIBCXX_ENABLE_EXTERN_TEMPLATE], [
+
+ GLIBCXX_ENABLE(extern-template,$1,,[enable extern template])
+
+ AC_MSG_CHECKING([for extern template support])
+ AC_MSG_RESULT([$enable_extern_template])
+
+ GLIBCXX_CONDITIONAL(ENABLE_EXTERN_TEMPLATE, test $enable_extern_template = yes)
+])
+
dnl
dnl Check for parallel mode pre-requisites, including OpenMP support.
dnl
OPT_LDFLAGS
SECTION_LDFLAGS
GLIBCXX_LIBS
+ENABLE_EXTERN_TEMPLATE_FALSE
+ENABLE_EXTERN_TEMPLATE_TRUE
EXTRA_CXX_FLAGS
ENABLE_PARALLEL_FALSE
ENABLE_PARALLEL_TRUE
enable_libstdcxx_debug
enable_cxx_flags
enable_fully_dynamic_string
+enable_extern_template
enable_libstdcxx_time
enable_tls
enable_rpath
--enable-fully-dynamic-string
do not put empty strings in per-process static
memory [default=no]
+ --enable-extern-template
+ enable extern template [default=yes]
--enable-libstdcxx-time[=KIND]
use KIND for check type [default=no]
--enable-tls Use thread-local storage [default=yes]
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11485 "configure"
+#line 11490 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 11591 "configure"
+#line 11596 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
#
# Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
cat > conftest.$ac_ext << EOF
-#line 14949 "configure"
+#line 14954 "configure"
struct S { ~S(); };
void bar();
void foo()
# Fake what AC_TRY_COMPILE does.
cat > conftest.$ac_ext << EOF
-#line 15317 "configure"
+#line 15322 "configure"
int main()
{
typedef bool atomic_type;
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15354 "configure"
+#line 15359 "configure"
int main()
{
typedef short atomic_type;
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15391 "configure"
+#line 15396 "configure"
int main()
{
// NB: _Atomic_word not necessarily int.
rm -f conftest*
cat > conftest.$ac_ext << EOF
-#line 15429 "configure"
+#line 15434 "configure"
int main()
{
typedef long long atomic_type;
# unnecessary for this test.
cat > conftest.$ac_ext << EOF
-#line 15505 "configure"
+#line 15510 "configure"
int main()
{
_Decimal32 d1;
fi
+
+ # Check whether --enable-extern-template was given.
+if test "${enable_extern_template+set}" = set; then :
+ enableval=$enable_extern_template;
+ case "$enableval" in
+ yes|no) ;;
+ *) as_fn_error "Argument to enable/disable extern-template must be yes or no" "$LINENO" 5 ;;
+ esac
+
+else
+ enable_extern_template=yes
+fi
+
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extern template support" >&5
+$as_echo_n "checking for extern template support... " >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_extern_template" >&5
+$as_echo "$enable_extern_template" >&6; }
+
+
+
+
# Checks for operating systems support that doesn't require linking.
fi
+ if test $enable_extern_template = yes; then
+ ENABLE_EXTERN_TEMPLATE_TRUE=
+ ENABLE_EXTERN_TEMPLATE_FALSE='#'
+else
+ ENABLE_EXTERN_TEMPLATE_TRUE='#'
+ ENABLE_EXTERN_TEMPLATE_FALSE=
+fi
+
+
if test $enable_symvers != no; then
ENABLE_SYMVERS_TRUE=
ENABLE_SYMVERS_FALSE='#'
as_fn_error "conditional \"ENABLE_PARALLEL\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${ENABLE_EXTERN_TEMPLATE_TRUE}" && test -z "${ENABLE_EXTERN_TEMPLATE_FALSE}"; then
+ as_fn_error "conditional \"ENABLE_EXTERN_TEMPLATE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${ENABLE_SYMVERS_TRUE}" && test -z "${ENABLE_SYMVERS_FALSE}"; then
as_fn_error "conditional \"ENABLE_SYMVERS\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
GLIBCXX_ENABLE_PARALLEL([yes])
GLIBCXX_ENABLE_CXX_FLAGS
GLIBCXX_ENABLE_FULLY_DYNAMIC_STRING([no])
+GLIBCXX_ENABLE_EXTERN_TEMPLATE([yes])
# Checks for operating systems support that doesn't require linking.
GLIBCXX_CHECK_SYSTEM_ERROR
</para>
</listitem></varlistentry>
+
+ <varlistentry><term><code>--enable-libstdcxx-time</code></term>
+ <listitem><para>This is an abbreviated form of
+ <code>'--enable-libstdcxx-time=yes'</code>(described next).
+ </para>
+ </listitem></varlistentry>
+
+ <varlistentry><term><code>--enable-libstdcxx-time=OPTION</code></term>
+ <listitem><para>Enables link-type checks for the availability of the
+ clock_gettime clocks, used in the implementation of [time.clock],
+ and of the nanosleep and sched_yield functions, used in the
+ implementation of [thread.thread.this] of the current C++0x draft.
+ The choice OPTION=yes checks for the availability of the facilities
+ in libc and libposix4. In case of need the latter is also linked
+ to libstdc++ as part of the build process. OPTION=rt also searches
+ (and, in case, links) librt. Note that the latter is not always
+ desirable because, in glibc, for example, in turn it triggers the
+ linking of libpthread too, which activates locking, a large overhead
+ for single-thread programs. OPTION=no skips the tests completely.
+ The default is OPTION=no.
+ </para>
+ </listitem></varlistentry>
+
<varlistentry><term><code>--enable-libstdcxx-debug</code></term>
<listitem><para>Build separate debug libraries in addition to what is normally built.
By default, the debug libraries are compiled with
</para>
</listitem></varlistentry>
+
+ <varlistentry><term><code>--enable-extern-template</code>[default]</term>
+ <listitem><para>Use extern template to pre-instantiate all required
+ specializations for certain types defined in the standard libraries.
+ These types include <classname>string</classname> and dependents like
+ <classname>char_traits</classname>, the templateized io classes,
+ <classname>allocator</classname>, and others.
+ Disabling means that implicit
+ template generation will be used when compiling these types. By
+ default, this option is on. This option can change the library ABI.
+ </para>
+ </listitem></varlistentry>
+
<varlistentry><term><code>--disable-hosted-libstdcxx</code></term>
<listitem>
<para>
</para>
</listitem></varlistentry>
- <varlistentry><term><code>--enable-libstdcxx-time</code></term>
- <listitem><para>This is an abbreviated form of
- <code>'--enable-libstdcxx-time=yes'</code>(described next).
- </para>
- </listitem></varlistentry>
-
- <varlistentry><term><code>--enable-libstdcxx-time=OPTION</code></term>
- <listitem><para>Enables link-type checks for the availability of the
- clock_gettime clocks, used in the implementation of [time.clock],
- and of the nanosleep and sched_yield functions, used in the
- implementation of [thread.thread.this] of the current C++0x draft.
- The choice OPTION=yes checks for the availability of the facilities
- in libc and libposix4. In case of need the latter is also linked
- to libstdc++ as part of the build process. OPTION=rt also searches
- (and, in case, links) librt. Note that the latter is not always
- desirable because, in glibc, for example, in turn it triggers the
- linking of libpthread too, which activates locking, a large overhead
- for single-thread programs. OPTION=no skips the tests completely.
- The default is OPTION=no.
- </para>
- </listitem></varlistentry>
-
</variablelist>
</section>
echo 0 > stamp-namespace-version
endif
+if ENABLE_EXTERN_TEMPLATE
+stamp-extern-template:
+ echo 1 > stamp-extern-template
+else
+stamp-extern-template:
+ echo 0 > stamp-extern-template
+endif
+
if ENABLE_VISIBILITY
stamp-visibility:
echo 1 > stamp-visibility
stamp-${host_alias} \
${toplevel_srcdir}/gcc/DATESTAMP \
stamp-namespace-version \
- stamp-visibility
+ stamp-visibility \
+ stamp-extern-template
@date=`cat ${toplevel_srcdir}/gcc/DATESTAMP` ;\
ns_version=`cat stamp-namespace-version` ;\
visibility=`cat stamp-visibility` ;\
+ externtemplate=`cat stamp-extern-template` ;\
ldbl_compat='s,g,g,' ;\
grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_LONG_DOUBLE_COMPAT[ ][ ]*1[ ]*$$" \
${CONFIG_HEADER} > /dev/null 2>&1 \
sed -e "s,define __GLIBCXX__,define __GLIBCXX__ $$date," \
-e "s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION $$ns_version," \
-e "s,define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY, define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY $$visibility," \
+ -e "s,define _GLIBCXX_EXTERN_TEMPLATE, define _GLIBCXX_EXTERN_TEMPLATE $$externtemplate," \
-e "$$ldbl_compat" \
< ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
@ENABLE_SYMVERS_GNU_NAMESPACE_FALSE@stamp-namespace-version:
@ENABLE_SYMVERS_GNU_NAMESPACE_FALSE@ echo 0 > stamp-namespace-version
+@ENABLE_EXTERN_TEMPLATE_TRUE@stamp-extern-template:
+@ENABLE_EXTERN_TEMPLATE_TRUE@ echo 1 > stamp-extern-template
+@ENABLE_EXTERN_TEMPLATE_FALSE@stamp-extern-template:
+@ENABLE_EXTERN_TEMPLATE_FALSE@ echo 0 > stamp-extern-template
+
@ENABLE_VISIBILITY_TRUE@stamp-visibility:
@ENABLE_VISIBILITY_TRUE@ echo 1 > stamp-visibility
@ENABLE_VISIBILITY_FALSE@stamp-visibility:
stamp-${host_alias} \
${toplevel_srcdir}/gcc/DATESTAMP \
stamp-namespace-version \
- stamp-visibility
+ stamp-visibility \
+ stamp-extern-template
@date=`cat ${toplevel_srcdir}/gcc/DATESTAMP` ;\
ns_version=`cat stamp-namespace-version` ;\
visibility=`cat stamp-visibility` ;\
+ externtemplate=`cat stamp-extern-template` ;\
ldbl_compat='s,g,g,' ;\
grep "^[ ]*#[ ]*define[ ][ ]*_GLIBCXX_LONG_DOUBLE_COMPAT[ ][ ]*1[ ]*$$" \
${CONFIG_HEADER} > /dev/null 2>&1 \
sed -e "s,define __GLIBCXX__,define __GLIBCXX__ $$date," \
-e "s,define _GLIBCXX_INLINE_VERSION, define _GLIBCXX_INLINE_VERSION $$ns_version," \
-e "s,define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY, define _GLIBCXX_HAVE_ATTRIBUTE_VISIBILITY $$visibility," \
+ -e "s,define _GLIBCXX_EXTERN_TEMPLATE, define _GLIBCXX_EXTERN_TEMPLATE $$externtemplate," \
-e "$$ldbl_compat" \
< ${glibcxx_srcdir}/include/bits/c++config > $@ ;\
sed -e 's/HAVE_/_GLIBCXX_HAVE_/g' \
// Allocators -*- C++ -*-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
-// Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
+// 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class allocator<char>;
extern template class allocator<wchar_t>;
#endif
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif
// basic_ios member functions -*- C++ -*-
// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-// 2009, 2010 Free Software Foundation, Inc.
+// 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_ios<char>;
#endif
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE > 0
extern template class basic_string<char>;
extern template
#endif
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif
// Special case: _GLIBCXX_EXTERN_TEMPLATE == -1 disallows extern
// templates only in basic_string, thus activating its debug-mode
// checks even at -O0.
-#ifndef _GLIBCXX_EXTERN_TEMPLATE
-# define _GLIBCXX_EXTERN_TEMPLATE 1
-#endif
+#define _GLIBCXX_EXTERN_TEMPLATE
/*
Outline of libstdc++ namespaces.
// Locale support (codecvt) -*- C++ -*-
// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-// 2009, 2010 Free Software Foundation, Inc.
+// 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class codecvt_byname<char, char, mbstate_t>;
#endif
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif // _CODECVT_H
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_filebuf<char>;
extern template class basic_ifstream<char>;
#endif
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_istream<char>;
extern template istream& ws(istream&);
#endif
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif
// Locale support -*- C++ -*-
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class collate<char>;
extern template class collate_byname<char>;
#endif
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif
// Locale support -*- C++ -*-
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007, 2008, 2009, 2010
+// 2006, 2007, 2008, 2009, 2010, 2011
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class numpunct<char>;
extern template class numpunct_byname<char>;
// Locale support -*- C++ -*-
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class moneypunct<char, false>;
extern template class moneypunct<char, true>;
#endif
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_ostream<char>;
extern template ostream& endl(ostream&);
#endif
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template ostream& __ostream_insert(ostream&, const char*, streamsize);
#endif
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif /* _OSTREAM_INSERT_H */
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_stringbuf<char>;
extern template class basic_istringstream<char>;
#endif
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
- // NB: This syntax is a GNU extension.
#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_streambuf<char>;
extern template
#endif
_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
+} // namespace std
#endif
## Makefile for the src subdirectory of the GNU C++ Standard library.
##
## Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
-## 2006, 2007, 2008, 2009, 2010
+## 2006, 2007, 2008, 2009, 2010, 2011
## Free Software Foundation, Inc.
##
## This file is part of the libstdc++ version 3 distribution.
messages_members.cc \
monetary_members.cc \
numeric_members.cc \
- time_members.cc
+ time_members.cc
codecvt_members.cc: ${glibcxx_srcdir}/$(CCODECVT_CC)
$(LN_S) ${glibcxx_srcdir}/$(CCODECVT_CC) . || true
# Source files linked in via configuration/make substitution for a
# particular host, but with ad hoc naming rules.
host_sources_extra = \
- basic_file.cc c++locale.cc ${ldbl_compat_sources} ${parallel_sources}
+ basic_file.cc c++locale.cc \
+ ${inst_sources} ${ldbl_compat_sources} ${parallel_sources}
c++locale.cc: ${glibcxx_srcdir}/$(CLOCALE_CC)
$(LN_S) ${glibcxx_srcdir}/$(CLOCALE_CC) ./$@ || true
if ENABLE_PARALLEL
parallel_sources = parallel_settings.cc \
- compatibility-parallel_list.cc \
- compatibility-parallel_list-2.cc
+ compatibility-parallel_list.cc \
+ compatibility-parallel_list-2.cc
else
parallel_sources =
endif
ldbl_compat_sources =
endif
-# Sources present in the src directory.
+if ENABLE_EXTERN_TEMPLATE
+XTEMPLATE_FLAGS = -fno-implicit-templates
+inst_sources = \
+ allocator-inst.cc \
+ concept-inst.cc \
+ ext-inst.cc \
+ fstream-inst.cc \
+ ios-inst.cc \
+ iostream-inst.cc \
+ istream-inst.cc \
+ locale-inst.cc \
+ misc-inst.cc \
+ ostream-inst.cc \
+ sstream-inst.cc \
+ streambuf-inst.cc \
+ string-inst.cc \
+ wlocale-inst.cc \
+ wstring-inst.cc
+else
+XTEMPLATE_FLAGS =
+inst_sources =
+endif
+
+# Sources present in the src directory, always present.
sources = \
atomic.cc \
bitmap_allocator.cc \
strstream.cc \
system_error.cc \
tree.cc \
- allocator-inst.cc \
- concept-inst.cc \
- fstream-inst.cc \
- ext-inst.cc \
- ios-inst.cc \
- iostream-inst.cc \
- istream-inst.cc \
istream.cc \
- locale-inst.cc \
- misc-inst.cc \
- ostream-inst.cc \
placeholders.cc \
regex.cc \
- sstream-inst.cc \
- streambuf-inst.cc \
streambuf.cc \
- string-inst.cc \
- valarray-inst.cc \
- wlocale-inst.cc \
- wstring-inst.cc \
mutex.cc \
condition_variable.cc \
chrono.cc \
thread.cc \
future.cc \
+ valarray.cc \
${host_sources} \
- ${host_sources_extra}
+ ${host_sources_extra}
vpath % $(top_srcdir)/src
vpath % $(top_srcdir)
$(top_builddir)/libsupc++/libsupc++convenience.la
libstdc___la_LDFLAGS = \
- -version-info $(libtool_VERSION) ${version_arg} -lm
+ -version-info $(libtool_VERSION) ${version_arg} -lm
libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS)
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion calls for it.
AM_CXXFLAGS = \
- -fno-implicit-templates \
+ $(XTEMPLATE_FLAGS) \
$(WARN_CXXFLAGS) \
$(OPTIMIZE_CXXFLAGS) \
$(CONFIG_CXXFLAGS)
# correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
# CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
# attempt to infer which configuration to use
-LTCXXCOMPILE = $(LIBTOOL) --tag CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \
- $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag CXX \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \
+ $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
am__objects_1 = atomicity.lo codecvt_members.lo collate_members.lo \
ctype_members.lo messages_members.lo monetary_members.lo \
numeric_members.lo time_members.lo
-@GLIBCXX_LDBL_COMPAT_TRUE@am__objects_2 = compatibility-ldbl.lo
-@ENABLE_PARALLEL_TRUE@am__objects_3 = parallel_settings.lo \
+@ENABLE_EXTERN_TEMPLATE_TRUE@am__objects_2 = allocator-inst.lo \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ concept-inst.lo ext-inst.lo \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ fstream-inst.lo ios-inst.lo \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ iostream-inst.lo istream-inst.lo \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ locale-inst.lo misc-inst.lo \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ ostream-inst.lo sstream-inst.lo \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ streambuf-inst.lo string-inst.lo \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ wlocale-inst.lo wstring-inst.lo
+@GLIBCXX_LDBL_COMPAT_TRUE@am__objects_3 = compatibility-ldbl.lo
+@ENABLE_PARALLEL_TRUE@am__objects_4 = parallel_settings.lo \
@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list.lo \
@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list-2.lo
-am__objects_4 = basic_file.lo c++locale.lo $(am__objects_2) \
- $(am__objects_3)
-am__objects_5 = atomic.lo bitmap_allocator.lo pool_allocator.lo \
+am__objects_5 = basic_file.lo c++locale.lo $(am__objects_2) \
+ $(am__objects_3) $(am__objects_4)
+am__objects_6 = atomic.lo bitmap_allocator.lo pool_allocator.lo \
mt_allocator.lo codecvt.lo compatibility.lo \
compatibility-c++0x.lo compatibility-debug_list.lo \
compatibility-debug_list-2.lo compatibility-list.lo \
ios_init.lo ios_locale.lo limits.lo list.lo locale.lo \
locale_init.lo locale_facets.lo localename.lo \
math_stubs_float.lo math_stubs_long_double.lo stdexcept.lo \
- strstream.lo system_error.lo tree.lo allocator-inst.lo \
- concept-inst.lo fstream-inst.lo ext-inst.lo ios-inst.lo \
- iostream-inst.lo istream-inst.lo istream.lo locale-inst.lo \
- misc-inst.lo ostream-inst.lo placeholders.lo regex.lo \
- sstream-inst.lo streambuf-inst.lo streambuf.lo string-inst.lo \
- valarray-inst.lo wlocale-inst.lo wstring-inst.lo mutex.lo \
+ strstream.lo system_error.lo tree.lo istream.lo \
+ placeholders.lo regex.lo streambuf.lo mutex.lo \
condition_variable.lo chrono.lo thread.lo future.lo \
- $(am__objects_1) $(am__objects_4)
-am_libstdc___la_OBJECTS = $(am__objects_5)
+ valarray.lo $(am__objects_1) $(am__objects_5)
+am_libstdc___la_OBJECTS = $(am__objects_6)
libstdc___la_OBJECTS = $(am_libstdc___la_OBJECTS)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp =
messages_members.cc \
monetary_members.cc \
numeric_members.cc \
- time_members.cc
+ time_members.cc
atomicity_file = ${glibcxx_srcdir}/$(ATOMICITY_SRCDIR)/atomicity.h
# Source files linked in via configuration/make substitution for a
# particular host, but with ad hoc naming rules.
host_sources_extra = \
- basic_file.cc c++locale.cc ${ldbl_compat_sources} ${parallel_sources}
+ basic_file.cc c++locale.cc \
+ ${inst_sources} ${ldbl_compat_sources} ${parallel_sources}
@ENABLE_PARALLEL_FALSE@parallel_sources =
@ENABLE_PARALLEL_TRUE@parallel_sources = parallel_settings.cc \
-@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list.cc \
-@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list-2.cc
+@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list.cc \
+@ENABLE_PARALLEL_TRUE@ compatibility-parallel_list-2.cc
@GLIBCXX_LDBL_COMPAT_FALSE@ldbl_compat_sources =
@GLIBCXX_LDBL_COMPAT_TRUE@ldbl_compat_sources = compatibility-ldbl.cc
-
-# Sources present in the src directory.
+@ENABLE_EXTERN_TEMPLATE_FALSE@XTEMPLATE_FLAGS =
+@ENABLE_EXTERN_TEMPLATE_TRUE@XTEMPLATE_FLAGS = -fno-implicit-templates
+@ENABLE_EXTERN_TEMPLATE_FALSE@inst_sources =
+@ENABLE_EXTERN_TEMPLATE_TRUE@inst_sources = \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ allocator-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ concept-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ ext-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ fstream-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ ios-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ iostream-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ istream-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ locale-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ misc-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ ostream-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ sstream-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ streambuf-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ string-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ wlocale-inst.cc \
+@ENABLE_EXTERN_TEMPLATE_TRUE@ wstring-inst.cc
+
+
+# Sources present in the src directory, always present.
sources = \
atomic.cc \
bitmap_allocator.cc \
strstream.cc \
system_error.cc \
tree.cc \
- allocator-inst.cc \
- concept-inst.cc \
- fstream-inst.cc \
- ext-inst.cc \
- ios-inst.cc \
- iostream-inst.cc \
- istream-inst.cc \
istream.cc \
- locale-inst.cc \
- misc-inst.cc \
- ostream-inst.cc \
placeholders.cc \
regex.cc \
- sstream-inst.cc \
- streambuf-inst.cc \
streambuf.cc \
- string-inst.cc \
- valarray-inst.cc \
- wlocale-inst.cc \
- wstring-inst.cc \
mutex.cc \
condition_variable.cc \
chrono.cc \
thread.cc \
future.cc \
+ valarray.cc \
${host_sources} \
- ${host_sources_extra}
+ ${host_sources_extra}
libstdc___la_SOURCES = $(sources)
libstdc___la_LIBADD = \
$(top_builddir)/libsupc++/libsupc++convenience.la
libstdc___la_LDFLAGS = \
- -version-info $(libtool_VERSION) ${version_arg} -lm
+ -version-info $(libtool_VERSION) ${version_arg} -lm
libstdc___la_LINK = $(CXXLINK) $(libstdc___la_LDFLAGS)
# OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden
# as the occasion calls for it.
AM_CXXFLAGS = \
- -fno-implicit-templates \
+ $(XTEMPLATE_FLAGS) \
$(WARN_CXXFLAGS) \
$(OPTIMIZE_CXXFLAGS) \
$(CONFIG_CXXFLAGS)
# correct solution is to add `--tag CXX' to LTCXXCOMPILE and maybe
# CXXLINK, just after $(LIBTOOL), so that libtool doesn't have to
# attempt to infer which configuration to use
-LTCXXCOMPILE = $(LIBTOOL) --tag CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \
- $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag CXX \
+ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile \
+ $(CXX) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CXXFLAGS) $(CXXFLAGS)
LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/../libtool-ldflags $(LDFLAGS))
+++ /dev/null
-// Explicit instantiation file.
-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009
-// Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
-// <http://www.gnu.org/licenses/>.
-
-//
-// ISO C++ 14882:
-//
-
-#include <valarray>
-
-namespace std _GLIBCXX_VISIBILITY(default)
-{
-_GLIBCXX_BEGIN_NAMESPACE_VERSION
-
- // Some explicit instantiations.
- template void
- __valarray_fill(size_t* __restrict__, size_t, const size_t&);
-
- template void
- __valarray_copy(const size_t* __restrict__, size_t, size_t* __restrict__);
-
- template valarray<size_t>::valarray(size_t);
- template valarray<size_t>::valarray(const valarray<size_t>&);
- template valarray<size_t>::~valarray();
- template size_t valarray<size_t>::size() const;
- template size_t& valarray<size_t>::operator[](size_t);
-
- inline size_t
- __valarray_product(const valarray<size_t>& __a)
- {
- typedef const size_t* __restrict__ _Tp;
- const size_t __n = __a.size();
- // XXX: This ugly cast is necessary because
- // valarray::operator[]() const return a VALUE!
- // Try to get the committee to correct that gross error.
- valarray<size_t>& __t = const_cast<valarray<size_t>&>(__a);
- return __valarray_product(&__t[0], &__t[0] + __n);
- }
-
- // Map a gslice, described by its multidimensional LENGTHS
- // and corresponding STRIDES, to a linear array of INDEXES
- // for the purpose of indexing a flat, one-dimensional array
- // representation of a gslice_array.
- void
- __gslice_to_index(size_t __o, const valarray<size_t>& __l,
- const valarray<size_t>& __s, valarray<size_t>& __i)
- {
- // There are as many dimensions as there are strides.
- const size_t __n = __l.size();
-
- // Holds current multi-index as we go through the gslice for the
- // purpose of computing its linear-image.
- valarray<size_t> __t(__l);
-
- // Note that this should match the product of all numbers appearing
- // in __l which describes the multidimensional sizes of the
- // generalized slice.
- const size_t __z = __i.size();
-
- for (size_t __j = 0; __j < __z; ++__j)
- {
- // Compute the linear-index image of (t_0, ... t_{n-1}).
- __i[__j] = __o;
-
- --__t[__n - 1];
- __o += __s[__n - 1];
-
- // Process the next multi-index. The loop ought to be
- // backward since we're making a lexicographical visit.
- for (size_t __k2 = __n - 1; __k2 && !__t[__k2]; --__k2)
- {
- __o -= __s[__k2] * __l[__k2];
- __t[__k2] = __l[__k2];
-
- --__t[__k2 - 1];
- __o += __s[__k2 - 1];
- }
- }
- }
-
- gslice::_Indexer::_Indexer(size_t __o, const valarray<size_t>& __l,
- const valarray<size_t>& __s)
- : _M_count(1), _M_start(__o), _M_size(__l), _M_stride(__s),
- _M_index(__l.size() == 0 ? 0 : __valarray_product(__l))
- { __gslice_to_index(__o, __l, __s, _M_index); }
-
-_GLIBCXX_END_NAMESPACE_VERSION
-} // namespace
--- /dev/null
+// Explicit instantiation file.
+
+// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2009
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+// <http://www.gnu.org/licenses/>.
+
+//
+// ISO C++ 14882:
+//
+
+#include <valarray>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+ // Some explicit instantiations.
+ template void
+ __valarray_fill(size_t* __restrict__, size_t, const size_t&);
+
+ template void
+ __valarray_copy(const size_t* __restrict__, size_t, size_t* __restrict__);
+
+ template valarray<size_t>::valarray(size_t);
+ template valarray<size_t>::valarray(const valarray<size_t>&);
+ template valarray<size_t>::~valarray();
+ template size_t valarray<size_t>::size() const;
+ template size_t& valarray<size_t>::operator[](size_t);
+
+ inline size_t
+ __valarray_product(const valarray<size_t>& __a)
+ {
+ typedef const size_t* __restrict__ _Tp;
+ const size_t __n = __a.size();
+ // XXX: This ugly cast is necessary because
+ // valarray::operator[]() const return a VALUE!
+ // Try to get the committee to correct that gross error.
+ valarray<size_t>& __t = const_cast<valarray<size_t>&>(__a);
+ return __valarray_product(&__t[0], &__t[0] + __n);
+ }
+
+ // Map a gslice, described by its multidimensional LENGTHS
+ // and corresponding STRIDES, to a linear array of INDEXES
+ // for the purpose of indexing a flat, one-dimensional array
+ // representation of a gslice_array.
+ void
+ __gslice_to_index(size_t __o, const valarray<size_t>& __l,
+ const valarray<size_t>& __s, valarray<size_t>& __i)
+ {
+ // There are as many dimensions as there are strides.
+ const size_t __n = __l.size();
+
+ // Holds current multi-index as we go through the gslice for the
+ // purpose of computing its linear-image.
+ valarray<size_t> __t(__l);
+
+ // Note that this should match the product of all numbers appearing
+ // in __l which describes the multidimensional sizes of the
+ // generalized slice.
+ const size_t __z = __i.size();
+
+ for (size_t __j = 0; __j < __z; ++__j)
+ {
+ // Compute the linear-index image of (t_0, ... t_{n-1}).
+ __i[__j] = __o;
+
+ --__t[__n - 1];
+ __o += __s[__n - 1];
+
+ // Process the next multi-index. The loop ought to be
+ // backward since we're making a lexicographical visit.
+ for (size_t __k2 = __n - 1; __k2 && !__t[__k2]; --__k2)
+ {
+ __o -= __s[__k2] * __l[__k2];
+ __t[__k2] = __l[__k2];
+
+ --__t[__k2 - 1];
+ __o += __s[__k2 - 1];
+ }
+ }
+ }
+
+ gslice::_Indexer::_Indexer(size_t __o, const valarray<size_t>& __l,
+ const valarray<size_t>& __s)
+ : _M_count(1), _M_start(__o), _M_size(__l), _M_stride(__s),
+ _M_index(__l.size() == 0 ? 0 : __valarray_product(__l))
+ { __gslice_to_index(__o, __l, __s, _M_index); }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
#include <vector>
-// { dg-error "multiple inlined namespaces" "" { target *-*-* } 243 }
+// { dg-error "multiple inlined namespaces" "" { target *-*-* } 241 }