The macro __GLIBCXX__
contains the time stamp of libstdc++ releases, e.g., from gcc documentation (https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_macros.html)
__GLIBCXX__
The current version of libstdc++ in compressed ISO date format, as an unsigned long. For details on the value of this particular macro for a particular release, please consult the ABI Policy and Guidelines appendix.
I am looking for the values for all releases since the release of 4.9.0 (including releases of smaller versions like 4.8.x).
The documentation of libstdc++ does not seem to provide this information (it only provides the dates up to gcc 4.7.0).
Where can I find the values of __GLIBCXX__
? Does anybody have them?
The ABI Policy and Guidelines appendix (https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html) says
Incremental bumping of a library pre-defined macro. For releases before 3.4.0, the macro is GLIBCPP. For later releases, it's GLIBCXX. (The libstdc++ project generously changed from CPP to CXX throughout its source to allow the "C" pre-processor the CPP macro namespace.) These macros are defined as the date the library was released, in compressed ISO date format, as an unsigned long.
but then only provides the values of the macro up to GCC 4.7.0. Still the day of a particular GCC releases are listed here:
https://gcc.gnu.org/releases.html
but for example for GCC 4.9.1 with release date "July 16, 2014" the ISO date format is 20140716 and the value of __GLIBCXX__
is 20140617 (notice the 7 and 6 have been switched).
The information you want is useless anyway, so you should solve your problem a different way.
GCC 4.9.3 was released after GCC 5.3, so it has a later date in that macro, so you can't just do something like:
#if __GLIBCXX__ > 20150422 // GCC 5.1 release
because that would be true for 4.9.3, but that doesn't have all the features that 5.1 has.
Most GNU/Linux distros don't ship official FSF releases either, they build snapshots, which will have the date of the snapshot, which won't be in any list of release dates. And a snapshot from the 5.x branch on a given day will have the same date as a snapshot from the 6.x branch on a given day, so you can't tell them apart.
In the interest of answering the original question, here's a hacky command you can execute in your shell to get the list of releases and the value of __GLIBCXX__
for each release (starting with v4.1.0):
svn list "svn://gcc.gnu.org/svn/gcc/tags" | grep -o "gcc_\([^34]_.*\|4_[^0]_.*\)_release" | xargs -n 1 -I {} sh -c "printf \"{}: \" && svn cat svn://gcc.gnu.org/svn/gcc/tags/{}/gcc/DATESTAMP"
The results are:
Note that these values are from the official releases from the GCC team. If you're using an unofficial release, the values might differ slightly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With