From 9700d5d8e480316d21211ebd832185d00052f00b Mon Sep 17 00:00:00 2001 From: redi Date: Thu, 18 Aug 2016 13:47:42 +0000 Subject: Expand libstdc++ docs on testing * doc/xml/manual/test.xml (test.run.permutations): Expand section. (test.new_tests): Rewrite section. (tests.dg.directives): New section. * doc/html/*: Regenerate. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239574 138bc75d-0d04-0410-961f-82ee72b054a4 --- libstdc++-v3/ChangeLog | 5 + libstdc++-v3/doc/html/faq.html | 2 +- libstdc++-v3/doc/html/index.html | 2 +- libstdc++-v3/doc/html/manual/abi.html | 4 +- libstdc++-v3/doc/html/manual/appendix.html | 2 +- libstdc++-v3/doc/html/manual/appendix_porting.html | 203 +++++-- libstdc++-v3/doc/html/manual/index.html | 2 +- libstdc++-v3/doc/html/manual/internals.html | 4 +- libstdc++-v3/doc/html/manual/test.html | 629 ++++++++++++--------- libstdc++-v3/doc/xml/manual/test.xml | 362 ++++++++---- 10 files changed, 804 insertions(+), 411 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 5acc88e0293..b6a0965af4a 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,10 @@ 2016-08-18 Jonathan Wakely + * doc/xml/manual/test.xml (test.run.permutations): Expand section. + (test.new_tests): Rewrite section. + (tests.dg.directives): New section. + * doc/html/*: Regenerate. + * doc/xml/manual/test.xml: Improve documentation of test targets. Document new-abi-baseline, check-debug, and check-parallel targets. diff --git a/libstdc++-v3/doc/html/faq.html b/libstdc++-v3/doc/html/faq.html index cac00d292b8..2eba0b7b308 100644 --- a/libstdc++-v3/doc/html/faq.html +++ b/libstdc++-v3/doc/html/faq.html @@ -281,7 +281,7 @@ performance testing. Please consult the testing documentation for GCC and - Test in the libstdc++ + Testing in the libstdc++ manual for more details.

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 @@

Contributor Checklist
Reading
Assignment
Getting Sources
Submitting Patches
Directory Layout and Source Conventions
Coding Style
Bad Identifiers
By Example
Design Notes
B. Porting and Maintenance -
Configure and Build Hacking
Prerequisites
Overview
General Process
What Comes from Where
Configure
Storing Information in non-AC files (like configure.host)
Coding and Commenting Conventions
The acinclude.m4 layout
GLIBCXX_ENABLE, the --enable maker
Make
Writing and Generating Documentation
Introduction
Generating Documentation
Doxygen
Prerequisites
Generating the Doxygen Files
Debugging Generation
Markup
Docbook
Prerequisites
Generating the DocBook Files
Debugging Generation
Editing and Validation
File Organization and Basics
Markup By Example
Porting to New Hardware or Operating Systems
Operating System
CPU
Character Types
Thread Safety
Numeric Limits
Libtool
Test
Organization
Directory Layout
Naming Conventions
Running the Testsuite
Basic
Variations
Permutations
Writing a new test case
Test Harness and Utilities
Dejagnu Harness Details
Utilities
Special Topics
+
Configure and Build Hacking
Prerequisites
Overview
General Process
What Comes from Where
Configure
Storing Information in non-AC files (like configure.host)
Coding and Commenting Conventions
The acinclude.m4 layout
GLIBCXX_ENABLE, the --enable maker
Shared Library Versioning
Make
Writing and Generating Documentation
Introduction
Generating Documentation
Doxygen
Prerequisites
Generating the Doxygen Files
Debugging Generation
Markup
Docbook
Prerequisites
Generating the DocBook Files
Debugging Generation
Editing and Validation
File Organization and Basics
Markup By Example
Porting to New Hardware or Operating Systems
Operating System
CPU
Character Types
Thread Safety
Numeric Limits
Libtool
Testing
Test Organization
Directory Layout
Naming Conventions
Running the Testsuite
Basic
Variations
Permutations
Writing a new test case
Examples of Test Directives
Directives Specific to Libstdc++ Tests
Test Harness and Utilities
DejaGnu Harness Details
Utilities
Special Topics
Qualifying Exception Safety Guarantees
Overview
diff --git a/libstdc++-v3/doc/html/manual/abi.html b/libstdc++-v3/doc/html/manual/abi.html index 7f2a05a1b6a..c92a04eae8e 100644 --- a/libstdc++-v3/doc/html/manual/abi.html +++ b/libstdc++-v3/doc/html/manual/abi.html @@ -1,5 +1,5 @@ -ABI Policy and Guidelines

What Comes from Where

Figure B.1. Configure and Build File Dependencies

Dependency Graph for Configure and Build Files

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.

Configure

Storing Information in non-AC files (like configure.host)

- 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

Coding and Commenting Conventions

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 acinclude.m4 layout

- 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 allGLIBCXX_ENABLE.  (You don't have to use
     it, but it's easy.)  The helper does two things for us:
   

  1. - 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!)

  2. Checks the result against a list of allowed possibilities, and @@ -204,28 +210,32 @@ in the build directory starts the build process. The all

    • - 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 allquadrigraphs 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 allGLIBCXX_ENABLE_CXX_FLAGS for an example of handling, + and an error message. +

Shared Library Versioning

+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.

Make

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 @@

  • Contributor Checklist
    Reading
    Assignment
    Getting Sources
    Submitting Patches
    Directory Layout and Source Conventions
    Coding Style
    Bad Identifiers
    By Example
    Design Notes
    B. Porting and Maintenance -
    Configure and Build Hacking
    Prerequisites
    Overview
    General Process
    What Comes from Where
    Configure
    Storing Information in non-AC files (like configure.host)
    Coding and Commenting Conventions
    The acinclude.m4 layout
    GLIBCXX_ENABLE, the --enable maker
    Make
    Writing and Generating Documentation
    Introduction
    Generating Documentation
    Doxygen
    Prerequisites
    Generating the Doxygen Files
    Debugging Generation
    Markup
    Docbook
    Prerequisites
    Generating the DocBook Files
    Debugging Generation
    Editing and Validation
    File Organization and Basics
    Markup By Example
    Porting to New Hardware or Operating Systems
    Operating System
    CPU
    Character Types
    Thread Safety
    Numeric Limits
    Libtool
    Test
    Organization
    Directory Layout
    Naming Conventions
    Running the Testsuite
    Basic
    Variations
    Permutations
    Writing a new test case
    Test Harness and Utilities
    Dejagnu Harness Details
    Utilities
    Special Topics
    +
    Configure and Build Hacking
    Prerequisites
    Overview
    General Process
    What Comes from Where
    Configure
    Storing Information in non-AC files (like configure.host)
    Coding and Commenting Conventions
    The acinclude.m4 layout
    GLIBCXX_ENABLE, the --enable maker
    Shared Library Versioning
    Make
    Writing and Generating Documentation
    Introduction
    Generating Documentation
    Doxygen
    Prerequisites
    Generating the Doxygen Files
    Debugging Generation
    Markup
    Docbook
    Prerequisites
    Generating the DocBook Files
    Debugging Generation
    Editing and Validation
    File Organization and Basics
    Markup By Example
    Porting to New Hardware or Operating Systems
    Operating System
    CPU
    Character Types
    Thread Safety
    Numeric Limits
    Libtool
    Testing
    Test Organization
    Directory Layout
    Naming Conventions
    Running the Testsuite
    Basic
    Variations
    Permutations
    Writing a new test case
    Examples of Test Directives
    Directives Specific to Libstdc++ Tests
    Test Harness and Utilities
    DejaGnu Harness Details
    Utilities
    Special Topics
    Qualifying Exception Safety Guarantees
    Overview
    diff --git a/libstdc++-v3/doc/html/manual/internals.html b/libstdc++-v3/doc/html/manual/internals.html index 4a521dbda48..c28e668f8ba 100644 --- a/libstdc++-v3/doc/html/manual/internals.html +++ b/libstdc++-v3/doc/html/manual/internals.html @@ -1,5 +1,5 @@ -Porting to New Hardware or Operating Systems