From 0b224dcf60dd8bd401501178f6118b8455ceeb1f Mon Sep 17 00:00:00 2001
From: Jonathan Wakely
If you find bugs in the testsuite programs themselves, or if you diff --git a/libstdc++-v3/doc/html/index.html b/libstdc++-v3/doc/html/index.html index 694260c4b4c..a847921d8ab 100644 --- a/libstdc++-v3/doc/html/index.html +++ b/libstdc++-v3/doc/html/index.html @@ -135,7 +135,7 @@
GLIBCXX_ENABLE
, the --enable
makerGLIBCXX_ENABLE
, the --enable
makerTable of Contents
Regenerate all generated files by using the command
- autoreconf
at the top level of the libstdc++ source
+ autoreconf at the top level of the libstdc++ source
directory.
- Until that glorious day when we can use AC_TRY_LINK with a
- cross-compiler, we have to hardcode the results of what the tests
+ Until that glorious day when we can use AC_TRY_LINK
+ with a cross-compiler, we have to hardcode the results of what the tests
would have shown if they could be run. So we have an inflexible
- mess like crossconfig.m4.
+ mess like crossconfig.m4
.
Wouldn't it be nice if we could store that information in files
like configure.host, which can be modified without needing to
regenerate anything, and can even be tweaked without really
knowing how the configury all works? Perhaps break the pieces of
- crossconfig.m4 out and place them in their appropriate
- config/{cpu,os} directory.
+ crossconfig.m4
out and place them in their appropriate
+ config/{cpu,os}
directory.
Alas, writing macros like
"AC_DEFINE(HAVE_A_NICE_DAY)
" can only be done inside
@@ -89,32 +89,37 @@ in the build directory starts the build process. The all
discourage that.
Most comments should use {octothorpes, shibboleths, hash marks,
- pound signs, whatever} rather than "dnl". Nearly all comments in
- configure.ac should. Comments inside macros written in ancillary
- .m4 files should. About the only comments which should
- not use #, but use dnl instead, are comments
- outside our own macros in the ancillary
- files. The difference is that # comments show up in
- configure
(which is most helpful for debugging),
- while dnl'd lines just vanish. Since the macros in ancillary
- files generate code which appears in odd places, their "outside"
- comments tend to not be useful while reading
- configure
.
+ pound signs, whatever} rather than "dnl
".
+ Nearly all comments in configure.ac
should.
+ Comments inside macros written in ancillary
+ .m4
files should.
+ About the only comments which should not
+ use #
, but use dnl
instead,
+ are comments outside our own macros in the ancillary
+ files. The difference is that #
comments show up in
+ configure
(which is most helpful for debugging),
+ while dnl
'd lines just vanish. Since the macros
+ in ancillary files generate code which appears in odd places,
+ their "outside" comments tend to not be useful while reading
+ configure
.
Do not use any $target*
variables, such as
- $target_alias
. The single exception is in
- configure.ac, for automake+dejagnu's sake.
+ $target_alias
. The single exception is in
+ configure.ac
, for automake+dejagnu's sake.
- The nice thing about acinclude.m4/aclocal.m4 is that macros aren't
+ The nice thing about
+ acinclude.m4
/aclocal.m4
+ is that macros aren't
actually performed/called/expanded/whatever here, just loaded. So
we can arrange the contents however we like. As of this writing,
- acinclude.m4 is arranged as follows:
+ acinclude.m4
is arranged as follows:
GLIBCXX_CHECK_HOST GLIBCXX_TOPREL_CONFIGURE GLIBCXX_CONFIGURE
- All the major variable "discovery" is done here. CXX, multilibs,
+ All the major variable "discovery" is done here.
+ CXX
, multilibs,
etc.
fragments included from elsewhere
@@ -179,7 +184,8 @@ in the build directory starts the build process. The all
helper, GLIBCXX_ENABLE
. (You don't have to use
it, but it's easy.) The helper does two things for us:
- Builds the call to the AC_ARG_ENABLE
macro, with --help text
+ Builds the call to the AC_ARG_ENABLE
macro, with
+ --help
text
properly quoted and aligned. (Death to changequote!)
Checks the result against a list of allowed possibilities, and
@@ -204,28 +210,32 @@ in the build directory starts the build process. The all
GLIBCXX_ENABLE (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, permit a|b|c)
GLIBCXX_ENABLE (FEATURE, DEFAULT, HELP-ARG, HELP-STRING, SHELL-CODE-HANDLER)
- FEATURE is the string that follows --enable. The results of the
- test (such as it is) will be in the variable $enable_FEATURE,
- where FEATURE has been squashed. Example:
- [extra-foo]
, controlled by the --enable-extra-foo
- option and stored in $enable_extra_foo.
+ FEATURE
is the string that follows
+ --enable
. The results of the
+ test (such as it is) will be in the variable
+ $enable_FEATURE
,
+ where FEATURE
has been squashed. Example:
+ [extra-foo]
, controlled by the
+ --enable-extra-foo
+ option and stored in $enable_extra_foo
.
- DEFAULT is the value to store in $enable_FEATURE if the user does
- not pass --enable/--disable. It should be one of the permitted
- values passed later. Examples: [yes]
, or
- [bar]
, or [$1]
(which passes the
- argument given to the GLIBCXX_ENABLE_FOO
macro
- as the default).
+ DEFAULT
is the value to store in
+ $enable_FEATURE
if the user does
+ not pass --enable
/--disable
.
+ It should be one of the permitted values passed later.
+ Examples: [yes]
, or [bar]
, or
+ [$1]
(which passes the argument given to the
+ GLIBCXX_ENABLE_FOO
macro as the default).
For cases where we need to probe for particular models of things,
it is useful to have an undocumented "auto" value here (see
GLIBCXX_ENABLE_CLOCALE
for an example).
- HELP-ARG is any text to append to the option string itself in the
- --help output. Examples: []
(i.e., an empty string,
- which appends nothing), [=BAR]
, which produces
- --enable-extra-foo=BAR
, and
- [@<:@=BAR@:>@]
, which produces
+ HELP-ARG
is any text to append to the option string
+ itself in the --help
output. Examples:
+ []
(i.e., an empty string, which appends nothing),
+ [=BAR]
, which produces --enable-extra-foo=BAR
,
+ and [@<:@=BAR@:>@]
, which produces
--enable-extra-foo[=BAR]
. See the difference? See
what it implies to the user?
@@ -233,25 +243,29 @@ in the build directory starts the build process. The all
that's how you embed autoconf special characters in output text.
They're called quadrigraphs
and you should use them whenever necessary.
-
HELP-STRING is what you think it is. Do not include the
+
HELP-STRING
is what you think it is. Do not include the
"default" text like we used to do; it will be done for you by
- GLIBCXX_ENABLE. By convention, these are not full English
- sentences. Example: [turn on extra foo]
+ GLIBCXX_ENABLE
. By convention, these are not full English
+ sentences. Example: [turn on extra foo]
With no other arguments, only the standard autoconf patterns are
- allowed: "--{enable,disable}-foo[={yes,no}]
" The
- $enable_FEATURE variable is guaranteed to equal either "yes" or "no"
+ allowed: "--{enable,disable}-foo[={yes,no}]
" The
+ $enable_FEATURE
variable is guaranteed to equal
+ either "yes
" or "no
"
after the macro. If the user tries to pass something else, an
explanatory error message will be given, and configure will halt.
The second signature takes a fifth argument, "[permit
a | b | c | ...]
"
This allows a or b or
- ... after the equals sign in the option, and $enable_FEATURE is
+ ... after the equals sign in the option, and
+ $enable_FEATURE
is
guaranteed to equal one of them after the macro. Note that if you
- want to allow plain --enable/--disable with no "=whatever", you must
- include "yes" and "no" in the list of permitted values. Also note
- that whatever you passed as DEFAULT must be in the list. If the
+ want to allow plain --enable
/--disable
+ with no "=whatever
", you must
+ include "yes
" and "no
" in the
+ list of permitted values. Also note that whatever you passed as
+ DEFAULT
must be in the list. If the
user tries to pass something not on the list, a semi-explanatory
error message will be given, and configure will halt. Example:
[permit generic|gnu|ieee_1003.1-2001|yes|no|auto]
@@ -260,8 +274,91 @@ in the build directory starts the build process. The all
code to execute if the user actually passes the enable/disable
option. (If the user does not, the default is used. Duh.) No
argument checking at all is done in this signature. See
- GLIBCXX_ENABLE_CXX_FLAGS for an example of handling, and an error
- message.
+ GLIBCXX_ENABLE_CXX_FLAGS
for an example of handling,
+ and an error message.
+
+The libstdc++.so
shared library must
+be carefully managed to maintain binary compatible with older versions
+of the library. This ensures a new version of the library is still usable by
+programs that were linked against an older version.
+
+Dependent on the target supporting it, the library uses ELF
+symbol versioning for all exported symbols. The symbol versions
+are defined by a linker
+script that assigns a version to every symbol.
+The set of symbols in each version is fixed when a GCC
+release is made, and must not change after that.
+
When new symbols are added to the library they must be added
+to a new symbol version, which must be created the first time new symbols
+are added after a release. Adding a new symbol version involves the
+following steps:
+
+Edit acinclude.m4
to update the "revision" value of
+libtool_VERSION
, e.g. from 6:22:0
+to 6:23:0
, which will cause the shared library to be
+built as libstdc++.so.6.0.23
.
+
+Regenerate the configure
script by running the
+autoreconf tool from the correct version of the Autoconf
+package (as dictated by the GCC
+prerequisites).
+
+Edit the file config/abi/pre/gnu.ver
to
+add a new version node after the last new node. The node name should be
+GLIBCXX_3.4.X
where X
is the new
+revision set in acinclude.m4
, and the node should
+depend on the previous version e.g.
+
+ GLIBCXX_3.4.23 {
+
+ } GLIBCXX_3.4.22;
+
+For symbols in the ABI runtime, libsupc++, the symbol version naming uses
+CXXABI_1.3.Y
where Y
increases
+monotonically with each new version. Again, the new node must depend on the
+previous version node e.g.
+
+ CXXABI_1.3.11 {
+
+ } CXXABI_1.3.10;
+
+
+In order for the check-abi test
+target to pass the testsuite must be updated to know about the new symbol
+version(s). Edit the file testsuite/util/testsuite_abi.cc
+file to add the new versions to the known_versions
list,
+and update the checks for the latest versions that set the
+latestp
variable).
+
+Once the new symbol version has been added you can add the names of your new
+symbols in the new version node:
+
+ GLIBCXX_3.4.23 {
+
+ # basic_string<C, T, A>::_Alloc_hider::_Alloc_hider(C*, A&&)
+ _ZNSt7__cxx1112basic_stringI[cw]St11char_traitsI[cw]ESaI[cw]EE12_Alloc_hiderC[12]EP[cw]OS3_;
+
+ } GLIBCXX_3.4.22;
+
+You can either use mangled names, or demangled names inside an
+extern "C++"
block. You might find that the new symbol
+matches an existing pattern in an old symbol version (causing the
+check-abi
test target to fail). If that happens then the
+existing pattern must be adjusted to be more specific so that it doesn't
+match the new symbol.
+
+For an example of these steps, including adjusting old patterns to be less
+greedy, see https://gcc.gnu.org/ml/gcc-patches/2016-07/msg01926.html
+and the attached patch.
+
+If it wasn't done for the last release, you might also need to regenerate
+the baseline_symbols.txt
file that defines the set
+of expected symbols for old symbol versions. A new baseline file can be
+generated by running make new-abi-baseline
in the
+libbuildir
/testsuite
+directory. Be sure to generate the baseline from a clean build using
+unmodified sources, or you will incorporate your local changes into the
+baseline file.
The build process has to make all of object files needed for
static or shared libraries, but first it has to generate some
@@ -287,13 +384,13 @@ in the build directory starts the build process. The all
Generates a libtool convenience library,
libc++98convenience
with language-support
- routines. Uses the -std=gnu++98
dialect.
+ routines. Uses the -std=gnu++98
dialect.
make src/c++11
Generates a libtool convenience library,
libc++11convenience
with language-support
- routines. Uses the -std=gnu++11
dialect.
+ routines. Uses the -std=gnu++11
dialect.
make src
diff --git a/libstdc++-v3/doc/html/manual/index.html b/libstdc++-v3/doc/html/manual/index.html index 38d3ac3547e..8ce0b4b54b8 100644 --- a/libstdc++-v3/doc/html/manual/index.html +++ b/libstdc++-v3/doc/html/manual/index.html @@ -116,7 +116,7 @@