https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017
--- Comment #12 from Dave Murphy <davem at devkitpro dot org> --- Naive patch based on https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017#c7 gets my canadian crosses building. diff --git a/libstdc++-v3/include/c_compatibility/fenv.h b/libstdc++-v3/include/c_compatibility/fenv.h index 0413e3b7c25..56cabaa3635 100644 --- a/libstdc++-v3/include/c_compatibility/fenv.h +++ b/libstdc++-v3/include/c_compatibility/fenv.h @@ -26,6 +26,10 @@ * This is a Standard C++ Library header. */ +#if !defined __cplusplus || defined _GLIBCXX_INCLUDE_NEXT_C_HEADERS +# include_next <fenv.h> +#else + #ifndef _GLIBCXX_FENV_H #define _GLIBCXX_FENV_H 1 diff --git a/libstdc++-v3/include/c_global/cfenv b/libstdc++-v3/include/c_global/cfenv index 0b0ec35a837..d24cb1a3c81 100644 --- a/libstdc++-v3/include/c_global/cfenv +++ b/libstdc++-v3/include/c_global/cfenv @@ -37,9 +37,11 @@ #include <bits/c++config.h> -#if _GLIBCXX_HAVE_FENV_H -# include <fenv.h> -#endif +// Need to ensure this finds the C library's <fenv.h> not a libstdc++ +// wrapper that might already be installed later in the include search path. +#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS +#include_next <fenv.h> +#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS #ifdef _GLIBCXX_USE_C99_FENV_TR1