This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
V3 PATCH: Fix arm-none-elf failures
- From: Mark Mitchell <mark at codesourcery dot com>
- To: libstdc++ at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Mon, 29 Dec 2003 11:28:03 -0800
- Subject: V3 PATCH: Fix arm-none-elf failures
- Reply-to: mark at codesourcery dot com
This patch fixes several classes of failures on arm-none-elf:
(1) All tests that depend on fstat working are XFAILed because the GNU
simulator does not correctly handle fstat. Fixing that should be
done in coordination with ARM, since the GNU simulator uses a
published ARM API. We've started that discussion with ARM, but,
in the meantime, it makes sense to XFAIL the tests.
(2) The c99_classification_macros tests were failing because Newlib
does not implement all of the C99 support required by V3. It
does, however, implement the C99 math support, so this patch
changes std_cmath.h to use a finer-grained test to decide whether
or not to enable the capture of fpclassify and friends.
(3) All Newlib targets support S_IREG and S_IFREG, so I added that to
the list of Newlib hard-coded defines in configure.ac.
Tested on arm-none-elf, applied on the mainline and on the
csl-arm-branch.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
2003-12-29 Mark Mitchell <mark@codesourcery.com>
* acconfig.h: Add _GLIBCXX_USE_C99_MATH.
* acinclude.m4 (GLIBCXX_ENABLE_C99): Define GLIBCXX_USE_C99_MATH.
* configure.ac: Define HAVE_S_ISREG and HAVE_S_IFREG when
targeting newlib.
* aclocal.m4: Regenerated.
* config.h.in: Likewise.
* configure: Likewise.
* Makefile.in: Likewise.
* include/Makefile.in: Likewise.
* libmath/Makefile.in: Likewise.
* libsupc++/Makefile.in: Likewise.
* testsuite/Makefile.in: Likewise.
* src/Makefile.in: Likewise.
* po/Makefile.in: Likewise.
* include/c_std/std_cmath.h (_GLIBCXX_USE_C99): Replace with ...
(_GLIBCXX_USE_C99_MATH): ... this.
* testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc: XFAIL for
arm-none-elf.
* testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc: Likewise.
* testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc: Likewise.
* testsuite/27_io/basic_istream/readsome/char/6476-2.cc: Likewise.
* testsuite/27_io/objects/char/9.cc: Likewise.
* testsuite/ext/stdio_filebuf/char/10063-2.cc: Likewise.
Index: acconfig.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acconfig.h,v
retrieving revision 1.36.4.1
diff -c -5 -p -r1.36.4.1 acconfig.h
*** acconfig.h 23 Dec 2003 22:10:56 -0000 1.36.4.1
--- acconfig.h 29 Dec 2003 18:51:08 -0000
***************
*** 14,23 ****
--- 14,26 ----
#undef _GLIBCXX_SUPPORTS_WEAK
// Include I/O support for 'long long' and 'unsigned long long'.
#undef _GLIBCXX_USE_LONG_LONG
+ // Define if C99 math functions (like fpclassify) should be exposed.
+ #undef _GLIBCXX_USE_C99_MATH
+
// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed.
#undef _GLIBCXX_USE_C99
// Include support for 'long double'.
#undef _GLIBCXX_USE_LONG_DOUBLE
Index: acinclude.m4
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/acinclude.m4,v
retrieving revision 1.275.2.1
diff -c -5 -p -r1.275.2.1 acinclude.m4
*** acinclude.m4 23 Dec 2003 22:10:56 -0000 1.275.2.1
--- acinclude.m4 29 Dec 2003 18:51:08 -0000
*************** AC_DEFUN(GLIBCXX_ENABLE_C99, [
*** 864,873 ****
--- 864,877 ----
[islessgreater(0.0,0.0);],, [ac_c99_math=no])
AC_TRY_COMPILE([#include <math.h>],
[isunordered(0.0,0.0);],, [ac_c99_math=no])
AC_MSG_RESULT($ac_c99_math)
+ if test x"$ac_c99_math" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_C99_MATH)
+ fi
+
# Check for the existence in <stdio.h> of vscanf, et. al.
ac_c99_stdio=yes;
AC_MSG_CHECKING([for ISO C99 support in <stdio.h>])
AC_TRY_COMPILE([#include <stdio.h>],
[snprintf("12", 0, "%i");],, [ac_c99_stdio=no])
*************** AC_DEFUN(GLIBCXX_ENABLE_C99, [
*** 939,948 ****
--- 943,956 ----
test x"$ac_c99_stdlib" = x"no" ||
test x"$ac_c99_wchar" = x"no"; then
enable_c99=no;
fi;
AC_MSG_RESULT($enable_c99)
+
+ if test x"$ac_99_math" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_C99_MATH)
+ fi
# Option parsed, now set things appropriately
if test x"$enable_c99" = x"yes"; then
AC_DEFINE(_GLIBCXX_USE_C99)
fi
Index: configure.ac
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.ac,v
retrieving revision 1.11.4.1
diff -c -5 -p -r1.11.4.1 configure.ac
*** configure.ac 23 Dec 2003 22:11:20 -0000 1.11.4.1
--- configure.ac 29 Dec 2003 18:51:09 -0000
*************** else
*** 218,227 ****
--- 218,230 ----
AC_DEFINE(HAVE_SINF)
AC_DEFINE(HAVE_SINHF)
AC_DEFINE(HAVE_SQRTF)
AC_DEFINE(HAVE_TANF)
AC_DEFINE(HAVE_TANHF)
+
+ AC_DEFINE(HAVE_S_ISREG)
+ AC_DEFINE(HAVE_S_IFREG)
else
m4_include([crossconfig.m4])
fi
# At some point, we should differentiate between architectures
Index: include/c_std/std_cmath.h
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/include/c_std/std_cmath.h,v
retrieving revision 1.12.4.1
diff -c -5 -p -r1.12.4.1 std_cmath.h
*** include/c_std/std_cmath.h 23 Dec 2003 22:11:44 -0000 1.12.4.1
--- include/c_std/std_cmath.h 29 Dec 2003 18:51:09 -0000
*************** namespace std
*** 435,445 ****
tanh(_Tp __x)
{ return __builtin_tanh(__x); }
}
! #if _GLIBCXX_USE_C99
#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
// These are possible macros imported from C99-land. For strict
// conformance, remove possible C99-injected names from the global
// namespace, and sequester them in the __gnu_cxx extension namespace.
namespace __gnu_cxx
--- 435,445 ----
tanh(_Tp __x)
{ return __builtin_tanh(__x); }
}
! #if _GLIBCXX_USE_C99_MATH
#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
// These are possible macros imported from C99-land. For strict
// conformance, remove possible C99-injected names from the global
// namespace, and sequester them in the __gnu_cxx extension namespace.
namespace __gnu_cxx
*************** namespace __gnu_cxx
*** 512,522 ****
#undef islessgreater
#undef isunordered
#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
#endif
! #if _GLIBCXX_USE_C99
#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
namespace __gnu_cxx
{
template<typename _Tp>
int
--- 512,522 ----
#undef islessgreater
#undef isunordered
#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
#endif
! #if _GLIBCXX_USE_C99_MATH
#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
namespace __gnu_cxx
{
template<typename _Tp>
int
Index: testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc,v
retrieving revision 1.4
diff -c -5 -p -r1.4 1-in.cc
*** testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc 23 Sep 2003 20:03:00 -0000 1.4
--- testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc 29 Dec 2003 18:51:09 -0000
***************
*** 16,25 ****
--- 16,29 ----
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+ // The ARM simulator does not provide support for "fstat", which
+ // causes "in_avail" to return an incorrect value.
+ // { dg-do run { xfail arm-none-elf } }
+
// 27.8.1.4 Overridden virtual functions
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
Index: testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc,v
retrieving revision 1.5
diff -c -5 -p -r1.5 1-io.cc
*** testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc 23 Sep 2003 20:03:00 -0000 1.5
--- testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc 29 Dec 2003 18:51:09 -0000
***************
*** 16,25 ****
--- 16,29 ----
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+ // The ARM simulator does not provide support for "fstat", which
+ // causes "in_avail" to return an incorrect value.
+ // { dg-do run { xfail arm-none-elf } }
+
// 27.8.1.4 Overridden virtual functions
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
Index: testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc,v
retrieving revision 1.3
diff -c -5 -p -r1.3 2-in.cc
*** testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc 23 Sep 2003 20:03:00 -0000 1.3
--- testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc 29 Dec 2003 18:51:09 -0000
***************
*** 16,25 ****
--- 16,29 ----
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+ // The ARM simulator does not provide support for "fstat", which
+ // causes "in_avail" to return an incorrect value.
+ // { dg-do run { xfail arm-none-elf } }
+
// 27.8.1.4 Overridden virtual functions
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
Index: testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc,v
retrieving revision 1.3
diff -c -5 -p -r1.3 2-io.cc
*** testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc 23 Sep 2003 20:03:00 -0000 1.3
--- testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc 29 Dec 2003 18:51:09 -0000
***************
*** 16,25 ****
--- 16,29 ----
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+ // The ARM simulator does not provide support for "fstat", which
+ // causes "in_avail" to return an incorrect value.
+ // { dg-do run { xfail arm-none-elf } }
+
// 27.8.1.4 Overridden virtual functions
#include <fstream>
#include <testsuite_hooks.h>
#include <testsuite_io.h>
Index: testsuite/27_io/basic_istream/readsome/char/6746-2.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc,v
retrieving revision 1.2
diff -c -5 -p -r1.2 6746-2.cc
*** testsuite/27_io/basic_istream/readsome/char/6746-2.cc 23 Sep 2003 20:03:09 -0000 1.2
--- testsuite/27_io/basic_istream/readsome/char/6746-2.cc 29 Dec 2003 18:51:09 -0000
***************
*** 16,25 ****
--- 16,29 ----
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+ // The ARM simulator does not provide support for "fstat", which
+ // causes "in_avail" to return an incorrect value.
+ // { dg-do run { xfail arm-none-elf } }
+
// 27.6.1.3 unformatted input functions
// @require@ %-*.tst %-*.txt
// @diff@ %-*.tst %-*.txt
#include <cstring> // for strncmp,...
Index: testsuite/27_io/objects/char/9.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/27_io/objects/char/9.cc,v
retrieving revision 1.2
diff -c -5 -p -r1.2 9.cc
*** testsuite/27_io/objects/char/9.cc 23 Sep 2003 20:03:28 -0000 1.2
--- testsuite/27_io/objects/char/9.cc 29 Dec 2003 18:51:10 -0000
***************
*** 16,25 ****
--- 16,29 ----
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+ // The ARM simulator does not provide support for "fstat", which
+ // causes "in_avail" to return an incorrect value.
+ // { dg-do run { xfail arm-none-elf } }
+
#include <iostream>
#include <cstdio>
#include <testsuite_hooks.h>
void test09()
Index: testsuite/ext/stdio_filebuf/char/10063-2.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/testsuite/ext/stdio_filebuf/char/10063-2.cc,v
retrieving revision 1.1.2.1
diff -c -5 -p -r1.1.2.1 10063-2.cc
*** testsuite/ext/stdio_filebuf/char/10063-2.cc 23 Dec 2003 22:12:09 -0000 1.1.2.1
--- testsuite/ext/stdio_filebuf/char/10063-2.cc 29 Dec 2003 18:51:10 -0000
***************
*** 14,23 ****
--- 14,27 ----
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+ // The ARM simulator does not provide support for "fstat", which
+ // causes "sbumpc" to return an incorrect value.
+ // { dg-do run { xfail arm-none-elf } }
+
#include <cstdio>
#include <fstream>
#include <ext/stdio_filebuf.h>
#include <testsuite_hooks.h>