This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Alternative LD_LIBRARY_PATH
- From: "H. J. Lu" <hjl at lucon dot org>
- To: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 19 Nov 2004 09:31:57 -0800
- Subject: Re: [RFC] Alternative LD_LIBRARY_PATH
- References: <200411190358.iAJ3wIjw011814@hiauly1.hia.nrc.ca>
On Thu, Nov 18, 2004 at 10:58:17PM -0500, John David Anglin wrote:
> Here is an alternative patch for handling LD_LIBRARY_PATH and related
> environment variables. There are a couple of signicant improvements
> over what we do now.
>
> 1) The code to set these variables is consolidated in one file and
> isn't duplicated across many different files.
>
> 2) I believe that there is an improvment in handling environment
> variables on systems that don't use LD_LIBRARY_PATH, or use
> multiple variables.
>
> 3) There is a proc to restore the initial saved state.
>
> I've tested this change on hppa-unknown-linux-gnu.
>
> Comments?
>
It looks good to me. I really appreciate it. Can you use arrays on
environment variables, like
libpath(LD_LIBRARY_PATH), ...
orig_libpath(LD_LIBRARY_PATH), ...
You can use a loop on an array. BTW, is orig_libpath_saved really
needed? Can we just check orig_libpath instead?
Thanks.
H.J.