Unverified Commit b16662aa authored by boklm's avatar boklm
Browse files

Bug 31646: Update abicheck to require GLIBCXX_3.4.25

This is also fixing bug 31380.
parent 3b899b76
Loading
Loading
Loading
Loading
+14 −26
Original line number Diff line number Diff line
/*
 * Bug 25485: Browser/TorBrowser/Tor/libstdc++.so.6: version `CXXABI_1.3.11' not found
 * This program is borrowed from
 * https://en.cppreference.com/w/cpp/error/uncaught_exception and is useful in
 * determining the latest C++ ABI. Specifically this program requires
 * `GLIBCXX_3.4.22` which we use to compare the version of the installed
 * libstdc++.so.6 and the bundled version. If the program executes
 * successfully, that means we should use the system version of libstdc++.so.6
 * and if not, that means we should use the bundled version.
 * Bug 31646: Update abicheck to require newer libstdc++.so.6
 * This program is useful in determining if the libstdc++.so.6 installed
 * on the system is recent enough. Specifically this program requires
 * `GLIBCXX_3.4.25` which should be provided by libstdc++.so.6 from
 * gcc >= 8.0.0. If the program executes successfully, that means we
 * should use the system version of libstdc++.so.6 and if not, that means
 * we should use the bundled version.
 *
 * We use std::random_device::entropy() in order to require GLIBCXX_3.4.25:
 * https://github.com/gcc-mirror/gcc/blob/gcc-8_3_0-release/libstdc%2B%2B-v3/config/abi/pre/gnu.ver#L1978
 */

#include <iostream>
#include <exception>
#include <stdexcept>

struct Foo {
    int count = std::uncaught_exceptions();
    ~Foo() {
        std::cout << (count == std::uncaught_exceptions()
            ? "~Foo() called normally\n"
            : "~Foo() called during stack unwinding\n");
    }
};
#include <random>

int main()
{
    Foo f;
    try {
        Foo f;
        std::cout << "Exception thrown\n";
        throw std::runtime_error("test exception");
    } catch (const std::exception& e) {
        std::cout << "Exception caught: " << e.what() << '\n';
    }
    std::random_device rd;
    std::cout << "entropy: " << rd.entropy() << std::endl;
    return 0;
}
+3 −0
Original line number Diff line number Diff line
# vim: filetype=yaml sw=2
filename: '[% project %]-[% c("version") %]-[% c("var/build_id") %].tar.gz'
# Note: When updating the gcc version, if this includes a libstdc++
# ABI change we should also update projects/firefox/abicheck.cc to
# require the new version.
version: 8.3.0
var:
  container: