diff options
-rw-r--r-- | gcc/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/aclocal.m4 | 1 | ||||
-rw-r--r-- | gcc/config.in | 10 | ||||
-rw-r--r-- | gcc/config/m32r/xm-linux.h | 4 | ||||
-rw-r--r-- | gcc/config/m32r/xm-m32r.h | 4 | ||||
-rwxr-xr-x | gcc/configure | 144 | ||||
-rw-r--r-- | gcc/configure.ac | 2 | ||||
-rw-r--r-- | gcc/mips-tfile.c | 2 |
8 files changed, 96 insertions, 81 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aac45faaf1d..37671990b4e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2005-05-04 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. + 2005-05-04 Jakub Jelinek <jakub@redhat.com> PR middle-end/21265 diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4 index f5e13d8a15b..ad7f518f8ed 100644 --- a/gcc/aclocal.m4 +++ b/gcc/aclocal.m4 @@ -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 --git a/gcc/config.in b/gcc/config.in index eae8b5465c1..74c3e5a5fca 100644 --- a/gcc/config.in +++ b/gcc/config.in @@ -1,8 +1,5 @@ /* config.in. Generated from configure.ac by autoheader. */ -/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */ -#undef BYTEORDER - /* Define as the number of bits in a byte, if \`limits.h' doesn't. */ #undef CHAR_BIT @@ -609,10 +606,6 @@ /* Define if your compiler supports the \`__int64' type. */ #undef HAVE___INT64 -/* Define if the host machine stores words of multi-word integers in - big-endian order. */ -#undef HOST_WORDS_BIG_ENDIAN - /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST @@ -686,7 +679,8 @@ The default is the GCC version number. */ #undef WIN32_REGISTRY_KEY -/* whether byteorder is bigendian */ +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ #undef WORDS_BIGENDIAN /* Always define this when using the GNU C Library */ diff --git a/gcc/config/m32r/xm-linux.h b/gcc/config/m32r/xm-linux.h index 1c6f4629798..ed7fb68caef 100644 --- a/gcc/config/m32r/xm-linux.h +++ b/gcc/config/m32r/xm-linux.h @@ -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 --git a/gcc/config/m32r/xm-m32r.h b/gcc/config/m32r/xm-m32r.h index c7b006ae3b5..4fd6c06af71 100644 --- a/gcc/config/m32r/xm-m32r.h +++ b/gcc/config/m32r/xm-m32r.h @@ -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 --git a/gcc/configure b/gcc/configure index bf9966f4340..4c4f3171d9a 100755 --- a/gcc/configure +++ b/gcc/configure @@ -8344,8 +8344,7 @@ echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 if test "${ac_cv_c_bigendian+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_bigendian=unknown -# See if sys/param.h defines the BYTE_ORDER macro. + # See if sys/param.h defines the BYTE_ORDER macro. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8354,13 +8353,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> + int main () { - #if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN bogus endian macros #endif + ; return 0; } @@ -8396,13 +8396,14 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <sys/types.h> #include <sys/param.h> + int main () { - #if BYTE_ORDER != BIG_ENDIAN not big endian #endif + ; return 0; } @@ -8441,11 +8442,69 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -if test $ac_cv_c_bigendian = unknown; then -if test "$cross_compiling" = yes; then - echo $ac_n "cross-compiling... " 2>&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -8453,7 +8512,9 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -main () { +int +main () +{ /* Are we little or big endian? From Harbison&Steele. */ union { @@ -8487,67 +8548,26 @@ fi rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -if test $ac_cv_c_bigendian = unknown; then -echo "$as_me:$LINENO: checking to probe for byte ordering" >&5 -echo $ECHO_N "checking to probe for byte ordering... $ECHO_C" >&6 - -cat >conftest.c <<EOF -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii() { char* s = (char*) ascii_mm; s = (char*) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic() { char* s = (char*) ebcdic_mm; s = (char*) ebcdic_ii; } -int main() { _ascii (); _ebcdic (); return 0; } -EOF - if test -f conftest.c ; then - if ${CC-cc} ${CFLAGS} -c conftest.c -o conftest.o && test -f conftest.o ; then - if test `grep -l BIGenDianSyS conftest.o` ; then - echo $ac_n ' big endian probe OK, ' 1>&6 - ac_cv_c_bigendian=yes - fi - if test `grep -l LiTTleEnDian conftest.o` ; then - echo $ac_n ' little endian probe OK, ' 1>&6 - if test $ac_cv_c_bigendian = yes ; then - ac_cv_c_bigendian=unknown; - else - ac_cv_c_bigendian=no - fi - fi - echo $ac_n 'guessing bigendian ... ' >&6 - fi - fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -fi -if test $ac_cv_c_bigendian = yes; then +case $ac_cv_c_bigendian in + yes) cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define HOST_WORDS_BIG_ENDIAN 1 -_ACEOF - - BYTEORDER=4321 -else - BYTEORDER=1234 -fi - -cat >>confdefs.h <<_ACEOF -#define BYTEORDER $BYTEORDER -_ACEOF - -if test $ac_cv_c_bigendian = unknown; then - { { echo "$as_me:$LINENO: error: unknown endianess - sorry, please pre-set ac_cv_c_bigendian" >&5 -echo "$as_me: error: unknown endianess - sorry, please pre-set ac_cv_c_bigendian" >&2;} - { (exit 1); exit 1; }; } -fi + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac # -------- diff --git a/gcc/configure.ac b/gcc/configure.ac index 23c914de443..4a3cb379370 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -893,7 +893,7 @@ AC_CHECK_HEADER(pthread.h, [have_pthread_h=yes], [have_pthread_h=]) # 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 --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c index c0aec6f072e..49ae0773d99 100644 --- a/gcc/mips-tfile.c +++ b/gcc/mips-tfile.c @@ -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 |