Commit d594623a by H.J. Lu Committed by H.J. Lu

collect2.c (dump_file): Don't call cplus_demangle if HAVE_LD_DEMANGLE is defined.

2004-07-07  H.J. Lu  <hongjiu.lu@intel.com>

	* collect2.c (dump_file): Don't call cplus_demangle if
	HAVE_LD_DEMANGLE is defined.
	(main): Pass "--demangle" to ld if no_demangle is not 0 and
	HAVE_LD_DEMANGLE is defined. Don't set current_demangling_style
	if HAVE_LD_DEMANGLE is defined.

	* configure.ac (--with-demangler-in-ld): Added
	(HAVE_LD_DEMANGLE): Define if ld supports --demangle when
	--with-demangler-in-ld is used.
	* config.in: Regenerated.
	* configure: Likewise.

From-SVN: r84227
parent f0517163
2004-07-07 H.J. Lu <hongjiu.lu@intel.com>
* collect2.c (dump_file): Don't call cplus_demangle if
HAVE_LD_DEMANGLE is defined.
(main): Pass "--demangle" to ld if no_demangle is not 0 and
HAVE_LD_DEMANGLE is defined. Don't set current_demangling_style
if HAVE_LD_DEMANGLE is defined.
* configure.ac (--with-demangler-in-ld): Added
(HAVE_LD_DEMANGLE): Define if ld supports --demangle when
--with-demangler-in-ld is used.
* config.in: Regenerated.
* configure: Likewise.
2004-07-07 Roger Sayle <roger@eyesopen.com>
* config/rs6000/rs6000.c (struct processor_costs): Add new fields
......
......@@ -491,10 +491,14 @@ dump_file (const char *name)
if (!strncmp (p, USER_LABEL_PREFIX, strlen (USER_LABEL_PREFIX)))
p += strlen (USER_LABEL_PREFIX);
#ifdef HAVE_LD_DEMANGLE
result = 0;
#else
if (no_demangle)
result = 0;
else
result = cplus_demangle (p, DMGL_PARAMS | DMGL_ANSI | DMGL_VERBOSE);
#endif
if (result)
{
......@@ -841,8 +845,8 @@ main (int argc, char **argv)
/* Do not invoke xcalloc before this point, since locale needs to be
set first, in case a diagnostic is issued. */
ld1 = (const char **)(ld1_argv = xcalloc(sizeof (char *), argc+3));
ld2 = (const char **)(ld2_argv = xcalloc(sizeof (char *), argc+10));
ld1 = (const char **)(ld1_argv = xcalloc(sizeof (char *), argc+4));
ld2 = (const char **)(ld2_argv = xcalloc(sizeof (char *), argc+11));
object = (const char **)(object_lst = xcalloc(sizeof (char *), argc));
#ifdef DEBUG
......@@ -873,7 +877,9 @@ main (int argc, char **argv)
obstack_begin (&temporary_obstack, 0);
temporary_firstobj = obstack_alloc (&temporary_obstack, 0);
#ifndef HAVE_LD_DEMANGLE
current_demangling_style = auto_demangling;
#endif
p = getenv ("COLLECT_GCC_OPTIONS");
while (p && *p)
{
......@@ -1063,6 +1069,10 @@ main (int argc, char **argv)
/* After the first file, put in the c++ rt0. */
first_file = 1;
#ifdef HAVE_LD_DEMANGLE
if (!no_demangle)
*ld1++ = *ld2++ = "--demangle";
#endif
while ((arg = *++argv) != (char *) 0)
{
*ld1++ = *ld2++ = arg;
......
......@@ -341,6 +341,9 @@
/* Define if your linker supports --as-needed and --no-as-needed options. */
#undef HAVE_LD_AS_NEEDED
/* Define if your linker supports --demangle option. */
#undef HAVE_LD_DEMANGLE
/* Define if your linker supports --eh-frame-hdr option. */
#undef HAVE_LD_EH_FRAME_HDR
......
......@@ -211,6 +211,12 @@ else
AC_MSG_RESULT(no)
fi
# With demangler in GNU ld
AC_ARG_WITH(demangler-in-ld,
[ --with-demangler-in-ld try to use demangler in GNU ld.],
demangler_in_ld="$with_demangler_in_ld",
demangler_in_ld=no)
# ----------------------
# Find default assembler
# ----------------------
......@@ -2454,6 +2460,26 @@ fi
# Target-specific assembler checks.
if test x"$demangler_in_ld" = xyes; then
AC_MSG_CHECKING(linker --demangle support)
gcc_cv_ld_demangle=no
if test $in_tree_ld = yes; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 14 -o "$gcc_cv_gld_major_version" -gt 2; then \
gcc_cv_ld_demangle=yes
fi
elif test x$gcc_cv_ld != x -a x"$gnu_ld" = xyes; then
# Check if the GNU linker supports --demangle option
if $gcc_cv_ld --help 2>/dev/null | grep no-demangle > /dev/null; then
gcc_cv_ld_demangle=yes
fi
fi
if test x"$gcc_cv_ld_demangle" = xyes; then
AC_DEFINE(HAVE_LD_DEMANGLE, 1,
[Define if your linker supports --demangle option.])
fi
AC_MSG_RESULT($gcc_cv_ld_demangle)
fi
case "$target" in
# All TARGET_ABI_OSF targets.
alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment