From a1532d36218dc75b9e5fecf6a1565aa802d062d5 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Mon, 17 Aug 2009 18:20:12 +0000 Subject: [PATCH] * added workaround to gcc4 configuration that makes the comparison of stage2 and stage3 compilers work on haiku (using objdump instead of cmp, as suggested by Michael) git-svn-id: file:///srv/svn/repos/haiku/buildtools/trunk@32475 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- gcc/config/acx.m4 | 36 +++++++++++++++++++++--------------- gcc/configure | 37 +++++++++++++++++++++---------------- 2 files changed, 42 insertions(+), 31 deletions(-) diff --git a/gcc/config/acx.m4 b/gcc/config/acx.m4 index c8a32c9f9e..9bb0f7a897 100644 --- a/gcc/config/acx.m4 +++ b/gcc/config/acx.m4 @@ -401,24 +401,30 @@ dnl for the parameter format "cmp file1 file2 skip1 skip2" which is dnl accepted by cmp on some systems. AC_DEFUN([ACX_PROG_CMP_IGNORE_INITIAL], [AC_CACHE_CHECK([how to compare bootstrapped objects], gcc_cv_prog_cmp_skip, -[ echo abfoo >t1 - echo cdfoo >t2 - gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' - if cmp t1 t2 2 2 > /dev/null 2>&1; then - if cmp t1 t2 1 1 > /dev/null 2>&1; then - : - else - gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' +[# comparing object files via cmp doesn't work on haiku (files will seemingly + # always differ), so we disassemble both files and compare the results: + if uname -o | grep -iq haiku; then + gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' + else + gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' + echo abfoo >t1 + echo cdfoo >t2 + if cmp t1 t2 2 2 > /dev/null 2>&1; then + if cmp t1 t2 1 1 > /dev/null 2>&1; then + : + else + gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' + fi fi - fi - if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then - if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then - : - else - gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' + if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then + if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then + : + else + gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' + fi fi + rm t1 t2 fi - rm t1 t2 ]) do_compare="$gcc_cv_prog_cmp_skip" AC_SUBST(do_compare) diff --git a/gcc/configure b/gcc/configure index bf773cbc36..fe4e94be73 100755 --- a/gcc/configure +++ b/gcc/configure @@ -4350,25 +4350,30 @@ echo $ECHO_N "checking how to compare bootstrapped objects... $ECHO_C" >&6 if test "${gcc_cv_prog_cmp_skip+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo abfoo >t1 - echo cdfoo >t2 - gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' - if cmp t1 t2 2 2 > /dev/null 2>&1; then - if cmp t1 t2 1 1 > /dev/null 2>&1; then - : - else - gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' + # comparing object files via cmp doesn't work on haiku (files will seemingly + # always differ), so we disassemble both files and compare the results: + if uname -o | grep -iq haiku; then + gcc_cv_prog_cmp_skip='objdump -Dz $$f1 | tail +6 >tmp-foo1; objdump -Dz $$f2 | tail +6 >tmp-foo2; cmp tmp-foo1 tmp-foo2' + else + gcc_cv_prog_cmp_skip='tail +16c $$f1 > tmp-foo1; tail +16c $$f2 > tmp-foo2; cmp tmp-foo1 tmp-foo2' + echo abfoo >t1 + echo cdfoo >t2 + if cmp t1 t2 2 2 > /dev/null 2>&1; then + if cmp t1 t2 1 1 > /dev/null 2>&1; then + : + else + gcc_cv_prog_cmp_skip='cmp $$f1 $$f2 16 16' + fi fi - fi - if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then - if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then - : - else - gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' + if cmp --ignore-initial=2 t1 t2 > /dev/null 2>&1; then + if cmp --ignore-initial=1 t1 t2 > /dev/null 2>&1; then + : + else + gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2' + fi fi + rm t1 t2 fi - rm t1 t2 - fi echo "$as_me:$LINENO: result: $gcc_cv_prog_cmp_skip" >&5 echo "${ECHO_T}$gcc_cv_prog_cmp_skip" >&6