ld/
authorAlan Modra <amodra@gmail.com>
Tue, 17 Mar 2009 05:01:26 +0000 (05:01 +0000)
committerAlan Modra <amodra@gmail.com>
Tue, 17 Mar 2009 05:01:26 +0000 (05:01 +0000)
* configure.in: Invoke ACX_PROG_CMP_IGNORE_INITIAL.
* Makefile.am (check-DEJAGNU): Set DO_COMPARE.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* Makefile.in: Regenerate.
ld/testsuite/
* ld-bootstrap/bootstrap.exp: Use DO_COMPARE.  Remove unnecessary
cleanup and log output.

ld/ChangeLog
ld/Makefile.am
ld/Makefile.in
ld/aclocal.m4
ld/configure
ld/configure.in
ld/testsuite/ChangeLog
ld/testsuite/ld-bootstrap/bootstrap.exp

index d41dd9b..b721b25 100644 (file)
@@ -1,3 +1,11 @@
+2009-03-17  Alan Modra  <amodra@bigpond.net.au>
+
+       * configure.in: Invoke ACX_PROG_CMP_IGNORE_INITIAL.
+       * Makefile.am (check-DEJAGNU): Set DO_COMPARE.
+       * aclocal.m4: Regenerate.
+       * configure: Regenerate.
+       * Makefile.in: Regenerate.
+
 2009-03-14  Richard Sandiford  <r.sandiford@uk.ibm.com>
 
        * emultempl/aix.em (auto_export_flags): New variable.
index 7a92eac..2d0aed9 100644 (file)
@@ -1767,6 +1767,7 @@ check-DEJAGNU: site.exp
                CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
                OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
                LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \
+               DO_COMPARE="`echo '$(do_compare)' | sed -e 's,\\$$,,g'`" \
                $(RUNTESTFLAGS); \
        else echo "WARNING: could not find \`runtest'" 1>&2; :;\
        fi
index 79b40b2..b9a9ccd 100644 (file)
@@ -54,7 +54,7 @@ DIST_COMMON = $(srcdir)/../config.guess $(srcdir)/../config.sub NEWS \
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \
-       $(top_srcdir)/../bfd/warning.m4 \
+       $(top_srcdir)/../bfd/warning.m4 $(top_srcdir)/../config/acx.m4 \
        $(top_srcdir)/../config/depstand.m4 \
        $(top_srcdir)/../config/extensions.m4 \
        $(top_srcdir)/../config/gettext-sister.m4 \
@@ -264,6 +264,7 @@ build_os = @build_os@
 build_vendor = @build_vendor@
 datadir = @datadir@
 datarootdir = @datarootdir@
+do_compare = @do_compare@
 docdir = @docdir@
 exec_prefix = @exec_prefix@
 host = @host@
@@ -2602,6 +2603,7 @@ check-DEJAGNU: site.exp
                CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
                OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
                LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \
+               DO_COMPARE="`echo '$(do_compare)' | sed -e 's,\\$$,,g'`" \
                $(RUNTESTFLAGS); \
        else echo "WARNING: could not find \`runtest'" 1>&2; :;\
        fi
index 95c2a5c..6b00118 100644 (file)
@@ -879,6 +879,7 @@ AC_SUBST([am__untar])
 
 m4_include([../bfd/acinclude.m4])
 m4_include([../bfd/warning.m4])
+m4_include([../config/acx.m4])
 m4_include([../config/depstand.m4])
 m4_include([../config/extensions.m4])
 m4_include([../config/gettext-sister.m4])
index c3c7979..f1fa452 100755 (executable)
@@ -458,7 +458,7 @@ ac_includes_default="\
 # include <unistd.h>
 #endif"
 
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE use_sysroot TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS NO_WERROR CPP EGREP LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S OBJDUMP ac_ct_OBJDUMP AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE YACC LEX LEXLIB LEX_OUTPUT_ROOT MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE HDEFINES HOSTING_CRT0 HOSTING_LIBS NATIVE_LIB_DIRS STRINGIFY EMUL EMULATION_OFILES EMUL_EXTRA_OFILES LIB_PATH EMULATION_LIBPATH TESTBFDLIB datarootdir docdir htmldir pdfdir LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE use_sysroot TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE WARN_CFLAGS NO_WERROR CPP EGREP LIBTOOL SED FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S OBJDUMP ac_ct_OBJDUMP AR ac_ct_AR RANLIB ac_ct_RANLIB lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT MKINSTALLDIRS MSGFMT MSGMERGE YACC LEX LEXLIB LEX_OUTPUT_ROOT MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT GENINSRC_NEVER_TRUE GENINSRC_NEVER_FALSE do_compare HDEFINES HOSTING_CRT0 HOSTING_LIBS NATIVE_LIB_DIRS STRINGIFY EMUL EMULATION_OFILES EMUL_EXTRA_OFILES LIB_PATH EMULATION_LIBPATH TESTBFDLIB datarootdir docdir htmldir pdfdir LIBOBJS LTLIBOBJS'
 ac_subst_files='TDIRS'
 ac_pwd=`pwd`
 
