This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, libbacktrace] Find executable on ia64 and 64-bit hppa hpux


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]