xref: /netbsd-src/external/gpl3/gcc/dist/libstdc++-v3/doc/xml/manual/configure.xml (revision 0a3071956a3a9fdebdbf7f338cf2d439b45fc728)
148fb7bfaSmrg<section xmlns="http://docbook.org/ns/docbook" version="5.0"
248fb7bfaSmrg	 xml:id="manual.intro.setup.configure" xreflabel="Configuring">
34fee23f9Smrg<?dbhtml filename="configure.html"?>
44fee23f9Smrg
548fb7bfaSmrg<info><title>Configure</title>
64fee23f9Smrg  <keywordset>
748fb7bfaSmrg    <keyword>ISO C++</keyword>
848fb7bfaSmrg    <keyword>configure</keyword>
948fb7bfaSmrg    <keyword>options</keyword>
104fee23f9Smrg  </keywordset>
1148fb7bfaSmrg</info>
124fee23f9Smrg
1348fb7bfaSmrg
144fee23f9Smrg
154fee23f9Smrg<para>
164fee23f9Smrg  When configuring libstdc++, you'll have to configure the entire
174fee23f9Smrg  <emphasis>gccsrcdir</emphasis> directory. Consider using the
184fee23f9Smrg  toplevel gcc configuration option
194fee23f9Smrg  <literal>--enable-languages=c++</literal>, which saves time by only
204fee23f9Smrg  building the C++ toolchain.
214fee23f9Smrg</para>
224fee23f9Smrg
234fee23f9Smrg<para>
244fee23f9Smrg  Here are all of the configure options specific to libstdc++.  Keep
254fee23f9Smrg  in mind that
264fee23f9Smrg   <!-- This SECnn should be the "Choosing Package Options" section. -->
2748fb7bfaSmrg   <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://sourceware.org/autobook/autobook/autobook_14.html">they
2848fb7bfaSmrg   all have opposite forms as well</link> (enable/disable and
294fee23f9Smrg   with/without).  The defaults are for the <emphasis>current
304fee23f9Smrg   development sources</emphasis>, which may be different than those
314fee23f9Smrg   for released versions.
324fee23f9Smrg</para>
334fee23f9Smrg<para>The canonical way to find out the configure options that are
344fee23f9Smrg   available for a given set of libstdc++ sources is to go to the
354fee23f9Smrg   source directory and then type: <command>./configure --help</command>.
364fee23f9Smrg</para>
374fee23f9Smrg
384fee23f9Smrg<variablelist>
394fee23f9Smrg <varlistentry><term><code>--enable-multilib</code>[default]</term>
404fee23f9Smrg <listitem><para>This is part of the generic multilib support for building cross
4148fb7bfaSmrg	compilers.  As such, targets like "powerpc-elf" will have
4248fb7bfaSmrg	libstdc++ built many different ways:  "-msoft-float"
434fee23f9Smrg	and not, etc.  A different libstdc++ will be built for each of
444fee23f9Smrg	the different multilib versions.  This option is on by default.
454fee23f9Smrg     </para>
464fee23f9Smrg </listitem></varlistentry>
474fee23f9Smrg
484fee23f9Smrg <varlistentry><term><code>--enable-version-specific-runtime-libs</code></term>
494fee23f9Smrg <listitem><para>Specify that run-time libraries should be installed in the
504fee23f9Smrg	compiler-specific subdirectory (i.e.,
514fee23f9Smrg	<code>${libdir}/gcc-lib/${target_alias}/${gcc_version}</code>)
524fee23f9Smrg	instead of <code>${libdir}</code>.  This option is useful if you
534fee23f9Smrg	intend to use several versions of gcc in parallel.  In addition,
544fee23f9Smrg	libstdc++'s include files will be installed in
554fee23f9Smrg	<code>${libdir}/gcc-lib/${target_alias}/${gcc_version}/include/g++</code>,
564fee23f9Smrg	unless you also specify
5748fb7bfaSmrg       <literal>--with-gxx-include-dir=</literal><filename class="directory">dirname</filename> during configuration.
584fee23f9Smrg     </para>
594fee23f9Smrg </listitem></varlistentry>
604fee23f9Smrg
614fee23f9Smrg <varlistentry><term><code>--with-gxx-include-dir=&lt;include-files dir&gt;</code></term>
624fee23f9Smrg <listitem><para>Adds support for named libstdc++ include directory.  For instance,
634fee23f9Smrg	the following puts all the libstdc++ headers into a directory
6448fb7bfaSmrg	called "4.4-20090404" instead of the usual
6548fb7bfaSmrg	"c++/(version)".
664fee23f9Smrg     </para>
674fee23f9Smrg	<programlisting>
684fee23f9Smrg   --with-gxx-include-dir=/foo/H-x86-gcc-3-c-gxx-inc/include/4.4-20090404</programlisting> </listitem></varlistentry>
694fee23f9Smrg
704fee23f9Smrg <varlistentry><term><code>--enable-cstdio</code></term>
714fee23f9Smrg <listitem><para>This is an abbreviated form of <code>'--enable-cstdio=stdio'</code>
724fee23f9Smrg	(described next).
734fee23f9Smrg     </para>
744fee23f9Smrg </listitem></varlistentry>
754fee23f9Smrg
764fee23f9Smrg <varlistentry><term><code>--enable-cstdio=OPTION</code></term>
77*0a307195Smrg <listitem><para>Select a target-specific I/O package. The choices are 'stdio'
78*0a307195Smrg       which is a generic abstraction using POSIX file I/O APIs
79*0a307195Smrg       (<function>read</function>, <function>write</function>,
80*0a307195Smrg       <function>lseek</function>, etc.), and 'stdio_pure' which is similar
81*0a307195Smrg       but only uses standard C file I/O APIs (<function>fread</function>,
82*0a307195Smrg       <function>fwrite</function>, <function>fseek</function>, etc.).
83*0a307195Smrg       The 'stdio_posix' choice is a synonym for 'stdio'.
844fee23f9Smrg       The default is 'stdio'. This option can change the library ABI.
854fee23f9Smrg     </para>
864fee23f9Smrg </listitem></varlistentry>
874fee23f9Smrg
884fee23f9Smrg <varlistentry><term><code>--enable-clocale</code></term>
894fee23f9Smrg <listitem><para>This is an abbreviated form of <code>'--enable-clocale=generic'</code>
904fee23f9Smrg	(described next).
914fee23f9Smrg     </para>
924fee23f9Smrg </listitem></varlistentry>
934fee23f9Smrg
944fee23f9Smrg <varlistentry><term><code>--enable-clocale=OPTION</code></term>
954fee23f9Smrg <listitem><para>Select a target-specific underlying locale package.  The
964fee23f9Smrg	choices are 'ieee_1003.1-2001' to specify an X/Open, Standard Unix
974fee23f9Smrg	(IEEE Std. 1003.1-2001) model based on langinfo/iconv/catgets,
984fee23f9Smrg	'gnu' to specify a model based on functionality from the GNU C
9948fb7bfaSmrg	library (langinfo/iconv/gettext) (from <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="https://www.gnu.org/software/libc/">glibc</link>, the GNU C
10048fb7bfaSmrg	library), 'generic' to use a generic "C" abstraction which consists
10148fb7bfaSmrg	of "C" locale info, 'newlib' to specify the Newlib C library model
10248fb7bfaSmrg	which only differs from the 'generic' model in the handling of
10348fb7bfaSmrg	ctype, or 'darwin' which omits the <type>wchar_t</type> specializations
10448fb7bfaSmrg	needed by the 'generic' model.
1054fee23f9Smrg     </para>
1064fee23f9Smrg
10748fb7bfaSmrg     <para>If not explicitly specified, the configure process tries
1084fee23f9Smrg      to guess the most suitable package from the choices above. The
1094fee23f9Smrg      default is 'generic'. On glibc-based systems of sufficient
11048fb7bfaSmrg      vintage (2.3 and newer), 'gnu' is automatically selected. On newlib-based
11148fb7bfaSmrg      systems (<code>'--with_newlib=yes'</code>) and OpenBSD, 'newlib' is
11248fb7bfaSmrg      automatically selected. On Mac OS X 'darwin' is automatically selected.
11348fb7bfaSmrg      This option can change the library ABI.
1144fee23f9Smrg     </para>
1154fee23f9Smrg </listitem></varlistentry>
1164fee23f9Smrg
1174fee23f9Smrg <varlistentry><term><code>--enable-libstdcxx-allocator</code></term>
1184fee23f9Smrg <listitem><para>This is an abbreviated form of
1194fee23f9Smrg	<code>'--enable-libstdcxx-allocator=auto'</code> (described
1204fee23f9Smrg	next).
1214fee23f9Smrg     </para>
1224fee23f9Smrg </listitem></varlistentry>
1234fee23f9Smrg
1244fee23f9Smrg <varlistentry><term><code>--enable-libstdcxx-allocator=OPTION  </code></term>
1254fee23f9Smrg <listitem><para>Select a target-specific underlying std::allocator.  The
126b1e83836Smrg	choices are 'new' to specify a wrapper for new, and 'malloc' to
127b1e83836Smrg	specify a wrapper for malloc.
128b1e83836Smrg	See <xref linkend="allocator.ext"/> for more information.
129b1e83836Smrg	This option can change the library ABI.
1304fee23f9Smrg     </para>
1314fee23f9Smrg </listitem></varlistentry>
1324fee23f9Smrg
1334fee23f9Smrg <varlistentry><term><code>--enable-cheaders=OPTION</code></term>
1344fee23f9Smrg <listitem><para>This allows the user to define the approach taken for C header
1354fee23f9Smrg	compatibility with C++. Options are c, c_std, and c_global.
1364fee23f9Smrg	These correspond to the source directory's include/c,
1374fee23f9Smrg	include/c_std, and include/c_global, and may also include
1384fee23f9Smrg	include/c_compatibility.  The default is 'c_global'.
1394fee23f9Smrg     </para>
1404fee23f9Smrg </listitem></varlistentry>
1414fee23f9Smrg
1424fee23f9Smrg <varlistentry><term><code>--enable-threads</code></term>
1434fee23f9Smrg <listitem><para>This is an abbreviated form of <code>'--enable-threads=yes'</code>
1444fee23f9Smrg	(described next).
1454fee23f9Smrg     </para>
1464fee23f9Smrg </listitem></varlistentry>
1474fee23f9Smrg
1484fee23f9Smrg <varlistentry><term><code>--enable-threads=OPTION</code></term>
1494fee23f9Smrg <listitem><para>Select a threading library.  A full description is
1504fee23f9Smrg	given in the
15148fb7bfaSmrg	general <link xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="http://gcc.gnu.org/install/configure.html">compiler
15248fb7bfaSmrg	configuration instructions</link>. This option can change the
1534fee23f9Smrg	library ABI.
1544fee23f9Smrg     </para>
1554fee23f9Smrg </listitem></varlistentry>
1564fee23f9Smrg
15748fb7bfaSmrg <varlistentry><term><code>--enable-libstdcxx-threads</code></term>
15848fb7bfaSmrg <listitem><para>Enable C++11 threads support.  If not explicitly specified,
1594d5abbe8Smrg        the  configure process enables it if possible.  This
16048fb7bfaSmrg	option can change the library ABI.
16148fb7bfaSmrg     </para>
16248fb7bfaSmrg </listitem></varlistentry>
16348fb7bfaSmrg
16448fb7bfaSmrg <varlistentry><term><code>--enable-libstdcxx-time</code></term>
16548fb7bfaSmrg <listitem><para>This is an abbreviated form of
16648fb7bfaSmrg	<code>'--enable-libstdcxx-time=yes'</code>(described next).
16748fb7bfaSmrg     </para>
16848fb7bfaSmrg </listitem></varlistentry>
16948fb7bfaSmrg
17048fb7bfaSmrg <varlistentry><term><code>--enable-libstdcxx-time=OPTION</code></term>
17148fb7bfaSmrg <listitem><para>Enables link-type checks for the availability of the
172fb8a8121Smrg	<function>clock_gettime</function> clocks, used in the implementation
173fb8a8121Smrg	of [time.clock], and of the <function>nanosleep</function> and
174fb8a8121Smrg	<function>sched_yield</function> functions, used in the
17548fb7bfaSmrg	implementation of [thread.thread.this] of the 2011 ISO C++ standard.
17648fb7bfaSmrg	The choice OPTION=yes checks for the availability of the facilities
177b1e83836Smrg	in libc.  OPTION=rt also checks in
178fb8a8121Smrg	librt (and, if it's needed, links to it).  Note that linking to librt
179fb8a8121Smrg	is not always desirable because for glibc it requires linking to
180fb8a8121Smrg	libpthread too, which causes all reference counting to use atomic
181fb8a8121Smrg	operations, resulting in a potentially large overhead for
182fb8a8121Smrg	single-threaded programs.  OPTION=no skips the tests completely.
1834d5abbe8Smrg	The default is OPTION=auto, which skips the checks and enables the
1844d5abbe8Smrg	features only for targets known to support them.
185fb8a8121Smrg	For Linux targets, if <function>clock_gettime</function> is not used
186fb8a8121Smrg	then the [time.clock] implementation will use a system call to access
187fb8a8121Smrg	the realtime and monotonic clocks, which is significantly slower than
188fb8a8121Smrg	the C library's <function>clock_gettime</function> function.
18948fb7bfaSmrg    </para>
19048fb7bfaSmrg </listitem></varlistentry>
19148fb7bfaSmrg
1924fee23f9Smrg <varlistentry><term><code>--enable-libstdcxx-debug</code></term>
1934fee23f9Smrg <listitem><para>Build separate debug libraries in addition to what is normally built.
1944fee23f9Smrg	By default, the debug libraries are compiled with
1954fee23f9Smrg	<code> CXXFLAGS='-g3 -O0 -fno-inline'</code>
1964fee23f9Smrg	, are installed in <code>${libdir}/debug</code>, and have the
1974fee23f9Smrg	same names and versioning information as the non-debug
1984fee23f9Smrg	libraries. This option is off by default.
1994fee23f9Smrg     </para>
2004fee23f9Smrg     <para>Note this make command, executed in
2014fee23f9Smrg	the build directory, will do much the same thing, without the
2024fee23f9Smrg	configuration difference and without building everything twice:
2034fee23f9Smrg	<code>make CXXFLAGS='-g3 -O0 -fno-inline' all</code>
2044fee23f9Smrg     </para>
2054fee23f9Smrg </listitem></varlistentry>
2064fee23f9Smrg
2074fee23f9Smrg <varlistentry><term><code>--enable-libstdcxx-debug-flags=FLAGS</code></term>
2084fee23f9Smrg
209fb8a8121Smrg <listitem><para>This option is only valid when
210fb8a8121Smrg	<code>--enable-libstdcxx-debug</code>
2114fee23f9Smrg	is also specified, and applies to the debug builds only. With
2124fee23f9Smrg	this option, you can pass a specific string of flags to the
2134fee23f9Smrg	compiler to use when building the debug versions of libstdc++.
2144fee23f9Smrg	FLAGS is a quoted string of options, like
2154fee23f9Smrg     </para>
2164fee23f9Smrg	<programlisting>
2174fee23f9Smrg  --enable-libstdcxx-debug-flags='-g3 -O1 -fno-inline'</programlisting>
2184fee23f9Smrg </listitem></varlistentry>
2194fee23f9Smrg
2204fee23f9Smrg <varlistentry><term><code>--enable-cxx-flags=FLAGS</code></term>
2214fee23f9Smrg <listitem><para>With this option, you can pass a string of -f (functionality)
2224fee23f9Smrg	flags to the compiler to use when building libstdc++. This
2234fee23f9Smrg	option can change the library ABI. FLAGS is a quoted string of
2244fee23f9Smrg	options, like
2254fee23f9Smrg     </para>
2264fee23f9Smrg	<programlisting>
2274fee23f9Smrg  --enable-cxx-flags='-fvtable-gc -fomit-frame-pointer -ansi'</programlisting>
2284fee23f9Smrg     <para>
2294fee23f9Smrg	Note that the flags don't necessarily have to all be -f flags,
2304fee23f9Smrg	as shown, but usually those are the ones that will make sense
2314fee23f9Smrg	for experimentation and configure-time overriding.
2324fee23f9Smrg     </para>
2334fee23f9Smrg     <para>The advantage of --enable-cxx-flags over setting CXXFLAGS in
2344fee23f9Smrg	the 'make' environment is that, if files are automatically
2354fee23f9Smrg	rebuilt, the same flags will be used when compiling those files
2364fee23f9Smrg	as well, so that everything matches.
2374fee23f9Smrg     </para>
2384fee23f9Smrg     <para>Fun flags to try might include combinations of
2394fee23f9Smrg     </para>
2404fee23f9Smrg	<programlisting>
2414fee23f9Smrg  -fstrict-aliasing
2424fee23f9Smrg  -fno-exceptions
2434fee23f9Smrg  -ffunction-sections
2444fee23f9Smrg  -fvtable-gc</programlisting>
2454fee23f9Smrg     <para>and opposite forms (-fno-) of the same.  Tell us (the libstdc++
2464fee23f9Smrg	mailing list) if you discover more!
2474fee23f9Smrg     </para>
2484fee23f9Smrg </listitem></varlistentry>
2494fee23f9Smrg
2504fee23f9Smrg <varlistentry><term><code>--enable-c99</code></term>
25148fb7bfaSmrg <listitem><para>The <type>long long</type> type was introduced in C99, along
2524fee23f9Smrg	with many other functions for wide characters, and math
2534fee23f9Smrg	classification macros, etc.  If enabled, all C99 functions not
2544fee23f9Smrg	specified by the C++ standard will be put into <code>namespace
2554fee23f9Smrg	__gnu_cxx</code>, and then all these names will
2564fee23f9Smrg	be injected into namespace std, so that C99 functions can be
25748fb7bfaSmrg	used "as if" they were in the C++ standard (as they
2584fee23f9Smrg	will eventually be in some future revision of the standard,
2594fee23f9Smrg	without a doubt).  By default, C99 support is on, assuming the
2604fee23f9Smrg	configure probes find all the necessary functions and bits
2614fee23f9Smrg	necessary. This option can change the library ABI.
2624fee23f9Smrg    </para>
2634fee23f9Smrg </listitem></varlistentry>
2644fee23f9Smrg
2654fee23f9Smrg <varlistentry><term><code>--enable-wchar_t</code>[default]</term>
26648fb7bfaSmrg <listitem><para>Template specializations for the <type>wchar_t</type> type are
2674fee23f9Smrg	required for wide character conversion support.  Disabling
2684fee23f9Smrg	wide character specializations may be expedient for initial
2694fee23f9Smrg	porting efforts, but builds only a subset of what is required by
2704fee23f9Smrg	ISO, and is not recommended.  By default, this option is on.
2714fee23f9Smrg	This option can change the library ABI.
2724fee23f9Smrg     </para>
2734fee23f9Smrg </listitem></varlistentry>
2744fee23f9Smrg
2754fee23f9Smrg <varlistentry><term><code>--enable-long-long  </code></term>
27648fb7bfaSmrg <listitem><para>The <type>long long</type> type was introduced in C99.  It is
2774fee23f9Smrg	provided as a GNU extension to C++98 in g++.  This flag builds
27848fb7bfaSmrg	support for "long long" into the library (specialized
2794fee23f9Smrg	templates and the like for iostreams).  This option is on by default:
28048fb7bfaSmrg	if enabled, users will have to either use the new-style "C"
2814fee23f9Smrg	headers by default (i.e., &lt;cmath&gt; not &lt;math.h&gt;)
2824fee23f9Smrg	or add appropriate compile-time flags to all compile lines to
28348fb7bfaSmrg	allow "C" visibility of this feature (on GNU/Linux,
2844fee23f9Smrg	the flag is -D_ISOC99_SOURCE, which is added automatically via
2854fee23f9Smrg	CPLUSPLUS_CPP_SPEC's addition of _GNU_SOURCE).
2864fee23f9Smrg	This option can change the library ABI.
2874fee23f9Smrg     </para>
2884fee23f9Smrg </listitem></varlistentry>
2894fee23f9Smrg
2904fee23f9Smrg <varlistentry><term><code>--enable-fully-dynamic-string</code></term>
2914fee23f9Smrg <listitem><para>This option enables a special version of basic_string avoiding
2924fee23f9Smrg	the optimization that allocates empty objects in static memory.
2934fee23f9Smrg	Mostly useful together with shared memory allocators, see PR
2944fee23f9Smrg	libstdc++/16612 for details.
2954fee23f9Smrg     </para>
2964fee23f9Smrg </listitem></varlistentry>
2974fee23f9Smrg
2984fee23f9Smrg <varlistentry><term><code>--enable-concept-checks</code></term>
2994fee23f9Smrg <listitem><para>This turns on additional compile-time checks for instantiated
300f30ff588Smrg	library templates, in the form of specialized templates described in
301f30ff588Smrg        the <link linkend="std.diagnostics.concept_checking">Concept
302f30ff588Smrg        Checking</link> section.  They
3034fee23f9Smrg	can help users discover when they break the rules of the STL, before
304f30ff588Smrg	their programs run. These checks are based on C++03 rules and some of
305f30ff588Smrg	them are not compatible with correct C++11 code.
3064fee23f9Smrg     </para>
3074fee23f9Smrg </listitem></varlistentry>
3084fee23f9Smrg
3094fee23f9Smrg <varlistentry><term><code>--enable-symvers[=style]</code></term>
3104fee23f9Smrg
3114fee23f9Smrg <listitem><para>In 3.1 and later, tries to turn on symbol versioning in the
3124fee23f9Smrg	shared library (if a shared library has been
3134fee23f9Smrg	requested). Values for 'style' that are currently supported
31448fb7bfaSmrg	are 'gnu', 'gnu-versioned-namespace', 'darwin',
31548fb7bfaSmrg	'darwin-export', and 'sun'. Both gnu- options require that a recent
3164fee23f9Smrg	version of the GNU linker be in use. Both darwin options are
3174fee23f9Smrg	equivalent. With no style given, the configure script will try
3184fee23f9Smrg	to guess correct defaults for the host system, probe to see if
3194fee23f9Smrg	additional requirements are necessary and present for
3204fee23f9Smrg	activation, and if so, will turn symbol versioning on. This
3214fee23f9Smrg	option can change the library ABI.
3224fee23f9Smrg     </para>
3234fee23f9Smrg
3244fee23f9Smrg </listitem></varlistentry>
3254fee23f9Smrg
32648fb7bfaSmrg <varlistentry><term><code>--enable-libstdcxx-visibility</code></term>
32748fb7bfaSmrg <listitem><para> In 4.2 and later, enables or disables visibility
32848fb7bfaSmrg        attributes. If enabled (as by default), and the compiler seems
32948fb7bfaSmrg        capable of passing the simple sanity checks thrown at it, adjusts
33048fb7bfaSmrg        items in namespace std, namespace std::tr1, namespace std::tr2,
33148fb7bfaSmrg        and namespace __gnu_cxx to have <code>visibility ("default")</code>
33248fb7bfaSmrg        so that -fvisibility options can be used without affecting the
33348fb7bfaSmrg        normal external-visibility of namespace std entities.
33448fb7bfaSmrg        Prior to 4.7 this option was spelled <code>--enable-visibility</code>.
3354fee23f9Smrg    </para>
3364fee23f9Smrg </listitem></varlistentry>
3374fee23f9Smrg
3384fee23f9Smrg <varlistentry><term><code>--enable-libstdcxx-pch</code></term>
3394fee23f9Smrg <listitem><para>In 3.4 and later, tries to turn on the generation of
3404fee23f9Smrg	stdc++.h.gch, a pre-compiled file including all the standard
3414fee23f9Smrg	C++ includes. If enabled (as by default), and the compiler
3424fee23f9Smrg	seems capable of passing the simple sanity checks thrown at
3434fee23f9Smrg	it, try to build stdc++.h.gch as part of the make process.
344*0a307195Smrg	In addition, this generated file is used later on (by appending
345*0a307195Smrg	<code>-include bits/stdc++.h</code> to CXXFLAGS) when running the
3464fee23f9Smrg	testsuite.
3474fee23f9Smrg     </para>
3484fee23f9Smrg </listitem></varlistentry>
3494fee23f9Smrg
35048fb7bfaSmrg
35148fb7bfaSmrg <varlistentry><term><code>--enable-extern-template</code>[default]</term>
35248fb7bfaSmrg <listitem><para>Use extern template to pre-instantiate all required
35348fb7bfaSmrg 	specializations for certain types defined in the standard libraries.
35448fb7bfaSmrg	These types include <classname>string</classname> and dependents like
35548fb7bfaSmrg	<classname>char_traits</classname>, the templatized IO classes,
35648fb7bfaSmrg	<classname>allocator</classname>, and others.
35748fb7bfaSmrg	Disabling means that implicit
35848fb7bfaSmrg	template generation will be used when compiling these types.  By
35948fb7bfaSmrg	default, this option is on. This option can change the library ABI.
36048fb7bfaSmrg     </para>
36148fb7bfaSmrg </listitem></varlistentry>
36248fb7bfaSmrg
3634fee23f9Smrg <varlistentry><term><code>--disable-hosted-libstdcxx</code></term>
3644fee23f9Smrg <listitem>
3654fee23f9Smrg   <para>
3664fee23f9Smrg     By default, a complete <emphasis>hosted</emphasis> C++ library is
3674fee23f9Smrg     built.  The C++ Standard also describes a
3684fee23f9Smrg     <emphasis>freestanding</emphasis> environment, in which only a
3694fee23f9Smrg     minimal set of headers are provided.  This option builds such an
3704fee23f9Smrg     environment.
3714fee23f9Smrg     </para>
3724fee23f9Smrg </listitem></varlistentry>
3734fee23f9Smrg
37448fb7bfaSmrg<varlistentry><term><code>--disable-libstdcxx-verbose</code></term>
37548fb7bfaSmrg <listitem>
37648fb7bfaSmrg   <para>
37748fb7bfaSmrg     By default, the library is configured to write descriptive messages
37848fb7bfaSmrg     to standard error for certain events such as calling a pure virtual
37948fb7bfaSmrg     function or the invocation of the standard terminate handler.  Those
38048fb7bfaSmrg     messages cause the library to depend on the demangler and standard I/O
3814d5abbe8Smrg     facilities, which might be undesirable in a low-memory environment or
38248fb7bfaSmrg     when standard error is not available.  This option disables those
38348fb7bfaSmrg     messages.  This option does not change the library ABI.
3844fee23f9Smrg   </para>
3854fee23f9Smrg </listitem></varlistentry>
3864fee23f9Smrg
3874d5abbe8Smrg<varlistentry><term><code>--disable-libstdcxx-dual-abi</code></term>
3884d5abbe8Smrg <listitem>
3894d5abbe8Smrg   <para>
3904d5abbe8Smrg     Disable support for the new, C++11-conforming implementations of
3914d5abbe8Smrg     <code>std::string</code>, <code>std::list</code> etc. so that the
3924d5abbe8Smrg     library only provides definitions of types using the old ABI
3934d5abbe8Smrg     (see <xref linkend="manual.intro.using.abi"/>).
3944d5abbe8Smrg     This option changes the library ABI.
3954d5abbe8Smrg   </para>
3964d5abbe8Smrg </listitem></varlistentry>
3974d5abbe8Smrg
3984d5abbe8Smrg<varlistentry><term><code>--with-default-libstdcxx-abi=</code><replaceable>OPTION</replaceable></term>
3994d5abbe8Smrg <listitem>
4004d5abbe8Smrg   <para>
4014d5abbe8Smrg     Set the default value for the <symbol>_GLIBCXX_USE_CXX11_ABI</symbol>
4024d5abbe8Smrg     macro (see <xref linkend="manual.intro.using.macros"/>).
4034d5abbe8Smrg     The default is <option>OPTION=new</option> which sets the macro to
4044d5abbe8Smrg     <literal>1</literal>,
4054d5abbe8Smrg     use <option>OPTION=gcc4-compatible</option> to set it to
4064d5abbe8Smrg     <literal>0</literal>.
4074d5abbe8Smrg     This option does not change the library ABI.
4084d5abbe8Smrg   </para>
4094d5abbe8Smrg </listitem></varlistentry>
4104d5abbe8Smrg
411181254a7Smrg <varlistentry><term><code>--with-libstdcxx-lock-policy=OPTION</code></term>
412181254a7Smrg <listitem><para>Sets the lock policy that controls how
413181254a7Smrg        <classname>shared_ptr</classname> reference counting is
414181254a7Smrg        synchronized.
415181254a7Smrg        The choice OPTION=atomic enables use of atomics for updates to
416181254a7Smrg        <classname>shared_ptr</classname> reference counts.
417181254a7Smrg        The choice OPTION=mutex enables use of a mutex to synchronize updates
418181254a7Smrg        to <classname>shared_ptr</classname> reference counts.
419181254a7Smrg        If the compiler's thread model is "single" then this option has no
420181254a7Smrg        effect, as no synchronization is used for the reference counts.
421181254a7Smrg	The default is OPTION=auto, which checks for the availability of
422181254a7Smrg        compiler built-ins for 2-byte and 4-byte atomic compare-and-swap,
423181254a7Smrg        and uses OPTION=atomic if they're available, OPTION=mutex otherwise.
424181254a7Smrg        This option can change the library ABI.
425181254a7Smrg        If the library is configured to use atomics and user programs are
426181254a7Smrg        compiled using a target that doesn't natively support the atomic
427181254a7Smrg        operations (e.g. the library is configured for armv7 and then code
428181254a7Smrg        is compiled with <option>-march=armv5t</option>) then the program
429181254a7Smrg        might rely on support in libgcc to provide the atomics.
430181254a7Smrg    </para>
431181254a7Smrg </listitem></varlistentry>
432181254a7Smrg
4334d5abbe8Smrg <varlistentry><term><code>--enable-vtable-verify</code>[default]</term>
4344d5abbe8Smrg <listitem>
4354d5abbe8Smrg    <para>Use <code>-fvtable-verify=std</code> to compile the C++
4364d5abbe8Smrg    runtime with instrumentation for vtable verification. All virtual
4374d5abbe8Smrg    functions in the standard library will be verified at runtime.
4384d5abbe8Smrg    Types impacted include <classname>locale</classname> and
4394d5abbe8Smrg    <classname>iostream</classname>, and others.  Disabling means that
4404d5abbe8Smrg    the C++ runtime is compiled without support for vtable
4414d5abbe8Smrg    verification. By default, this option is off.
4424d5abbe8Smrg     </para>
4434d5abbe8Smrg </listitem></varlistentry>
4444d5abbe8Smrg
445f30ff588Smrg <varlistentry><term><code>--enable-libstdcxx-filesystem-ts</code>[default]</term>
446f30ff588Smrg <listitem>
447f30ff588Smrg    <para>Build <filename class="libraryfile">libstdc++fs.a</filename> as well
448f30ff588Smrg      as the usual libstdc++ and libsupc++ libraries. This is enabled by
449f30ff588Smrg      default on select POSIX targets where it is known to work and disabled
450f30ff588Smrg      otherwise.
451f30ff588Smrg    </para>
452f30ff588Smrg </listitem></varlistentry>
453f30ff588Smrg
4544fee23f9Smrg</variablelist>
4554fee23f9Smrg
45648fb7bfaSmrg</section>
457