This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, libbacktrace] Find executable on ia64 and 64-bit hppa hpux
- From: Ian Lance Taylor <iant at google dot com>
- To: John David Anglin <dave dot anglin at nrc-cnrc dot gc dot ca>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 11 Dec 2012 17:50:56 -0800
- Subject: Re: [PATCH, libbacktrace] Find executable on ia64 and 64-bit hppa hpux
- References: <20121209195737.GA20382@hiauly1.hia.nrc.ca>
On Sun, Dec 9, 2012 at 11:57 AM, John David Anglin
<dave@hiauly1.hia.nrc.ca> wrote:
>
> #ifndef HAVE_GETEXECNAME
> +#if defined(__hpux) && (defined(__ia64) || defined(_LP64))
> +#include <dlfcn.h>
> +#define getexecname getexecname_hpux
> +
> +static char *
> +getexecname_hpux (void)
> +{
> + struct load_module_desc desc;
> +
> + dlget(-2, &desc, sizeof(desc));
> + return dlgetname(&desc, sizeof(desc), NULL, 0, 0);
> +}
> +
This is the kind of thing that is normally done via configure tests
rather than #ifdef tests. And once the configure tests are written, I
would prefer to see this as another pass in fileline.c, rather than
this rather complex reuse of getexecname.
Ian