[GCC bug #63539]: libgo does not use the newly built objcopy when doing a combined...
authorAndrew Pinski <apinski@cavium.com>
Sat, 3 Jan 2015 22:54:45 +0000 (14:54 -0800)
committerAndrew Pinski <apinski@cavium.com>
Sat, 3 Jan 2015 22:54:45 +0000 (14:54 -0800)
2015-01-03  Andrew Pinski  <apinski@cavium.com>

        * Makefile.def (flags_to_pass): Pass OBJCOPY_FOR_TARGET also.
        * Makefile.tpl (HOST_EXPORTS): Add OBJCOPY_FOR_TARGET.
        (BASE_TARGET_EXPORTS): Add OBJCOPY.
        (OBJCOPY_FOR_TARGET): New variable.
        (EXTRA_TARGET_FLAGS): Add OBJCOPY.
        * Makefile.in: Regenerate.
        * configure.ac: Check for already installed target objcopy.
        Also GCC_TARGET_TOOL on objcopy.
        * configure: Regenerate.

ChangeLog
Makefile.def
Makefile.in
Makefile.tpl
configure
configure.ac

index 0c26e8bd546568203931b320684429b70bd362c8..6dcf4ca9bf3e52683a38f6576877d72b8ef5d546 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2015-01-03  Andrew Pinski  <apinski@cavium.com>
+
+       * Makefile.def (flags_to_pass): Pass OBJCOPY_FOR_TARGET also.
+       * Makefile.tpl (HOST_EXPORTS): Add OBJCOPY_FOR_TARGET.
+       (BASE_TARGET_EXPORTS): Add OBJCOPY.
+       (OBJCOPY_FOR_TARGET): New variable.
+       (EXTRA_TARGET_FLAGS): Add OBJCOPY.
+       * Makefile.in: Regenerate.
+       * configure.ac: Check for already installed target objcopy.
+       Also GCC_TARGET_TOOL on objcopy.
+       * configure: Regenerate.
+
 2015-01-02  Hans-Peter Nilsson  <hp@bitrange.com>
 
        * config.sub: Update from upstream, to 2015-01-01 version.
index ec2b0f2781026756de94965408d71b7c155dcebf..7b739ffe3450edfd44a0ee26e2eed0f7356549d8 100644 (file)
@@ -271,6 +271,7 @@ flags_to_pass = { flag= LIBCFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= LIBCXXFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= NM_FOR_TARGET ; };
 flags_to_pass = { flag= OBJDUMP_FOR_TARGET ; };
+flags_to_pass = { flag= OBJCOPY_FOR_TARGET ; };
 flags_to_pass = { flag= RANLIB_FOR_TARGET ; };
 flags_to_pass = { flag= READELF_FOR_TARGET ; };
 flags_to_pass = { flag= STRIP_FOR_TARGET ; };
index bf06dce8a2e03d1f292d89bd2bd09d2feea2f9af..1472dd8d51ab0ce8dba1b1fbd60cefc15ddf71ae 100644 (file)
@@ -213,6 +213,7 @@ HOST_EXPORTS = \
        LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
        NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
        OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
+       OBJCOPY_FOR_TARGET="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY_FOR_TARGET; \
        RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
        READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
        TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
@@ -285,6 +286,7 @@ BASE_TARGET_EXPORTS = \
        LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \
        NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \
        OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
+       OBJCOPY="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY; \
        RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
        READELF="$(READELF_FOR_TARGET)"; export READELF; \
        STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
@@ -536,6 +538,7 @@ LD_FOR_TARGET=@LD_FOR_TARGET@
 LIPO_FOR_TARGET=@LIPO_FOR_TARGET@
 NM_FOR_TARGET=@NM_FOR_TARGET@
 OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@
+OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@
 RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
 READELF_FOR_TARGET=@READELF_FOR_TARGET@
 STRIP_FOR_TARGET=@STRIP_FOR_TARGET@
@@ -755,6 +758,7 @@ BASE_FLAGS_TO_PASS = \
        "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \
        "NM_FOR_TARGET=$(NM_FOR_TARGET)" \
        "OBJDUMP_FOR_TARGET=$(OBJDUMP_FOR_TARGET)" \
+       "OBJCOPY_FOR_TARGET=$(OBJCOPY_FOR_TARGET)" \
        "RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
        "READELF_FOR_TARGET=$(READELF_FOR_TARGET)" \
        "STRIP_FOR_TARGET=$(STRIP_FOR_TARGET)" \
@@ -851,6 +855,7 @@ EXTRA_TARGET_FLAGS = \
        'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
        'NM=$(COMPILER_NM_FOR_TARGET)' \
        'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
+       'OBJCOPY=$$(OBJCOPY_FOR_TARGET)' \
        'RANLIB=$$(RANLIB_FOR_TARGET)' \
        'READELF=$$(READELF_FOR_TARGET)' \
        'WINDRES=$$(WINDRES_FOR_TARGET)' \
index 54a8dc3dd40c56147db454f430b6e9a0c3d53c1f..f9bbbdeaa549840982a7b857163f3886e177d0bb 100644 (file)
@@ -216,6 +216,7 @@ HOST_EXPORTS = \
        LD_FOR_TARGET="$(LD_FOR_TARGET)"; export LD_FOR_TARGET; \
        NM_FOR_TARGET="$(NM_FOR_TARGET)"; export NM_FOR_TARGET; \
        OBJDUMP_FOR_TARGET="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP_FOR_TARGET; \
+       OBJCOPY_FOR_TARGET="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY_FOR_TARGET; \
        RANLIB_FOR_TARGET="$(RANLIB_FOR_TARGET)"; export RANLIB_FOR_TARGET; \
        READELF_FOR_TARGET="$(READELF_FOR_TARGET)"; export READELF_FOR_TARGET; \
        TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
@@ -288,6 +289,7 @@ BASE_TARGET_EXPORTS = \
        LIPO="$(LIPO_FOR_TARGET)"; export LIPO; \
        NM="$(COMPILER_NM_FOR_TARGET)"; export NM; \
        OBJDUMP="$(OBJDUMP_FOR_TARGET)"; export OBJDUMP; \
+       OBJCOPY="$(OBJCOPY_FOR_TARGET)"; export OBJCOPY; \
        RANLIB="$(RANLIB_FOR_TARGET)"; export RANLIB; \
        READELF="$(READELF_FOR_TARGET)"; export READELF; \
        STRIP="$(STRIP_FOR_TARGET)"; export STRIP; \
@@ -489,6 +491,7 @@ LD_FOR_TARGET=@LD_FOR_TARGET@
 LIPO_FOR_TARGET=@LIPO_FOR_TARGET@
 NM_FOR_TARGET=@NM_FOR_TARGET@
 OBJDUMP_FOR_TARGET=@OBJDUMP_FOR_TARGET@
+OBJCOPY_FOR_TARGET=@OBJCOPY_FOR_TARGET@
 RANLIB_FOR_TARGET=@RANLIB_FOR_TARGET@
 READELF_FOR_TARGET=@READELF_FOR_TARGET@
 STRIP_FOR_TARGET=@STRIP_FOR_TARGET@
@@ -656,6 +659,7 @@ EXTRA_TARGET_FLAGS = \
        'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
        'NM=$(COMPILER_NM_FOR_TARGET)' \
        'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
+       'OBJCOPY=$$(OBJCOPY_FOR_TARGET)' \
        'RANLIB=$$(RANLIB_FOR_TARGET)' \
        'READELF=$$(READELF_FOR_TARGET)' \
        'WINDRES=$$(WINDRES_FOR_TARGET)' \
index 87677bc2169f9dda29db68a358857fd802771066..64d287de511830575a5d14c8ce34efd725c329a0 100755 (executable)
--- a/configure
+++ b/configure
@@ -574,6 +574,7 @@ STRIP_FOR_TARGET
 READELF_FOR_TARGET
 RANLIB_FOR_TARGET
 OBJDUMP_FOR_TARGET
+OBJCOPY_FOR_TARGET
 NM_FOR_TARGET
 LIPO_FOR_TARGET
 LD_FOR_TARGET
@@ -830,6 +831,7 @@ DLLTOOL_FOR_TARGET
 LD_FOR_TARGET
 LIPO_FOR_TARGET
 NM_FOR_TARGET
+OBJCOPY_FOR_TARGET
 OBJDUMP_FOR_TARGET
 RANLIB_FOR_TARGET
 READELF_FOR_TARGET
@@ -1603,6 +1605,8 @@ Some influential environment variables:
               LIPO for the target
   NM_FOR_TARGET
               NM for the target
+  OBJCOPY_FOR_TARGET
+              OBJCOPY for the target
   OBJDUMP_FOR_TARGET
               OBJDUMP for the target
   RANLIB_FOR_TARGET
 
 
 
+if test -z "$ac_cv_path_OBJCOPY_FOR_TARGET" ; then
+  if test -n "$with_build_time_tools"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objcopy in $with_build_time_tools" >&5
+$as_echo_n "checking for objcopy in $with_build_time_tools... " >&6; }
+    if test -x $with_build_time_tools/objcopy; then
+      OBJCOPY_FOR_TARGET=`cd $with_build_time_tools && pwd`/objcopy
+      ac_cv_path_OBJCOPY_FOR_TARGET=$OBJCOPY_FOR_TARGET
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_OBJCOPY_FOR_TARGET" >&5
+$as_echo "$ac_cv_path_OBJCOPY_FOR_TARGET" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+  elif test $build != $host && test $have_gcc_for_target = yes; then
+    OBJCOPY_FOR_TARGET=`$GCC_FOR_TARGET --print-prog-name=objcopy`
+    test $OBJCOPY_FOR_TARGET = objcopy && OBJCOPY_FOR_TARGET=
+    test -n "$OBJCOPY_FOR_TARGET" && ac_cv_path_OBJCOPY_FOR_TARGET=$OBJCOPY_FOR_TARGET
+  fi
+fi
+if test -z "$ac_cv_path_OBJCOPY_FOR_TARGET" && test -n "$gcc_cv_tool_dirs"; then
+  # Extract the first word of "objcopy", so it can be a program name with args.
+set dummy objcopy; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_path_OBJCOPY_FOR_TARGET+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $OBJCOPY_FOR_TARGET in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_OBJCOPY_FOR_TARGET="$OBJCOPY_FOR_TARGET" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $gcc_cv_tool_dirs
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_path_OBJCOPY_FOR_TARGET="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  ;;
+esac
+fi
+OBJCOPY_FOR_TARGET=$ac_cv_path_OBJCOPY_FOR_TARGET
+if test -n "$OBJCOPY_FOR_TARGET"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY_FOR_TARGET" >&5
+$as_echo "$OBJCOPY_FOR_TARGET" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_path_OBJCOPY_FOR_TARGET" ; then
+
+
+if test -n "$OBJCOPY_FOR_TARGET"; then
+  ac_cv_prog_OBJCOPY_FOR_TARGET=$OBJCOPY_FOR_TARGET
+elif test -n "$ac_cv_prog_OBJCOPY_FOR_TARGET"; then
+  OBJCOPY_FOR_TARGET=$ac_cv_prog_OBJCOPY_FOR_TARGET
+fi
+
+if test -n "$ac_cv_prog_OBJCOPY_FOR_TARGET"; then
+  for ncn_progname in objcopy; do
+    # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJCOPY_FOR_TARGET+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJCOPY_FOR_TARGET"; then
+  ac_cv_prog_OBJCOPY_FOR_TARGET="$OBJCOPY_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJCOPY_FOR_TARGET="${ncn_progname}"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJCOPY_FOR_TARGET=$ac_cv_prog_OBJCOPY_FOR_TARGET
+if test -n "$OBJCOPY_FOR_TARGET"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY_FOR_TARGET" >&5
+$as_echo "$OBJCOPY_FOR_TARGET" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  done
+fi
+
+if test -z "$ac_cv_prog_OBJCOPY_FOR_TARGET" && test -n "$with_build_time_tools"; then
+  for ncn_progname in objcopy; do
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ncn_progname} in $with_build_time_tools" >&5
+$as_echo_n "checking for ${ncn_progname} in $with_build_time_tools... " >&6; }
+    if test -x $with_build_time_tools/${ncn_progname}; then
+      ac_cv_prog_OBJCOPY_FOR_TARGET=$with_build_time_tools/${ncn_progname}
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+      break
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+  done
+fi
+
+if test -z "$ac_cv_prog_OBJCOPY_FOR_TARGET"; then
+  for ncn_progname in objcopy; do
+    if test -n "$ncn_target_tool_prefix"; then
+      # Extract the first word of "${ncn_target_tool_prefix}${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_target_tool_prefix}${ncn_progname}; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJCOPY_FOR_TARGET+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJCOPY_FOR_TARGET"; then
+  ac_cv_prog_OBJCOPY_FOR_TARGET="$OBJCOPY_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJCOPY_FOR_TARGET="${ncn_target_tool_prefix}${ncn_progname}"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJCOPY_FOR_TARGET=$ac_cv_prog_OBJCOPY_FOR_TARGET
+if test -n "$OBJCOPY_FOR_TARGET"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY_FOR_TARGET" >&5
+$as_echo "$OBJCOPY_FOR_TARGET" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    fi
+    if test -z "$ac_cv_prog_OBJCOPY_FOR_TARGET" && test $build = $target ; then
+      # Extract the first word of "${ncn_progname}", so it can be a program name with args.
+set dummy ${ncn_progname}; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if test "${ac_cv_prog_OBJCOPY_FOR_TARGET+set}" = set; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJCOPY_FOR_TARGET"; then
+  ac_cv_prog_OBJCOPY_FOR_TARGET="$OBJCOPY_FOR_TARGET" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJCOPY_FOR_TARGET="${ncn_progname}"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJCOPY_FOR_TARGET=$ac_cv_prog_OBJCOPY_FOR_TARGET
+if test -n "$OBJCOPY_FOR_TARGET"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY_FOR_TARGET" >&5
+$as_echo "$OBJCOPY_FOR_TARGET" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    fi
+    test -n "$ac_cv_prog_OBJCOPY_FOR_TARGET" && break
+  done
+fi
+
+if test -z "$ac_cv_prog_OBJCOPY_FOR_TARGET" ; then
+  set dummy objcopy
+  if test $build = $target ; then
+    OBJCOPY_FOR_TARGET="$2"
+  else
+    OBJCOPY_FOR_TARGET="${ncn_target_tool_prefix}$2"
+  fi
+else
+  OBJCOPY_FOR_TARGET="$ac_cv_prog_OBJCOPY_FOR_TARGET"
+fi
+
+else
+  OBJCOPY_FOR_TARGET=$ac_cv_path_OBJCOPY_FOR_TARGET
+fi
+
+
+
+
 if test -z "$ac_cv_path_OBJDUMP_FOR_TARGET" ; then
   if test -n "$with_build_time_tools"; then
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdump in $with_build_time_tools" >&5
@@ -14291,6 +14525,48 @@ $as_echo "pre-installed" >&6; }
   fi
 fi
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target objcopy" >&5
+$as_echo_n "checking where to find the target objcopy... " >&6; }
+if test "x${build}" != "x${host}" ; then
+  if expr "x$OBJCOPY_FOR_TARGET" : "x/" > /dev/null; then
+    # We already found the complete path
+    ac_dir=`dirname $OBJCOPY_FOR_TARGET`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5
+$as_echo "pre-installed in $ac_dir" >&6; }
+  else
+    # Canadian cross, just use what we found
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed" >&5
+$as_echo "pre-installed" >&6; }
+  fi
+else
+  ok=yes
+  case " ${configdirs} " in
+    *" binutils "*) ;;
+    *) ok=no ;;
+  esac
+
+  if test $ok = yes; then
+    # An in-tree tool is available and we can use it
+    OBJCOPY_FOR_TARGET='$$r/$(HOST_SUBDIR)/binutils/objcopy'
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: just compiled" >&5
+$as_echo "just compiled" >&6; }
+  elif expr "x$OBJCOPY_FOR_TARGET" : "x/" > /dev/null; then
+    # We already found the complete path
+    ac_dir=`dirname $OBJCOPY_FOR_TARGET`
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed in $ac_dir" >&5
+$as_echo "pre-installed in $ac_dir" >&6; }
+  elif test "x$target" = "x$host"; then
+    # We can use an host tool
+    OBJCOPY_FOR_TARGET='$(OBJDUMP)'
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: host tool" >&5
+$as_echo "host tool" >&6; }
+  else
+    # We need a cross tool
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: pre-installed" >&5
+$as_echo "pre-installed" >&6; }
+  fi
+fi
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking where to find the target objdump" >&5
 $as_echo_n "checking where to find the target objdump... " >&6; }
 if test "x${build}" != "x${host}" ; then
index 4bb4865d84fa9cb003d450864d00db21c3201876..5badc7fae13c0c9edb7ba094c0f7b020666c0417 100644 (file)
@@ -3232,6 +3232,7 @@ ACX_CHECK_INSTALLED_TARGET_TOOL(DLLTOOL_FOR_TARGET, dlltool)
 ACX_CHECK_INSTALLED_TARGET_TOOL(LD_FOR_TARGET, ld)
 ACX_CHECK_INSTALLED_TARGET_TOOL(LIPO_FOR_TARGET, lipo)
 ACX_CHECK_INSTALLED_TARGET_TOOL(NM_FOR_TARGET, nm)
+ACX_CHECK_INSTALLED_TARGET_TOOL(OBJCOPY_FOR_TARGET, objcopy)
 ACX_CHECK_INSTALLED_TARGET_TOOL(OBJDUMP_FOR_TARGET, objdump)
 ACX_CHECK_INSTALLED_TARGET_TOOL(RANLIB_FOR_TARGET, ranlib)
 ACX_CHECK_INSTALLED_TARGET_TOOL(READELF_FOR_TARGET, readelf)
@@ -3262,6 +3263,7 @@ GCC_TARGET_TOOL(gccgo, GOC_FOR_TARGET, GOC,
 GCC_TARGET_TOOL(ld, LD_FOR_TARGET, LD, [ld/ld-new])
 GCC_TARGET_TOOL(lipo, LIPO_FOR_TARGET, LIPO)
 GCC_TARGET_TOOL(nm, NM_FOR_TARGET, NM, [binutils/nm-new])
+GCC_TARGET_TOOL(objcopy, OBJCOPY_FOR_TARGET, OBJDUMP, [binutils/objcopy])
 GCC_TARGET_TOOL(objdump, OBJDUMP_FOR_TARGET, OBJDUMP, [binutils/objdump])
 GCC_TARGET_TOOL(ranlib, RANLIB_FOR_TARGET, RANLIB, [binutils/ranlib])
 GCC_TARGET_TOOL(readelf, READELF_FOR_TARGET, READELF, [binutils/readelf])