[Bug libstdc++/100017] error: 'fenv_t' has not been declared in '::' x86_64-w64-mingw32 host cross toolchain fails to build
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017 --- Comment #12 from Dave Murphy --- 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 +#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 -#if _GLIBCXX_HAVE_FENV_H -# include -#endif +// Need to ensure this finds the C library's not a libstdc++ +// wrapper that might already be installed later in the include search path. +#define _GLIBCXX_INCLUDE_NEXT_C_HEADERS +#include_next +#undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS #ifdef _GLIBCXX_USE_C99_FENV_TR1
[Bug libstdc++/100017] error: 'fenv_t' has not been declared in '::' x86_64-w64-mingw32 host cross toolchain fails to build
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017 --- Comment #11 from cqwrteur --- (In reply to Jonathan Wakely from comment #8) > I can only fix the case where the target (in the build tree) is > found first and then its #include_next finds the host (installed on > the host). > > But that seems to be the case that's breaking the canadian cross build. yeah. looks like this issue is very similar to stdint.h. I just removed fenv.h in libstdc++'s build and it works.
[Bug libstdc++/100017] error: 'fenv_t' has not been declared in '::' x86_64-w64-mingw32 host cross toolchain fails to build
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017 --- Comment #10 from cqwrteur --- (In reply to Jonathan Wakely from comment #8) > I can only fix the case where the target (in the build tree) is > found first and then its #include_next finds the host (installed on > the host). > > But that seems to be the case that's breaking the canadian cross build. The same issue happens with x86_64-linux-gnu build, x86_64-w64-mingw32 host, x86_64-ubuntu-linux-gnu target /home/cqwrteur/myhome/glibc231/mingw_toolchain/mingw-host-linux/gcc/x86_64-ubuntu-linux-gnu/libstdc++-v3/include/cfenv:77:11: error: 'feupdateenv' has not been declared in '::' 77 | using ::feupdateenv; Looks like it has something to do with fenv.h
[Bug libstdc++/100017] error: 'fenv_t' has not been declared in '::' x86_64-w64-mingw32 host cross toolchain fails to build
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017 --- Comment #9 from cqwrteur --- (In reply to Jonathan Wakely from comment #8) > I can only fix the case where the target (in the build tree) is > found first and then its #include_next finds the host (installed on > the host). > > But that seems to be the case that's breaking the canadian cross build. it looks like the issue still exists in GCC 12.0.0
[Bug libstdc++/100017] error: 'fenv_t' has not been declared in '::' x86_64-w64-mingw32 host cross toolchain fails to build
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017 --- Comment #8 from Jonathan Wakely --- I can only fix the case where the target (in the build tree) is found first and then its #include_next finds the host (installed on the host). But that seems to be the case that's breaking the canadian cross build.
[Bug libstdc++/100017] error: 'fenv_t' has not been declared in '::' x86_64-w64-mingw32 host cross toolchain fails to build
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2021-04-21 Ever confirmed|0 |1 --- Comment #7 from Jonathan Wakely --- The target build is finding the host libstdc++'s which has the same _GLIBCXX_FENV_H include guard, so when the target does: #include_next it doesn't do anything. It might be necessary to do something simialr to what's in : // Need to ensure this finds the C library's not a libstdc++ // wrapper that might already be installed later in the include search path. #define _GLIBCXX_INCLUDE_NEXT_C_HEADERS #include_next #undef _GLIBCXX_INCLUDE_NEXT_C_HEADERS where the libstdc++ wrapper does: #if !defined __cplusplus || defined _GLIBCXX_INCLUDE_NEXT_C_HEADERS # include_next #else #ifndef _GLIBCXX_STDLIB_H #define _GLIBCXX_STDLIB_H 1 That ensures that we eventually reach the libc and not just another libstdc++ wrapper.
[Bug libstdc++/100017] error: 'fenv_t' has not been declared in '::' x86_64-w64-mingw32 host cross toolchain fails to build
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017 --- Comment #6 from Jonathan Wakely --- >From IRC: It works if I add -nostdinc++ manually to the compile line that fails then I don't get the error
[Bug libstdc++/100017] error: 'fenv_t' has not been declared in '::' x86_64-w64-mingw32 host cross toolchain fails to build
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017 --- Comment #5 from cqwrteur --- Created attachment 50548 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50548=edit linux build, FreeBSD host, Windows target The error still exists. It looks MSVCRT does not always define those C11 cfenv functions and the feature testing macro does not detect them correctly???
[Bug libstdc++/100017] error: 'fenv_t' has not been declared in '::' x86_64-w64-mingw32 host cross toolchain fails to build
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017 --- Comment #4 from cqwrteur --- (In reply to cqwrteur from comment #2) > not a bug it looks like it is a bug here.
[Bug libstdc++/100017] error: 'fenv_t' has not been declared in '::' x86_64-w64-mingw32 host cross toolchain fails to build
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017 cqwrteur changed: What|Removed |Added Resolution|INVALID |--- Status|RESOLVED|UNCONFIRMED --- Comment #3 from cqwrteur --- (In reply to cqwrteur from comment #2) > not a bug it is weird tbh. There must be something to do with cfenv header or charconv
[Bug libstdc++/100017] error: 'fenv_t' has not been declared in '::' x86_64-w64-mingw32 host cross toolchain fails to build
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017 cqwrteur changed: What|Removed |Added Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #2 from cqwrteur --- not a bug
[Bug libstdc++/100017] error: 'fenv_t' has not been declared in '::' x86_64-w64-mingw32 host cross toolchain fails to build
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017 --- Comment #1 from cqwrteur --- I tried to build a full host GCC toolchain from Linux to Windows and fenv_t does not exist.