aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorIain Sandoe <iain@sandoe.co.uk>2020-12-13 17:21:16 +0000
committerIain Sandoe <iain@sandoe.co.uk>2021-07-05 20:40:45 +0100
commit3b5e8ee4f1ecc6d407f391695f65960bcbd63cff (patch)
tree56c6da96a8fef14fde6e9e57f9d06ae33c8b2e58 /gcc
parentbe8749f939a933bca6de19d9cf1a510d5954c2fa (diff)
downloadgcc-3b5e8ee4f1ecc6d407f391695f65960bcbd63cff.zip
gcc-3b5e8ee4f1ecc6d407f391695f65960bcbd63cff.tar.gz
gcc-3b5e8ee4f1ecc6d407f391695f65960bcbd63cff.tar.bz2
Darwin, configury : Allow for specification and detection of dsymutil.
In order to enable DWARF versions > 2 we need a sufficiently modern version of dsymutil (in addition to the assembler / linker). This allows the user to configure a different path from the installed one. In addition, there are several sources of dsymutil so we differentiate these in order to be get accurate version information. Signed-off-by: Iain Sandoe <iain@sandoe.co.uk> gcc/ChangeLog: * configure.ac: Handle --with-dsymutil in the same way as we do for the assembler and linker. (DEFAULT_DSYMUTIL): New. Extract the type and version for the dsymutil configured or found by the default searches. * config.in: Regenerated. * configure: Regenerated. * collect2.c (do_dsymutil): Handle locating dsymutil in the same way as for the assembler and linker. * config/darwin.h (DSYMUTIL): Delete. * gcc.c: Report a configured dsymutil correctly. * exec-tool.in: Allow for dsymutil. ChangeLog: * Makefile.def: Add dsymutil defs. * Makefile.in: Regenerated. * Makefile.tpl: Add dsymutil to flags. * configure: Regenerated. * configure.ac: Add dsymutil to target and build recipes.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/collect2.c40
-rw-r--r--gcc/config.in12
-rw-r--r--gcc/config/darwin.h2
-rwxr-xr-xgcc/configure166
-rw-r--r--gcc/configure.ac96
-rw-r--r--gcc/exec-tool.in8
-rw-r--r--gcc/gcc.c5
7 files changed, 318 insertions, 11 deletions
diff --git a/gcc/collect2.c b/gcc/collect2.c
index b08c6e7..07092c2 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -3040,15 +3040,49 @@ process_args (int *argcp, char **argv) {
static void
do_dsymutil (const char *output_file) {
- const char *dsymutil = DSYMUTIL + 1;
+ const char *dsymutil = 0;
struct pex_obj *pex;
- char **real_argv = XCNEWVEC (char *, 3);
+ char **real_argv = XCNEWVEC (char *, verbose ? 4 : 3);
const char ** argv = CONST_CAST2 (const char **, char **,
real_argv);
+/* For cross-builds search the PATH using target-qualified name if we
+ have not already found a suitable dsymutil. In practice, all modern
+ versions of dsymutil handle all supported archs, however the approach
+ here is consistent with the way other installations work (and one can
+ always symlink a multitarget dsymutil with a target-specific name). */
+ const char *dsname = "dsymutil";
+#ifdef CROSS_DIRECTORY_STRUCTURE
+ const char *qname = concat (target_machine, "-", dsname, NULL);
+#else
+ const char *qname = dsname;
+#endif
+#ifdef DEFAULT_DSYMUTIL
+ /* Configured default takes priority. */
+ if (dsymutil == 0 && access (DEFAULT_DSYMUTIL, X_OK) == 0)
+ dsymutil = DEFAULT_DSYMUTIL;
+ if (dsymutil == 0)
+#endif
+#ifdef DSYMUTIL
+ /* Followed by one supplied in the target header, somewhat like the
+ REAL_XX_NAME used elsewhere. */
+ dsymutil = find_a_file (&cpath, DSYMUTIL, X_OK);
+ if (dsymutil == 0)
+ dsymutil = find_a_file (&path, DSYMUTIL, X_OK);
+ if (dsymutil == 0)
+#endif
+ dsymutil = find_a_file (&cpath, dsname, X_OK);
+ if (dsymutil == 0)
+ dsymutil = find_a_file (&path, qname, X_OK);
argv[0] = dsymutil;
argv[1] = output_file;
- argv[2] = (char *) 0;
+ if (verbose)
+ {
+ argv[2] = "-v";
+ argv[3] = (char *) 0;
+ }
+ else
+ argv[2] = (char *) 0;
pex = collect_execute (dsymutil, real_argv, NULL, NULL,
PEX_LAST | PEX_SEARCH, false, NULL);
diff --git a/gcc/config.in b/gcc/config.in
index 18e6271..2abac53 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -55,6 +55,12 @@
#endif
+/* Define to enable the use of a default debug linker. */
+#ifndef USED_FOR_TARGET
+#undef DEFAULT_DSYMUTIL
+#endif
+
+
/* Define to enable the use of a default linker. */
#ifndef USED_FOR_TARGET
#undef DEFAULT_LINKER
@@ -94,6 +100,12 @@
#endif
+/* Define to the dsymutil version. */
+#ifndef USED_FOR_TARGET
+#undef DSYMUTIL_VERSION
+#endif
+
+
/* Define 0/1 if static analyzer feature is enabled. */
#ifndef USED_FOR_TARGET
#undef ENABLE_ANALYZER
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index 5f11978..20d6b1e 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -240,8 +240,6 @@ extern GTY(()) int darwin_ms_struct;
DARWIN_NOCOMPACT_UNWIND \
"}}}}}}} %<pie %<no-pie %<rdynamic %<X "
-#define DSYMUTIL "\ndsymutil"
-
/* Spec that controls whether the debug linker is run automatically for
a link step. This needs to be done if there is a source file on the
command line which will result in a temporary object (and debug is
diff --git a/gcc/configure b/gcc/configure
index f0b2ebd..a15f8b4 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -723,6 +723,8 @@ thin_archive_support
ld_soname_option
ld_version_script_option
libgcc_visibility
+ORIGINAL_DSYMUTIL_FOR_TARGET
+gcc_cv_dsymutil
gcc_cv_otool
gcc_cv_readelf
gcc_cv_objdump
@@ -946,6 +948,7 @@ enable_generated_files_in_srcdir
with_gnu_ld
with_ld
with_demangler_in_ld
+with_dsymutil
with_gnu_as
with_as
enable_largefile
@@ -1813,6 +1816,8 @@ Optional Packages:
--with-gnu-ld arrange to work with GNU ld
--with-ld arrange to use the specified ld (full pathname)
--with-demangler-in-ld try to use demangler in GNU ld
+ --with-dsymutil arrange to use the specified dsymutil (full
+ pathname)
--with-gnu-as arrange to work with GNU as
--with-as arrange to use the specified as (full pathname)
--with-stabs arrange to use stabs instead of host debug format
@@ -3835,8 +3840,14 @@ fi
case $target in
- *darwin*) ld64_flag=yes;; # Darwin can only use a ld64-compatible linker.
- *) ld64_flag=no;;
+ *darwin*)
+ ld64_flag=yes # Darwin can only use a ld64-compatible linker.
+ dsymutil_flag=yes # Darwin uses dsymutil to link debug.
+ ;;
+ *)
+ ld64_flag=no
+ dsymutil_flag=no
+ ;;
esac
# With pre-defined ld
@@ -3886,6 +3897,40 @@ else
fi
+# Allow the user to specify a dsymutil executable (used on Darwin only, so far)
+
+# Check whether --with-dsymutil was given.
+if test "${with_dsymutil+set}" = set; then :
+ withval=$with_dsymutil; DEFAULT_DSYMUTIL="$with_dsymutil"
+fi
+
+
+dsymutil_vers=
+if test x"${DEFAULT_DSYMUTIL+set}" = x"set"; then
+ if test ! -x "$DEFAULT_DSYMUTIL"; then
+ as_fn_error $? "cannot execute: $DEFAULT_DSYMUTIL: check --with-dsymutil or env. var. DEFAULT_DSYMUTIL" "$LINENO" 5
+ else
+ if dsymutil_vers=`$DEFAULT_DSYMUTIL -v /dev/null 2>&1`; then
+ dsymutil_flag=yes
+ fi
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define DEFAULT_DSYMUTIL "$DEFAULT_DSYMUTIL"
+_ACEOF
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a default dsymutil was specified" >&5
+$as_echo_n "checking whether a default dsymutil was specified... " >&6; }
+if test x"${DEFAULT_DSYMUTIL+set}" = x"set"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($DEFAULT_DSYMUTIL)" >&5
+$as_echo "yes ($DEFAULT_DSYMUTIL)" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
# ----------------------
# Find default assembler
# ----------------------
@@ -19435,7 +19480,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 19438 "configure"
+#line 19483 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -19541,7 +19586,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
-#line 19544 "configure"
+#line 19589 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -23439,6 +23484,71 @@ else
$as_echo "$gcc_cv_otool" >&6; }
fi
+# Figure out the dsymutil we will use.
+if ${gcc_cv_dsymutil+:} false; then :
+
+else
+
+if test -x "$DEFAULT_DSYMUTIL"; then
+ gcc_cv_dsymutil="$DEFAULT_DSYMUTIL"
+elif test -x dsymutil$build_exeext; then
+ gcc_cv_dsymutil=./dsymutil$build_exeext
+elif ( set dummy $DSYMUTIL_FOR_TARGET; test -x $2 ); then
+ gcc_cv_dsymutil=$DSYMUTIL_FOR_TARGET
+elif ( set dummy $DSYMUTIL; test -x $2 ); then
+ gcc_cv_dsymutil=$DSYMUTIL
+else
+ # Extract the first word of "$DSYMUTIL_FOR_TARGET", so it can be a program name with args.
+set dummy $DSYMUTIL_FOR_TARGET; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_gcc_cv_dsymutil+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $gcc_cv_dsymutil in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_gcc_cv_dsymutil="$gcc_cv_dsymutil" # Let the user override the test with a path.
+ ;;
+ *)
+ 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_gcc_cv_dsymutil="$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
+gcc_cv_dsymutil=$ac_cv_path_gcc_cv_dsymutil
+if test -n "$gcc_cv_dsymutil"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $gcc_cv_dsymutil" >&5
+$as_echo "$gcc_cv_dsymutil" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+fi
+
+ORIGINAL_DSYMUTIL_FOR_TARGET=$gcc_cv_dsymutil
+
+case "$ORIGINAL_DSYMUTIL_FOR_TARGET" in
+ ./dsymutil | ./dsymutil$build_exeext) ;;
+ *) ac_config_files="$ac_config_files dsymutil:exec-tool.in"
+ ;;
+esac
+
# Figure out what assembler alignment features are present.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking assembler flags" >&5
$as_echo_n "checking assembler flags... " >&6; }
@@ -30303,6 +30413,52 @@ _ACEOF
fi
+if test x"$dsymutil_flag" = x"yes"; then
+
+ # If the user specified a dsymutil path, then we will already have the
+ # version string, otherwise, pick it up.
+ if test x"$gcc_cv_dsymutil" = x; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: dsymutil is a required tool for this system, but not found" >&5
+$as_echo "$as_me: WARNING: dsymutil is a required tool for this system, but not found" >&2;}
+ dsymutil_vers="tool unspecified"
+ elif test x"$dsymutil_vers" = x; then
+ dsymutil_vers=`$gcc_cv_dsymutil -v /dev/null 2>&1`
+ fi
+
+ dsymutil_temp=`echo $dsymutil_vers | sed 1q`
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking dsymutil version \"$dsymutil_temp\"" >&5
+$as_echo_n "checking dsymutil version \"$dsymutil_temp\"... " >&6; }
+ if echo $dsymutil_temp | grep dwarfutils- > /dev/null; then
+ dsymutil_kind=DWARFUTILS
+ dsymutil_vers=`echo $dsymutil_temp | sed 's/.*dwarfutils-\([0-9\.]*\).*/\1/'`
+ elif echo $dsymutil_temp | grep clang- > /dev/null; then
+ dsymutil_kind=CLANG
+ dsymutil_vers=`echo $dsymutil_temp | sed 's/.*clang-\([0-9\.]*\).*/\1/'`
+ elif echo $dsymutil_temp | grep 'LLVM version ' > /dev/null; then
+ dsymutil_kind=LLVM
+ dsymutil_vers=`echo $dsymutil_temp | sed 's/.*LLVM\ version\ \([0-9\.]*\).*/\1/'`
+ else
+ dsymutil_kind=UNKNOWN
+ dsymutil_vers="0.0"
+ fi
+ dsymutil_major=`expr "$dsymutil_vers" : '\([0-9]*\)'`
+ dsymutil_minor=`expr "$dsymutil_vers" : '[0-9]*\.\([0-9]*\)'`
+ dsymutil_tiny=`expr "$dsymutil_vers" : '[0-9]*\.[0-9]*\.\([0-9]*\)'`
+ if test x"${dsymutil_minor}" = x; then
+ dsymutil_minor=0
+ fi
+ if test x"${dsymutil_tiny}" = x; then
+ dsymutil_tiny=0
+ fi
+
+cat >>confdefs.h <<_ACEOF
+#define DSYMUTIL_VERSION $dsymutil_kind,${dsymutil_major},${dsymutil_minor},${dsymutil_tiny}
+_ACEOF
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dsymutil_vers : $dsymutil_kind ${dsymutil_major} ${dsymutil_minor} ${dsymutil_tiny} " >&5
+$as_echo "$dsymutil_vers : $dsymutil_kind ${dsymutil_major} ${dsymutil_minor} ${dsymutil_tiny} " >&6; }
+fi
+
case $target_os in
win32 | pe | cygwin* | mingw32*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking broken PE linker dwarf5 support" >&5
@@ -33014,6 +33170,7 @@ do
"as") CONFIG_FILES="$CONFIG_FILES as:exec-tool.in" ;;
"collect-ld") CONFIG_FILES="$CONFIG_FILES collect-ld:exec-tool.in" ;;
"nm") CONFIG_FILES="$CONFIG_FILES nm:exec-tool.in" ;;
+ "dsymutil") CONFIG_FILES="$CONFIG_FILES dsymutil:exec-tool.in" ;;
"clearcap.map") CONFIG_LINKS="$CONFIG_LINKS clearcap.map:${srcdir}/config/$clearcap_map" ;;
"$all_outputs") CONFIG_FILES="$CONFIG_FILES $all_outputs" ;;
"default") CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;;
@@ -33648,6 +33805,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
"as":F) chmod +x as ;;
"collect-ld":F) chmod +x collect-ld ;;
"nm":F) chmod +x nm ;;
+ "dsymutil":F) chmod +x dsymutil ;;
"default":C)
case ${CONFIG_HEADERS} in
*auto-host.h:config.in*)
diff --git a/gcc/configure.ac b/gcc/configure.ac
index 7008939..26da073 100644
--- a/gcc/configure.ac
+++ b/gcc/configure.ac
@@ -316,8 +316,14 @@ gnu_ld_flag="$with_gnu_ld",
gnu_ld_flag=no)
case $target in
- *darwin*) ld64_flag=yes;; # Darwin can only use a ld64-compatible linker.
- *) ld64_flag=no;;
+ *darwin*)
+ ld64_flag=yes # Darwin can only use a ld64-compatible linker.
+ dsymutil_flag=yes # Darwin uses dsymutil to link debug.
+ ;;
+ *)
+ ld64_flag=no
+ dsymutil_flag=no
+ ;;
esac
# With pre-defined ld
@@ -353,6 +359,31 @@ AC_ARG_WITH(demangler-in-ld,
demangler_in_ld="$with_demangler_in_ld",
demangler_in_ld=yes)
+# Allow the user to specify a dsymutil executable (used on Darwin only, so far)
+AC_ARG_WITH(dsymutil,
+[AS_HELP_STRING([--with-dsymutil], [arrange to use the specified dsymutil (full pathname)])],
+DEFAULT_DSYMUTIL="$with_dsymutil")
+
+dsymutil_vers=
+if test x"${DEFAULT_DSYMUTIL+set}" = x"set"; then
+ if test ! -x "$DEFAULT_DSYMUTIL"; then
+ AC_MSG_ERROR([cannot execute: $DEFAULT_DSYMUTIL: check --with-dsymutil or env. var. DEFAULT_DSYMUTIL])
+ else
+ if dsymutil_vers=`$DEFAULT_DSYMUTIL -v /dev/null 2>&1`; then
+ dsymutil_flag=yes
+ fi
+ fi
+ AC_DEFINE_UNQUOTED(DEFAULT_DSYMUTIL,"$DEFAULT_DSYMUTIL",
+ [Define to enable the use of a default debug linker.])
+fi
+
+AC_MSG_CHECKING([whether a default dsymutil was specified])
+if test x"${DEFAULT_DSYMUTIL+set}" = x"set"; then
+ AC_MSG_RESULT([yes ($DEFAULT_DSYMUTIL)])
+else
+ AC_MSG_RESULT(no)
+fi
+
# ----------------------
# Find default assembler
# ----------------------
@@ -2852,6 +2883,27 @@ else
AC_MSG_RESULT($gcc_cv_otool)
fi
+# Figure out the dsymutil we will use.
+AS_VAR_SET_IF(gcc_cv_dsymutil,, [
+if test -x "$DEFAULT_DSYMUTIL"; then
+ gcc_cv_dsymutil="$DEFAULT_DSYMUTIL"
+elif test -x dsymutil$build_exeext; then
+ gcc_cv_dsymutil=./dsymutil$build_exeext
+elif ( set dummy $DSYMUTIL_FOR_TARGET; test -x $[2] ); then
+ gcc_cv_dsymutil=$DSYMUTIL_FOR_TARGET
+elif ( set dummy $DSYMUTIL; test -x $[2] ); then
+ gcc_cv_dsymutil=$DSYMUTIL
+else
+ AC_PATH_PROG(gcc_cv_dsymutil, $DSYMUTIL_FOR_TARGET)
+fi])
+
+ORIGINAL_DSYMUTIL_FOR_TARGET=$gcc_cv_dsymutil
+AC_SUBST(ORIGINAL_DSYMUTIL_FOR_TARGET)
+case "$ORIGINAL_DSYMUTIL_FOR_TARGET" in
+ ./dsymutil | ./dsymutil$build_exeext) ;;
+ *) AC_CONFIG_FILES(dsymutil:exec-tool.in, [chmod +x dsymutil]) ;;
+esac
+
# Figure out what assembler alignment features are present.
gcc_GAS_CHECK_FEATURE([.balign and .p2align], gcc_cv_as_balign_and_p2align,
[2,6,0],,
@@ -6240,6 +6292,46 @@ if test x"$ld64_flag" = x"yes"; then
[Define to 1 if ld64 supports '-export_dynamic'.])
fi
+if test x"$dsymutil_flag" = x"yes"; then
+
+ # If the user specified a dsymutil path, then we will already have the
+ # version string, otherwise, pick it up.
+ if test x"$gcc_cv_dsymutil" = x; then
+ AC_MSG_WARN([dsymutil is a required tool for this system, but not found])
+ dsymutil_vers="tool unspecified"
+ elif test x"$dsymutil_vers" = x; then
+ dsymutil_vers=`$gcc_cv_dsymutil -v /dev/null 2>&1`
+ fi
+
+ dsymutil_temp=`echo $dsymutil_vers | sed 1q`
+ AC_MSG_CHECKING(dsymutil version "$dsymutil_temp")
+ if echo $dsymutil_temp | grep dwarfutils- > /dev/null; then
+ dsymutil_kind=DWARFUTILS
+ dsymutil_vers=`echo $dsymutil_temp | sed 's/.*dwarfutils-\([[0-9\.]]*\).*/\1/'`
+ elif echo $dsymutil_temp | grep clang- > /dev/null; then
+ dsymutil_kind=CLANG
+ dsymutil_vers=`echo $dsymutil_temp | sed 's/.*clang-\([[0-9\.]]*\).*/\1/'`
+ elif echo $dsymutil_temp | grep 'LLVM version ' > /dev/null; then
+ dsymutil_kind=LLVM
+ dsymutil_vers=`echo $dsymutil_temp | sed 's/.*LLVM\ version\ \([[0-9\.]]*\).*/\1/'`
+ else
+ dsymutil_kind=UNKNOWN
+ dsymutil_vers="0.0"
+ fi
+ dsymutil_major=`expr "$dsymutil_vers" : '\([[0-9]]*\)'`
+ dsymutil_minor=`expr "$dsymutil_vers" : '[[0-9]]*\.\([[0-9]]*\)'`
+ dsymutil_tiny=`expr "$dsymutil_vers" : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
+ if test x"${dsymutil_minor}" = x; then
+ dsymutil_minor=0
+ fi
+ if test x"${dsymutil_tiny}" = x; then
+ dsymutil_tiny=0
+ fi
+ AC_DEFINE_UNQUOTED(DSYMUTIL_VERSION, [$dsymutil_kind,${dsymutil_major},${dsymutil_minor},${dsymutil_tiny}],
+ [Define to the dsymutil version.])
+ AC_MSG_RESULT($dsymutil_vers : $dsymutil_kind ${dsymutil_major} ${dsymutil_minor} ${dsymutil_tiny} )
+fi
+
case $target_os in
win32 | pe | cygwin* | mingw32*)
AC_MSG_CHECKING(broken PE linker dwarf5 support)
diff --git a/gcc/exec-tool.in b/gcc/exec-tool.in
index 9884601..c206a25 100644
--- a/gcc/exec-tool.in
+++ b/gcc/exec-tool.in
@@ -25,6 +25,7 @@ ORIGINAL_LD_BFD_FOR_TARGET="@ORIGINAL_LD_BFD_FOR_TARGET@"
ORIGINAL_LD_GOLD_FOR_TARGET="@ORIGINAL_LD_GOLD_FOR_TARGET@"
ORIGINAL_PLUGIN_LD_FOR_TARGET="@ORIGINAL_PLUGIN_LD_FOR_TARGET@"
ORIGINAL_NM_FOR_TARGET="@ORIGINAL_NM_FOR_TARGET@"
+ORIGINAL_DSYMUTIL_FOR_TARGET="@ORIGINAL_DSYMUTIL_FOR_TARGET@"
exeext=@host_exeext@
fast_install=@enable_fast_install@
objdir=@objdir@
@@ -71,6 +72,13 @@ case "$invoked" in
prog=nm-new$exeext
dir=binutils
;;
+ dsymutil)
+ original=$ORIGINAL_DSYMUTIL_FOR_TARGET
+ # We do not build this in tree - but still want to be able to execute
+ # a configured version from the build dir.
+ prog=
+ dir=
+ ;;
esac
case "$original" in
diff --git a/gcc/gcc.c b/gcc/gcc.c
index c8dbff6..36a88fc 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -3062,6 +3062,11 @@ find_a_file (const struct path_prefix *pprefix, const char *name, int mode,
return xstrdup (DEFAULT_LINKER);
#endif
+#ifdef DEFAULT_DSYMUTIL
+ if (! strcmp (name, "dsymutil") && access (DEFAULT_DSYMUTIL, mode) == 0)
+ return xstrdup (DEFAULT_DSYMUTIL);
+#endif
+
/* Determine the filename to execute (special case for absolute paths). */
if (IS_ABSOLUTE_PATH (name))