On 01/28/2011 04:58 AM, Ralf Corsepius wrote:
On 01/28/2011 10:15 AM, Andreas Schwab wrote:
Ralf Corsepius<ralf.corsep...@rtems.org>   writes:

- Remove newlib from the source tree
--without-newlib should probably be enough.
Good point, agreed.

In case of Joel and rtems the situation probably can be furtherly
simplified:

RTEMS has gcc-4.5.5-compiled newlib-rpms - Provided the set of multilibs
hasn't changed (and gcc hasn't changed too much), it probably will
suffice to install these newlib rpms and use them to build gcc against them.

That's true but I want to ensure that the GCC head does indeed
compile newlib and RTEMS with the GCC head.

On 01/28/2011 03:15 AM, Andreas Schwab wrote:
--without-newlib should probably be enough.

This almost works but libstdc++-v3/configure.ac explicitly
checks $with_newlib to trip some AC_DEFINE's which have
to be tripped to build.  I have a patch attached that logically
says if on target X, then you are always using newlib so
if you have "with_newlib" or "use_newlib", then set the
AC_DEFINE's.  There may be a better way to know if the
library installed is newlib.

So if --without-newlib is supposed to do the trick, then
it almost works.  I can build Ada, Go, and C++ with
--without-newlib and this patch or something similar
but better.

Ralf


--
Joel Sherrill, Ph.D.             Director of Research&  Development
joel.sherr...@oarcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
   Support Available             (256) 722-9985


Index: libstdc++-v3/configure
===================================================================
--- libstdc++-v3/configure      (revision 169331)
+++ libstdc++-v3/configure      (working copy)
@@ -26410,8 +26410,13 @@
   # GLIBCXX_CHECK_MATH_SUPPORT
 
   # First, test for "known" system libraries.  We may be using newlib even
-  # on a hosted environment.
-  if test "x${with_newlib}" = "xyes"; then
+  # on a hosted environment.  Since some environments always use newlib,
+  # we can assume newlib features even if building --without-newlib.
+  case "$target" in
+    *-*-rtems*) uses_newlib=yes ;;
+    *)          uses_newlib=no ;;
+  esac 
+  if test "x${with_newlib}" = "xyes" -o  "x${uses_newlib}" = "xyes" ; then
     os_include_dir="os/newlib"
     $as_echo "#define HAVE_HYPOT 1" >>confdefs.h
 
Index: libstdc++-v3/configure.ac
===================================================================
--- libstdc++-v3/configure.ac   (revision 169330)
+++ libstdc++-v3/configure.ac   (working copy)
@@ -226,8 +226,13 @@
   # GLIBCXX_CHECK_MATH_SUPPORT
 
   # First, test for "known" system libraries.  We may be using newlib even
-  # on a hosted environment.
-  if test "x${with_newlib}" = "xyes"; then
+  # on a hosted environment.  Since some environments always use newlib,
+  # we can assume newlib features even if building --without-newlib.
+  case "$target" in
+    *-*-rtems*) uses_newlib=yes ;;
+    *)          uses_newlib=no ;;
+  esac 
+  if test "x${with_newlib}" = "xyes" -o  "x${uses_newlib}" = "xyes" ; then
     os_include_dir="os/newlib"
     AC_DEFINE(HAVE_HYPOT)
 

Reply via email to