Borrowed from Firefox and partly adjusted. This still does not solve the "undefined references to `std::__glibcxx_assert_fail" on f36 (waiting for a gcc 12 fix) but does on f37.