[ia64] Make all of sysdeps/ia64/fpu/libm-symbols.h only visible to libc||libm

Message ID 3d50ecc9-2c08-6bf9-53c8-1e66bbe5aab1@panix.com
State Superseded
Headers

Commit Message

Zack Weinberg Nov. 21, 2016, 5:38 p.m. UTC
  When experimenting with Joseph's build-many-glibcs.py I found that
sysdeps/ia64/fpu/libm-symbols.h and the -D switches added to the command
line by sysdeps/ia64/fpu/Makefile can break the math tests.  This patch
moves the -D switches into libm-symbols.h and makes that file only apply
when IS_IN(libc)||IS_IN(libm), which is sufficient to clear the test
failure I observed.

Tested (cross compile only) on ia64-linux-gnu. OK?

zw

---
 sysdeps/ia64/fpu/Makefile       |  6 +-----
 sysdeps/ia64/fpu/libm-symbols.h | 15 +++++++++++++++
 2 files changed, 16 insertions(+), 5 deletions(-)

 #if defined ASSEMBLER && IS_IN (libc)
 # define __libm_error_support	HIDDEN_JUMPTARGET(__libm_error_support)
 #endif
+
+#endif
  

Comments

Joseph Myers Nov. 21, 2016, 5:50 p.m. UTC | #1
On Mon, 21 Nov 2016, Zack Weinberg wrote:

> When experimenting with Joseph's build-many-glibcs.py I found that
> sysdeps/ia64/fpu/libm-symbols.h and the -D switches added to the command
> line by sysdeps/ia64/fpu/Makefile can break the math tests.  This patch
> moves the -D switches into libm-symbols.h and makes that file only apply
> when IS_IN(libc)||IS_IN(libm), which is sufficient to clear the test
> failure I observed.

My patch for this is at 
<https://sourceware.org/ml/libc-alpha/2016-11/msg00313.html>.  I'm not 
concerned with which fix goes in as long as this does get fixed.

My other fixes for build-many-glibcs.py are 
<https://sourceware.org/ml/libc-alpha/2016-11/msg00314.html> (ia64) and 
<https://sourceware.org/ml/libc-alpha/2016-11/msg00584.html> (nios2).  
With GCC 6 branch (which seems to give the cleanest results in my 
testing), I still get elf/check-execstack and elf/check-textrel failures 
for hppa, and elf/check-execstack failing for ia64, which I hope 
architecture maintainers might look at (if elf/check-execstack is hard to 
fix for an architecture, XFAILing as I did for MIPS with an appropriate 
explanatory comment seems reasonable).  (There are also build failures for 
ColdFire and MicroBlaze because of compiler issues.)

(I hope to extend build-many-glibcs.py for use as a bot to watch for 
regressions.  If the check stage fails because of existing test failures, 
that can hide other tests starting to fail.  So clean compilation tests 
for all architectures are desirable.)
  

Patch

diff --git a/sysdeps/ia64/fpu/Makefile b/sysdeps/ia64/fpu/Makefile
index 384fc83..450d712 100644
--- a/sysdeps/ia64/fpu/Makefile
+++ b/sysdeps/ia64/fpu/Makefile
@@ -26,9 +26,5 @@  libm-sysdep_routines += s_erfc s_erfcf s_erfcl \
 sysdep_routines += libc_libm_error libm_frexp libm_frexpf libm_frexpl \
 		   $(duplicated-routines)
 -sysdep-CPPFLAGS += -include libm-symbols.h \
-	-D__POSIX__ -Dopensource \
-	-D_LIB_VERSIONIMF=_LIB_VERSION \
-	-DSIZE_INT_32 -DSIZE_LONG_INT_64 -DSIZE_LONG_LONG_INT_64 \
-	-DSIZE_LONG_64 -DIA64
+sysdep-CPPFLAGS += -include libm-symbols.h
 endif
diff --git a/sysdeps/ia64/fpu/libm-symbols.h
b/sysdeps/ia64/fpu/libm-symbols.h
index 3cbc6c4..62c9adb 100644
--- a/sysdeps/ia64/fpu/libm-symbols.h
+++ b/sysdeps/ia64/fpu/libm-symbols.h
@@ -1,3 +1,16 @@ 
+#if IS_IN (libc) || IS_IN (libm)
+
+/* The externally maintained code in this directory expects these
+   macros to be defined.  */
+#define __POSIX__ 1
+#define opensource 1
+#define _LIB_VERSIONIMF _LIB_VERSION
+#define SIZE_INT_32 1
+#define SIZE_LONG_INT_64 1
+#define SIZE_LONG_LONG_INT_64 1
+#define SIZE_LONG_64 1
+#define IA64 1
+
 #include <sysdep.h>
 #undef ret	/* get rid of the stupid "ret" macro; it breaks br.ret */
 @@ -56,3 +69,5 @@