public inbox for
 help / color / mirror / Atom feed
* Wrap test-fpucw.c for ARM
@ 2013-06-18  0:31 Joseph S. Myers
  0 siblings, 0 replies; only message in thread
From: Joseph S. Myers @ 2013-06-18  0:31 UTC (permalink / raw)
  To: libc-ports

I've applied this patch to stop math/test-fpucw failing for soft-float
ARM when testing on non-VFP hardware, using what seemed the least
fragile of the approaches discussed: adding an ARM version of
test-fpucw.c that defines _LIBC_TEST and using _LIBC_TEST in the
fpu_control.h condition that determines whether to use VFP definitions
even for soft-float.

2013-06-18  Joseph Myers  <>

	* sysdeps/arm/fpu_control.h [!_LIBC && __SOFTFP__]: Change
	condition to [!(_LIBC && !_LIBC_TEST) && __SOFTFP__].
	* sysdeps/arm/test-fpucw.c: New file.

diff --git a/ports/sysdeps/arm/fpu_control.h b/ports/sysdeps/arm/fpu_control.h
index 2fee79f..3ceb58b 100644
--- a/ports/sysdeps/arm/fpu_control.h
+++ b/ports/sysdeps/arm/fpu_control.h
@@ -19,7 +19,7 @@
 #ifndef _FPU_CONTROL_H
 #define _FPU_CONTROL_H
-#if !defined(_LIBC) && defined(__SOFTFP__)
+#if !(defined(_LIBC) && !defined(_LIBC_TEST)) && defined(__SOFTFP__)
 #define _FPU_RESERVED 0xffffffff
 #define _FPU_DEFAULT  0x00000000
diff --git a/ports/sysdeps/arm/test-fpucw.c b/ports/sysdeps/arm/test-fpucw.c
new file mode 100644
index 0000000..9fc721c
--- /dev/null
+++ b/ports/sysdeps/arm/test-fpucw.c
@@ -0,0 +1,5 @@
+/* Defining _LIBC_TEST stops fpu_control.h from defining the
+   hard-float versions of macros (for use with dynamic VFP detection)
+   when compiling for soft-float.  */
+#define _LIBC_TEST
+#include <math/test-fpucw.c>

Joseph S. Myers

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-06-18  0:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-18  0:31 Wrap test-fpucw.c for ARM Joseph S. Myers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).