LSB C++ Notes

Install

Base hardware/software config: F18 adair + x86_64.

Test harness for the Linux Standard Base. Bugzilla for the project. The C++ library parts of this are using component “lsb-test-libstdcpp” in bugzilla. The components “Cpp-T2C” and “libstdcpp” are also relevant, these are generated test files and any reference to libstdc++.so, respectively.

A couple of different projects and configurations. For testing the C++ runtime on GNU linux systems (aka libstdc++), want LSB Distribution Testkit. This requires the packages redhat-lsb, redhat-lsb-core, and ctags be installed.

basics:

%mkdir $src/lsb

%cd $src/lsb

%tar xvfz lsb-dist-testkit-manager-4.1.7-1.x86_64.tar.gz
./
./lsb-dist-testkit-manager/
./lsb-dist-testkit-manager/inst-config
./lsb-dist-testkit-manager/install.sh
./lsb-dist-testkit-manager/post-install.sh
./lsb-dist-testkit-manager/lsb-dist-checker-4.1.0.11-1.x86_64.rpm
./lsb-dist-testkit-manager/lsb-setup-4.1.0-1.noarch.rpm

Then, install it:

%./install.sh

A bunch of install spewage omitted. The relevant details:

LSB Distribution Checker

  • Project homepage.
  • installed in: /opt/lsb/test/manager
  • to start: /opt/lsb/test/manager/bin/dist-checker-start.pl

Run Distribution Checker

Now, start up the web-ui:

%/opt/lsb/test/manager/bin/dist-checker-start.pl
The port '8888' will be used by the Distribution Checker's web-UI server.
If you want to change this, run /opt/lsb/test/manager/bin/dist-checker-start.pl <port>

Server started. Log file location:
/var/opt/lsb/test/manager/log/dc-server.log.8888

The start page should be opened in a browser shortly.
If it doesn't open, you can load it at http://localhost:8888/

Got to firefox, open:

http://localhost:8888/

Select Custom Tests Mode. Hit the red “Refresh List” button.  Then, click box by “Libstdc++ Tests” in the “Runtime Interface Tests” category. Scroll to the bottom, hit the green “Run Selected Test” button.

This will chug a bit, and then you’ll get a webpage saying: Success and Passed. It s1`

f18-lsb-original-results

Now, what goes on here? What compiler and library are being tested?

The magic is here:

/opt/lsb/test/libstdcpp_4.1.0/run_tests

Notes

Test files for the Distribution Check/libstdc++ are based on GCC-4.1.x release. For the 4.1.2 release, libstdc++/testsuite ran 2131 testcases in native mode. The LSB testsuite has 1978 testcases, and 1786 are run. Jump ahead six years, the 4.8.0 release has 5367 testscases.

Red Hat Use

See the main LSB at Red Hat page on the wiki. It’s got a lot of great info about current test results.

ABI Notes, commentary

Looking at past releases, zoom in on a couple in particular:

  • gcc-4.2.1, fixed in gcc-4.2.2, GCC PR 33678.  Problem was re-ordering of vtables in libsupc++/typeinfo. In std::typeinfo, the virtual member functions must be ordered as: __is_pointer_p, __is_function_p, __do_catch, __do_upcast. Found via LSB vtable change detector.
  • gcc-4.4.x and above support for exception propagation, GCC PR 40296.Look at __cxa_get_exeption_ptr backports. For std::exception_ptr, std::current_exception, __cxa_get_exception_ptr, backports of this functionality are required if the base system is to deal with C++11 calls. So, back-port exception handling changes to RHEL 5 systems (RHEL 6 support this as based on 4.4.).
  • gcc-4.7.x, including pre-release.
    • For std::list, there is an added data member, _M_size.  Reverted, fixed in 4.7.2. This is problematic when std::list is part of a function signature.
    • For std::pair, an addressable change in C++11 but not C++98, due to the addition of a non-trivial move constructor. Fixed in 4.7.2. That meant in C++98, std::pair was passed in register. In C++11, it was not. Note that this is unrelated to the known C++98/C++11 incompatibility with std::make_pair found by James Dennett (See Appendix D, signature change to explicitly specifying make_pair<template_arguments> will break in C++11, replace with std::pair<tempate_arguments> or just let the compiler deduct). Some commentary from Andreas Jaeger’s blog post about it, the openSUSE bug 767666, GCC changes reference to it.
    • For std::unordered_map, and the rest of the C++11 unordered associated containers,  the situation is a bit different as this is a C++11 only component. Internal changes change data model. Deemed incompatible, but only for C++11, so allowed per C++11 ABI policy.
    • For std::condition_variable_any, added data member _M_mutex from this change. Deemed incompatible, but only for C++11, so allowed per C++11 ABI policy.
    • For std::num_get, vtable change from this change. Fixed via this change, pre-release of 4.7.0. Found via DTS-1.0 testing, running hybrid libstdc++.dts.so with base system running gcc-4.4 libstdc++.so.
    • For std::complex, there are signature changes in member functions, GCC PR 53429. This is a C++98/C++11 compatibility question involving vague linkage and template in-lining. Unresolved.

Also of note is the LSB tracker bug for C++11 support.

General C++11 ABI policy, as per GCC wiki

Some links to cool tools:

pkgdiff, like rpmdiff but open.

ACC, ABI Compliance Checker, lsb.

Combining all this, look at a compatibility report for boost.