abicheck.cc 977 B

12345678910111213141516171819202122232425
  1. /*
  2. * Bug 34359: Update abicheck to require newer libstdc++.so.6
  3. * This program is useful in determining if the libstdc++.so.6 installed
  4. * on the system is recent enough. Specifically, this program requires
  5. * `GLIBCXX_3.4.28` which should be provided by libstdc++.so.6 from
  6. * GCC >= 9.3.0 (we are good here as well with GCC 10.2.0). If the program
  7. * executes successfully, that means we should use the system version of
  8. * libstdc++.so.6 and if not, that means we should use the bundled version.
  9. *
  10. * We use std::pmr::monotonic_buffer_resource in order to require
  11. * GLIBCXX_3.4.28:
  12. * https://github.com/gcc-mirror/gcc/blob/9e4ebad20a064d10df451cfb2cea9853d339a898/libstdc%2B%2B-v3/config/abi/pre/gnu.ver#L2303
  13. * The example below got inspired by
  14. * https://www.mail-archive.com/gcc-patches@gcc.gnu.org/msg227964.html.
  15. */
  16. #include <memory_resource>
  17. int main () {
  18. std::pmr::monotonic_buffer_resource res;
  19. void* a = res.allocate(1);
  20. res.release();
  21. return 0;
  22. }