https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69413
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Dominik Vogt from comment #3) > So, what is the proper way to compile > > -- snip -- > #include <math.h> > -- snip -- > > using a current Gcc compiled with an old system Glibc so that the program > uses a new (not installed) Glibc? You can't, that's not supported. As I said, if you want to use glibc 2.22 headers from after the mentioned commit, libstdc++ must be built with those same headers. I thought this was fairly explicit: (In reply to Jonathan Wakely from comment #2) > Specifically, if you build GCC against glibc before > https://sourceware.org/git/gitweb.cgi?p=glibc.git; > h=d9b965fa56350d6eea9f7f438a0714c7ffbb183f and then update glibc to a > snapshot of 2.22 from git master after that commit, libstdc++ will not work. > In that case glibc still reports itself as 2.22 and libstdc++ won't detect > that the isinf and isnan declarations are gone, so must be reconfigured and > rebuilt against the new glibc headers. As a quick hack you can bump the value of __GLIBC_MINOR__ in ~/src/git/glibc/install/usr/include/features.h to make it appear to be glibc 2.23, but obviously that isn't supported either.