@@ -12635,6 +12635,36 @@ else
   GENINSRC_NEVER_FALSE=
 fi
 
+echo "$as_me:$LINENO: checking how to compare bootstrapped objects" >&5
+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'
+    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'
+    fi
+  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
+do_compare="$gcc_cv_prog_cmp_skip"
+
+
 
 . ${srcdir}/configure.host
 
@@ -15583,6 +15613,7 @@ s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
 s,@MAINT@,$MAINT,;t t
 s,@GENINSRC_NEVER_TRUE@,$GENINSRC_NEVER_TRUE,;t t
 s,@GENINSRC_NEVER_FALSE@,$GENINSRC_NEVER_FALSE,;t t
+s,@do_compare@,$do_compare,;t t
 s,@HDEFINES@,$HDEFINES,;t t
 s,@HOSTING_CRT0@,$HOSTING_CRT0,;t t
 s,@HOSTING_LIBS@,$HOSTING_LIBS,;t t
index 2df309a..eddfeb1 100644 (file)
@@ -125,6 +125,7 @@ AM_PROG_LEX
 
 AM_MAINTAINER_MODE
 AM_CONDITIONAL(GENINSRC_NEVER, false)
+ACX_PROG_CMP_IGNORE_INITIAL
 
 . ${srcdir}/configure.host
 
index 30dadce..78c941b 100644 (file)
@@ -1,3 +1,8 @@
+2009-03-17  Alan Modra  <amodra@bigpond.net.au>
+
+       * ld-bootstrap/bootstrap.exp: Use DO_COMPARE.  Remove unnecessary
+       cleanup and log output.
+
 2009-03-16  Dave Korn  <dave.korn.cygwin@gmail.com>
 
        * ld-bootstrap/bootstrap.exp:  Also pass '-liconv' to linker when
index d84897d..e7b4246 100644 (file)
@@ -145,8 +145,6 @@ foreach flags {"" "strip" "--static" "--traditional-format"
        }
     }
 
-    send_log "compare (tail of) tmpdir/ld2 tmpdir/ld3\n"
-    verbose  "compare (tail of) tmpdir/ld2 tmpdir/ld3"
     if {[istarget "*-*-pe"]
        || [istarget "*-*-wince"]
        || [istarget "*-*-cygwin*"]
@@ -155,19 +153,19 @@ foreach flags {"" "strip" "--static" "--traditional-format"
        || [istarget "*-*-interix*"]
        || [istarget "*-*-beospe*"]
        || [istarget "*-*-netbsdpe*"]} {
-        # Trim off the date present in PE binaries by only looking
-        #   at the ends of the files
-        # Although this works, a way to set the date would be better.
-        # Removing or zeroing the date stamp in the binary produced by
-        # the linker is not possible as it is required by the target OS.
-        exec tail +140 tmpdir/ld2 >tmpdir/ld2tail
-        exec tail +140 tmpdir/ld3 >tmpdir/ld3tail
-        catch "exec cmp tmpdir/ld2tail tmpdir/ld3tail" exec_output
-        exec rm tmpdir/ld2tail tmpdir/ld3tail
+       # Trim off the date present in PE binaries by only looking
+       #   at the ends of the files
+       # Although this works, a way to set the date would be better.
+       # Removing or zeroing the date stamp in the binary produced by
+       # the linker is not possible as it is required by the target OS.
+       set do_compare [string map {16 220 f1 tmpdir/ld2 f2 tmpdir/ld3 tmp-foo1 tmpdir/ld2tail tmp-foo2 tmpdir/ld3tail} $DO_COMPARE]
+       send_log "$do_compare\n"
+       verbose  "$do_compare"
+       catch "exec sh -c [list $do_compare]" exec_output
     } else {
-        send_log "cmp tmpdir/ld2 tmpdir/ld3\n"
-        verbose  "cmp tmpdir/ld2 tmpdir/ld3"
-        catch "exec cmp tmpdir/ld2 tmpdir/ld3" exec_output
+       send_log "cmp tmpdir/ld2 tmpdir/ld3\n"
+       verbose  "cmp tmpdir/ld2 tmpdir/ld3"
+       catch "exec cmp tmpdir/ld2 tmpdir/ld3" exec_output
     }
     set exec_output [prune_warnings $exec_output]
 
@@ -182,4 +180,4 @@ foreach flags {"" "strip" "--static" "--traditional-format"
 }
 
 catch "exec rm -f tmpdir/ld-partial.o tmpdir/ld1 tmpdir/ld2 tmpdir/ld3" status
-catch "exec rm -f tmpdir/ld1tail tmpdir/ld2tail tmpdir/ld3tail" status
+catch "exec rm -f tmpdir/ld2tail tmpdir/ld3tail" status