This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFC: Stop using accross.m4


config/accross.m4 defines two macros AC_COMPILE_CHECK_SIZEOF and AC_C_BIGENDIAN_CROSS.

Both of these macros have more comprehensive versions that come with autoconf 2.59: AC_CHECK_SIZEOF and AC_C_BIGENDIAN respectively.

The first change is a nobrainer as it is a pure superset.

The second has one caveat is that in addition to WORDS_BIG_ENDIAN which AC_C_BIGENDIAN defines, AC_C_BIGENDIAN_CROSS defined BYTEORDER and HOST_WORDS_BIG_ENDIAN. One the plus side, the macro defined HOST_WORDS_BIG_ENDIAN to be the same as WORDS_BIG_ENDIAN and BYTEORDER was either 1234 or 4321 depending on WORDS_BIG_ENDIAN.

BYTEORDER is not used within all of GCC. HOST_WORDS_BIG_ENDIAN is only used in mips-tfile.c and that usage predates cvs. As it is a target file, it should be using WORDS_BIG_ENDIAN. Regardless the definition of the two macros are always the same .. except in one instance.

HOST_WORDS_BIG_ENDIAN was only directly modified by m32r. I'm 95% sure this was due to an incorrect merge for adding m32r linux support as zack had previously deleted all references to this macro in 2001 and in fact deleted the xm-m32r file. Nick restored this definition back into m32r.h and then undefines it for linux. I deleted the HOST_WORDS_BIG_ENDIAN define/undef out of both of them.

In fact, looking back at it the restored version 1.8 of xm-m32r.h is (sans whitespace) the exact same as version 1.1. So, I'm positive that both xm-m32r.h and xm-linux.h should just be deleted.

http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/m32r/xm-m32r.h.diff?r1=1.1&r2=1.8&f=s

Besides would anyone actually be making a m32r->mips cross compiler which is the only combination that could possibly be affected?

Bootstrapped and regtested i686-pc-cygwin

OK to install
[gcc]
2005-05-03  Kelley Cook  <kcook@gcc.gnu.org>

	* config/m32r/xm-m32r.h: Don't define HOST_WORDS_BIG_ENDIAN.
	* config/m32r/xm-linux.h: Don't undefine HOST_WORDS_BIG_ENDIAN.
	* mips-tfile.c: Use WORDS_BIG_ENDIAN instead of HOST_WORDS_BIG_ENDIAN.
	* aclocal.m4: Don't include accross.m4.
	* configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS.
	Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF.
	* configure, config.in: Regenerate.
	
[fastjar]
2005-05-03  Kelley Cook  <kcook@gcc.gnu.org>

	* configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS.
	Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF.
	* aclocal.m4, Makefile.in, configure, config.h.in: Regenerate.

[libffi]
2005-05-03  Kelley Cook  <kcook@gcc.gnu.org>

	* configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS.
	Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF.
	* aclocal.m4, configure, fficonfig.h.in, Makefile.in,
	include/Makefile.in, testsuite/Makefile.in: Regenerate.
	
[libiberty]
2005-05-03  Kelley Cook  <kcook@gcc.gnu.org>

	* configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS.
	Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF.
	* aclocal.m4: Don't include accross.m4.
	* configure, config.in: Regenerate.

[libjava]
2005-05-03  Kelley Cook  <kcook@gcc.gnu.org>

	* configure.ac: Use AC_C_BIGENDIAN instead of AC_C_BIGENDIAN_CROSS.
	Use AC_CHECK_SIZEOF instead of AC_COMPILE_CHECK_SIZEOF.
	* aclocal.m4, configure, config.h.in, include/config.h.in,
	Makefile.in, include/Makefile.in, testsuite/Makefile.in,
	external/Makefile.in, external/sax/Makefile.in, 
	external/w3c_dom/Makefile.in, gcj/Makefile.in: Regenerate.
	
diff -prud ../gcc-orig/fastjar/configure.ac ./fastjar/configure.ac
--- ../gcc-orig/fastjar/configure.ac	2005-03-16 01:02:45.000000000 -0500
+++ ./fastjar/configure.ac	2005-05-02 17:38:03.920872500 -0400
@@ -37,14 +37,14 @@ AC_STRUCT_TM
 gcc_AC_FUNC_MKDIR_TAKES_ONE_ARG
 
 dnl Check for type-widths
-AC_COMPILE_CHECK_SIZEOF(char)
-AC_COMPILE_CHECK_SIZEOF(short)
-AC_COMPILE_CHECK_SIZEOF(int)
-AC_COMPILE_CHECK_SIZEOF(long)
-AC_CHECK_TYPES([long long],[AC_COMPILE_CHECK_SIZEOF(long long)])
+AC_CHECK_SIZEOF(char)
+AC_CHECK_SIZEOF(short)
+AC_CHECK_SIZEOF(int)
+AC_CHECK_SIZEOF(long)
+AC_CHECK_TYPES([long long],[AC_CHECK_SIZEOF(long long)])
 
 dnl Check byte order
-AC_C_BIGENDIAN_CROSS
+AC_C_BIGENDIAN
 
 AC_ARG_WITH(system-zlib,
 [  --with-system-zlib      use installed libz])
diff -prud ../gcc-orig/gcc/aclocal.m4 ./gcc/aclocal.m4
--- ../gcc-orig/gcc/aclocal.m4	2005-03-30 03:18:03.000000000 -0500
+++ ./gcc/aclocal.m4	2005-05-02 17:42:16.476474500 -0400
@@ -1,4 +1,3 @@
-m4_include([../config/accross.m4])
 m4_include([../config/acx.m4])
 m4_include([../config/gettext-sister.m4])
 m4_include([../config/iconv.m4])
