public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sandra Loosemore <sandra@codesourcery.com>
To: gcc-patches@gcc.gnu.org
Subject: PING Re: PATCH: fix collect2 handling of --demangle and --no-demangle
Date: Mon, 27 Jun 2011 15:48:00 -0000	[thread overview]
Message-ID: <4E089EF9.2080907@codesourcery.com> (raw)
In-Reply-To: <4DFBE75A.6010405@codesourcery.com>

Ping?

http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01368.html

> We had a bug report from a customer that the linker was ignoring the
> --demangle and --no-demangle options when generating map files.
> Moreover, it was failing in a host-dependent way; on Windows hosts,
> it was always emitting demangled names in the map file, while on
> Linux hosts, it never did.  Moreover, on Windows hosts it also
> ignored the setting of the COLLECT_NO_DEMANGLE environment variable.
>
> This turns out to be a problem in collect2, or actually, three
> problems:
>
> (1) By default, collect2 is configured to filter out --demangle and
> --no-demangle from the linker options, and it tries to do demangling
> on symbol names in stdout and stderr itself instead.  But, it is too
> stupid to know about the map file.
>
> (2) Collect2 is trying to set COLLECT_NO_DEMANGLE to disable
> demangling in ld, but in a nonportable way that causes it to be
> always unset instead on Windows.
>
> (3) If you configure with --with-demangler-in-ld to try to disable
> the collect2 demangling, there's another bug that causes it to ignore
> any explicit --demangle or --no-demangle options and only pay
> attention to whether or not COLLECT_NO_DEMANGLE is set.
>
> The attached patch addresses all three problems:
>
> (1) I've flipped the default to --with-demangler-in-ld=yes.  Note
> that configure.ac already takes care not to let this percolate
> through to collect2 without verifying that the linker is GNU ld and
> that it is a version that supports --demangle.  Perhaps back in 2004
> when this option was first added, the ld demangling support was
> deemed too experimental to make it the default, but that's surely not
> the case any more.  Also, since this has been broken since 2004, I'm
> not sure there's much reason to be concerned with backwards
> compatibility, here....
>
> (2) I fixed the COLLECT_NO_DEMANGLE environment variable setting
> recipe.
>
> (3) I simplified the argument processing for --demangle and
> --no-demangle to pass them straight through to the linker when
> HAVE_LD_DEMANGLE is defined.
>
> OK to commit?
>
> -Sandra
>
> 2011-06-17  Sandra Loosemore  <sandra@codesourcery.com>
>
>     gcc/
>     * configure.ac (demangler_in_ld): Default to yes.
>     * configure: Regenerated.
>     * collect2.c (main): When HAVE_LD_DEMANGLE is defined, don't
>     mess with COLLECT_NO_DEMANGLE, and just pass --demangle and
>     --no-demangle options straight through to ld.  When
>     HAVE_LD_DEMANGLE is not defined, set COLLECT_NO_DEMANGLE in a
>     way that has the intended effect on Windows.
>
>

  reply	other threads:[~2011-06-27 15:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-18  0:20 Sandra Loosemore
2011-06-27 15:48 ` Sandra Loosemore [this message]
2011-07-11 18:01 ` PING^2 " Sandra Loosemore
2011-07-21 15:23   ` Joseph S. Myers
2011-07-25  3:23   ` H.J. Lu
2011-07-25  3:33     ` H.J. Lu
2011-07-25  4:45       ` Sandra Loosemore

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E089EF9.2080907@codesourcery.com \
    --to=sandra@codesourcery.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).