This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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: install libgtkpeer.so and libjawt.so in versioned library directory


Thomas Fitzsimmons wrote:
Maybe, but you simply cannot assume that argv[0] contains the path to
the current executable.  It's a fragile technique that runs the risk
of horrors like this one.  /proc/self/exe works on Linux.

OK, I'll re-add the GIJ_EXECUTABLE logic if Bryce agrees.

Well, I agree that argv[0] can't be used. However, using a hardcoded path means that:


- gij won't work from the testsuite, or the wrong gij will be tested
- gij will break if the user moves an installed libgcj tree

On Linux/Solaris/etc, we can use readlink("/proc/self/exe") to get the definitive path to the binary. On platforms where this is not available, we could just fall back to not doing the exec, and leave a fixme for those platforms to implement their equivalent if needed.

Bryce


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