diff -prud ../gcc-orig/gcc/config/m32r/xm-linux.h ./gcc/config/m32r/xm-linux.h
--- ../gcc-orig/gcc/config/m32r/xm-linux.h	2003-12-31 05:33:02.000000000 -0500
+++ ./gcc/config/m32r/xm-linux.h	2005-05-02 17:26:04.698196400 -0400
@@ -20,7 +20,3 @@
 
 #include <m32r/xm-m32r.h>
 #include <xm-linux.h>
-
-/* Doubles are stored in memory with the high order word first.
-   This matters when cross-compiling.  */
-#undef HOST_WORDS_BIG_ENDIAN
diff -prud ../gcc-orig/gcc/config/m32r/xm-m32r.h ./gcc/config/m32r/xm-m32r.h
--- ../gcc-orig/gcc/config/m32r/xm-m32r.h	2004-03-15 13:20:48.000000000 -0500
+++ ./gcc/config/m32r/xm-m32r.h	2005-05-02 17:25:51.369429300 -0400
@@ -25,10 +25,6 @@
 #define HOST_BITS_PER_LONG      32
 #define HOST_BITS_PER_LONGLONG  64
 
-/* Doubles are stored in memory with the high order word first.
-   This matters when cross-compiling.  */
-#define HOST_WORDS_BIG_ENDIAN    1
-
 /* target machine dependencies.
    tm.h is a symbolic link to the actual target specific file.  */
 #include "tm.h"
diff -prud ../gcc-orig/gcc/configure.ac ./gcc/configure.ac
--- ../gcc-orig/gcc/configure.ac	2005-04-27 16:35:38.000000000 -0400
+++ ./gcc/configure.ac	2005-05-02 17:36:33.413436700 -0400
@@ -893,7 +893,7 @@ AC_CHECK_HEADER(pthread.h, [have_pthread
 
 # These tests can't be done till we know if we have limits.h.
 gcc_AC_C_CHAR_BIT
-AC_C_BIGENDIAN_CROSS
+AC_C_BIGENDIAN
 
 # --------
 # UNSORTED
diff -prud ../gcc-orig/gcc/mips-tfile.c ./gcc/mips-tfile.c
--- ../gcc-orig/gcc/mips-tfile.c	2005-04-28 01:38:33.000000000 -0400
+++ ./gcc/mips-tfile.c	2005-05-02 17:05:25.413265000 -0400
@@ -2358,7 +2358,7 @@ initialize_init_file (void)
   init_file.fdr.fMerge = 1;
   init_file.fdr.glevel = GLEVEL_2;
 
-#ifdef HOST_WORDS_BIG_ENDIAN
+#ifdef WORDS_BIG_ENDIAN
   init_file.fdr.fBigendian = 1;
 #endif
 
diff -prud ../gcc-orig/libffi/configure.ac ./libffi/configure.ac
--- ../gcc-orig/libffi/configure.ac	2005-04-29 09:15:01.000000000 -0400
+++ ./libffi/configure.ac	2005-05-02 17:46:53.987213700 -0400
@@ -118,8 +118,8 @@ AC_HEADER_STDC
 AC_CHECK_FUNCS(memcpy)
 AC_FUNC_ALLOCA
 
-AC_COMPILE_CHECK_SIZEOF(double)
-AC_COMPILE_CHECK_SIZEOF(long double)
+AC_CHECK_SIZEOF(double)
+AC_CHECK_SIZEOF(long double)
 
 # Also AC_SUBST this variable for ffi.h.
 HAVE_LONG_DOUBLE=0
@@ -131,7 +131,7 @@ if test $ac_cv_sizeof_double != $ac_cv_s
 fi
 AC_SUBST(HAVE_LONG_DOUBLE)
 
-AC_C_BIGENDIAN_CROSS
+AC_C_BIGENDIAN
 
 if test x$TARGET = xSPARC; then
     AC_CACHE_CHECK([assembler and linker support unaligned pc related relocs],
diff -prdu -x '*~' -x autom4te.cache /home/kcook34/gcc-orig/libiberty/aclocal.m4 ./aclocal.m4
--- /home/kcook34/gcc-orig/libiberty/aclocal.m4 2004-12-27 16:00:11.000000000 -0500
+++ ./aclocal.m4        2005-05-03 13:52:58.103791200 -0400
@@ -1,4 +1,3 @@
-sinclude(../config/accross.m4)
 sinclude(../config/acx.m4)
 sinclude(../config/no-executables.m4)
  
diff -prud ../gcc-orig/libiberty/configure.ac ./libiberty/configure.ac
--- ../gcc-orig/libiberty/configure.ac	2005-04-15 20:40:07.000000000 -0400
+++ ./libiberty/configure.ac	2005-05-02 17:36:34.034310900 -0400
@@ -130,7 +130,7 @@ AC_SUBST(OUTPUT_OPTION)
 
 AC_C_CONST
 AC_C_INLINE
-AC_C_BIGENDIAN_CROSS
+AC_C_BIGENDIAN
 
 dnl When we start using libtool:
 dnl Default to a non shared library.  This may be overridden by the
diff -prud ../gcc-orig/libjava/configure.ac ./libjava/configure.ac
--- ../gcc-orig/libjava/configure.ac	2005-04-29 18:09:43.000000000 -0400
+++ ./libjava/configure.ac	2005-05-02 17:56:00.787116000 -0400
@@ -1136,9 +1136,9 @@ LT_AC_PROG_GCJ
 
 CPPFLAGS=$GCJ_SAVE_CPPFLAGS
 
-AC_COMPILE_CHECK_SIZEOF(void *)
+AC_CHECK_SIZEOF(void *)
 
-AC_C_BIGENDIAN_CROSS
+AC_C_BIGENDIAN
 
 ZLIBS=
 SYS_ZLIBS=

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]