This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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: set sysroot command on AIX has no effect.


Sangamesh Mallaya wrote:

> set sysroot command on AIX has no effect if a program depends on shared
> library archives (.a).

Yes, that seems a bug.

> +  /* If gdb_sysroot is set via set sysroot command, 
> +     then we need to prefix gdb_sysroot to shared library path  */
> +  /* .a shared library archives case */
> +  if (gdb_sysroot != NULL && *gdb_sysroot != 0) {
> +      sys_path = alloca (sizeof(gdb_sysroot)+strlen(pathname)); 
> +      memset (sys_path, 0, sizeof(sys_path));
> +      strcpy(sys_path, gdb_sysroot);
> +      pathname = strcat (sys_path, pathname);
> +  }
> +  path_len = strlen (pathname);

This duplicates some of the logic in solib_find.  It would be better
to avoid that duplication ...

Is there any reason why you cannot use solib_find / solib_bfd_fopen
to open the archive file, like solib_bfd_open does?  This would ensure
we're always using the same search logic for .a files as for .so files.

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU/Linux compilers and toolchain
  Ulrich.Weigand@de.ibm.com


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