public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: John Marino <gnugcc@marino.st>
To: gcc-help@gcc.gnu.org
Subject: Re: dl_iterate_phdr support
Date: Mon, 14 Feb 2011 15:48:00 -0000	[thread overview]
Message-ID: <4D58E3BB.10002@marino.st> (raw)
In-Reply-To: <mcrd3mvcibd.fsf@google.com>

On 2/14/2011 6:10 AM, Ian Lance Taylor wrote:
>
> The test in gcc/configure.ac is unfortunately rather misleading.  That
> result of that test is currently only used on Solaris.
>
> The relevant code can be found in two places: gcc/unwind-dw2-fde-glibc.c
> and gcc/crtstuff.c.  In unwind-dw2-fde-glibc.c it looks like this:
>
> #if !defined(inhibit_libc)&&  defined(HAVE_LD_EH_FRAME_HDR) \
>      &&  (__GLIBC__>  2 || (__GLIBC__ == 2&&  __GLIBC_MINOR__>  2) \
> 	|| (__GLIBC__ == 2&&  __GLIBC_MINOR__ == 2&&  defined(DT_CONFIG)))
> # define USE_PT_GNU_EH_FRAME
> #endif
>
> #if !defined(inhibit_libc)&&  defined(HAVE_LD_EH_FRAME_HDR) \
>      &&  defined(__FreeBSD__)&&  __FreeBSD__>= 7
> # define ElfW __ElfN
> # define USE_PT_GNU_EH_FRAME
> #endif
>
> #if !defined(inhibit_libc)&&  defined(HAVE_LD_EH_FRAME_HDR) \
>      &&  defined(TARGET_DL_ITERATE_PHDR) \
>      &&  defined(__sun__)&&  defined(__svr4__)
> # define USE_PT_GNU_EH_FRAME
> #endif
>
> The idea is that USE_PT_GNU_EH_FRAME should be defined on any system for
> which the linker supports --eh-frame-hdr and the library supports
> dl_iterate_phdr.  As you can see, the test is being done based on the
> library version.  It is done this way because when gcc is being used to
> build the C library, particularly when building a cross-compiler, there
> is no way to test the features that the C library supports.
>
> Ian


Thanks Ian.  If I understand the code in those two files correctly, only 
Solaris, Linux, and FreeBSD is being considered.  If I want to use this 
on Dragonfly 2.9+, NetBSD 5.99+, and/or OpenBSD, I'll have to patch 
these files will the appropriate code.

My FSF copyright assignment papers should have arrived to FSF by now, so 
I will pass along these patches with the others.

For the others, I am waiting for gcc 4.6 to get branched.  Would a 
configuration patch to these files make it into trunk before it's 
branched?  If you take the words "regression fixes and documentation 
only" literally then the answer would be no, it has to wait for 4.7 stage 1.

Regards,
John



  reply	other threads:[~2011-02-14  8:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-13  2:15 John Marino
2011-02-14  8:11 ` Ian Lance Taylor
2011-02-14 15:48   ` John Marino [this message]
2011-02-14 17:46     ` Ian Lance Taylor

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=4D58E3BB.10002@marino.st \
    --to=gnugcc@marino.st \
    --cc=gcc-help@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).