From c6c83c08841734eb2c9d9ed72c645c1f6ef12da2 Mon Sep 17 00:00:00 2001 From: Scott Beamer Date: Sat, 25 Jul 2015 11:14:49 -0700 Subject: [PATCH] add support for missing c++11 functions to newlib Due to a few missing double long complex functions, newlib fail's configure's c99 tests. With _GLIBCXX_USE_C99 unset, a variety of C++11 functions are lost, including to_string and snprintf. This modifies configure to not depend on the results of the complex test. This change is safe since code that attempts to use these missing complex functions will still fail to compile. --- patches/gcc | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/patches/gcc b/patches/gcc index 9b8a8409..e468ed02 100644 --- a/patches/gcc +++ b/patches/gcc @@ -308,3 +308,28 @@ diff -ru gcc-5.1.0.orig/libsanitizer/sanitizer_common/sanitizer_platform_limits_ const unsigned struct___old_kernel_stat_sz = 0; #elif !defined(__sparc__) const unsigned struct___old_kernel_stat_sz = 32; +--- original-gcc/libstdc++-v3/configure ++++ gcc/libstdc++-v3/configure +@@ -16641,7 +16641,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + # Long term, -std=c++0x could be even better, could manage to explicitly + # request C99 facilities to the underlying C headers. + ac_save_CXXFLAGS="$CXXFLAGS" +- CXXFLAGS="$CXXFLAGS -std=c++98" ++ CXXFLAGS="$CXXFLAGS -std=gnu++98" + ac_save_LIBS="$LIBS" + ac_save_gcc_no_link="$gcc_no_link" + +@@ -17263,9 +17263,11 @@ rm -f core conftest.err conftest.$ac_obj + $as_echo "$glibcxx_cv_c99_wchar" >&6; } + fi + ++ # For newlib, don't check complex since missing c99 functions, but ++ # rest of c99 stuff is there so don't loose it + # Option parsed, now set things appropriately. + if test x"$glibcxx_cv_c99_math" = x"no" || +- test x"$glibcxx_cv_c99_complex" = x"no" || ++ # test x"$glibcxx_cv_c99_complex" = x"no" || + test x"$glibcxx_cv_c99_stdio" = x"no" || + test x"$glibcxx_cv_c99_stdlib" = x"no" || + test x"$glibcxx_cv_c99_wchar" = x"no"; then +