# HG changeset patch # User Markus Mützel # Date 1645961927 -3600 # Node ID 27a52c235a353e642e054d4eb8e032a296205948 # Parent c8eab19638534df3edb16b2396a302beadd029c7# Parent 0ed7d58e24d5fa08985c7913e4c80795e03030fc maint: Merge release to default. diff -r c8eab1963853 -r 27a52c235a35 Makefile.in --- a/Makefile.in Fri Feb 25 15:34:54 2022 -0500 +++ b/Makefile.in Sun Feb 27 12:38:47 2022 +0100 @@ -987,6 +987,10 @@ rm -rf native-tools cross-tools octave gnuplot rm -f Makefile cmake-toolchain-file.stamp cmake-native-toolchain-file.stamp rm -f tools/set-mxe-env.sh + rm -f installer-files/octave-launch.exe \ + installer-files/octave-launch-firsttime.exe \ + installer-files/octave-launch.res \ + installer-files/.dirstamp .PHONY: realclean realclean: clean diff -r c8eab1963853 -r 27a52c235a35 src/native-gcc-1-canadian-cross.patch --- a/src/native-gcc-1-canadian-cross.patch Fri Feb 25 15:34:54 2022 -0500 +++ b/src/native-gcc-1-canadian-cross.patch Sun Feb 27 12:38:47 2022 +0100 @@ -1,42 +1,81 @@ -See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100017#c12 +From 01a70ccd723eb9a479186fe37c972b0d0f8676cf Mon Sep 17 00:00:00 2001 +From: Jonathan Wakely +Date: Fri, 7 Jan 2022 15:21:03 +0000 +Subject: [PATCH 1/1] libstdc++: Add -nostdinc++ for c++17 sources [PR100017] + +When building a build!=host compiler, the just-built gcc can't be used +to build the target libstdc++ (because it is built for the host triplet, +not the build triplet). The top-level configure.ac sets up the build +flags for libstdc++ (and other "raw_cxx" libs) like this: + +GCC_TARGET_TOOL(c++ for libstdc++, RAW_CXX_FOR_TARGET, CXX, + [gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs], + c++) + +The -nostdinc++ flag is only used for the IN-TREE-TOOL, i.e. when using +the just-built gcc/xgcc compiler. This means that the cross-compiler +used to build libstdc++ will add its own libstdc++ headers to the +include path. That results in the #include in +src/c++17/floating_to_chars.cc and src/c++17/floating_from_chars.cc +doing #include_next and finding the libstdc++ fenv.h wrapper +from the host compiler. Because that has the same include guard as the + in the libstdc++ we're trying to build, we never reach the +underlying from libc. That results in several errors of the +form: + +error: 'fenv_t' has not been declared in '::' + +The most correct fix would be to add -nostdinc++ to the +RAW_CXX_FOR_TARGET variable in configure.ac, or the +RAW_CXX_TARGET_EXPORTS variable in Makefile.tpl. + +Another solution would be to make the libstdc++ wrapper use +_GLIBCXX_INCLUDE_NEXT_C_HEADERS like our and other C header +wrappers. + +For now though, the simplest and safest solution is to just add +-nostdinc++ to the CXXFLAGS used for src/c++17/*.cc, which is what this +does. + +libstdc++-v3/ChangeLog: -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 - -@@ -83,3 +83,5 @@ namespace std - #endif // C++11 - - #endif // _GLIBCXX_FENV_H -+ -+#endif // include_next + PR libstdc++/100017 + * src/c++17/Makefile.am (AM_CXXFLAGS): Add -nostdinc++. + * src/c++17/Makefile.in: Regenerate. + +(cherry picked from commit 4fde88e5dd152fe866a97b12e0f8229970d15cb3) +--- + libstdc++-v3/src/c++17/Makefile.am | 2 +- + libstdc++-v3/src/c++17/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) -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 +diff --git a/libstdc++-v3/src/c++17/Makefile.am b/libstdc++-v3/src/c++17/Makefile.am +index cb94aff5f1a..2aebc6d5251 100644 +--- a/libstdc++-v3/src/c++17/Makefile.am ++++ b/libstdc++-v3/src/c++17/Makefile.am +@@ -79,7 +79,7 @@ endif + # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden + # as the occasion calls for it. + AM_CXXFLAGS = \ +- -std=gnu++17 \ ++ -std=gnu++17 -nostdinc++ \ + $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \ + $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \ + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) \ +diff --git a/libstdc++-v3/src/c++17/Makefile.in b/libstdc++-v3/src/c++17/Makefile.in +index 63984ecd52a..8c02be6514f 100644 +--- a/libstdc++-v3/src/c++17/Makefile.in ++++ b/libstdc++-v3/src/c++17/Makefile.in +@@ -455,7 +455,7 @@ libc__17convenience_la_SOURCES = $(sources) $(inst_sources) + # OPTIMIZE_CXXFLAGS on the compile line so that -O2 can be overridden + # as the occasion calls for it. + AM_CXXFLAGS = \ +- -std=gnu++17 \ ++ -std=gnu++17 -nostdinc++ \ + $(glibcxx_lt_pic_flag) $(glibcxx_compiler_shared_flag) \ + $(XTEMPLATE_FLAGS) $(VTV_CXXFLAGS) \ + $(WARN_CXXFLAGS) $(OPTIMIZE_CXXFLAGS) $(CONFIG_CXXFLAGS) \ +-- +2.27.0 + +