This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: Patch: RFC: make libltdl search for version-specific symlinksfirst
On Tue, 2004-09-07 at 17:02, Michael Koch wrote:
> On Wednesday 01 September 2004 15:12, Andrew Haley wrote:
> > Tom Tromey writes:
> > > >>>>> "Michael" == Michael Koch <konqueror@gmx.de> writes:
> > >
> > > Michael> The solution would be to try to load the *.so.version
> > > before Michael> trying the *.la file.
> > >
> > > That sounds reasonable to me.
> > >
> > > I'm a bit concerned about divergence from the upstream libltdl,
> > > not that we've tried to keep importing it or anything.
> >
> > Yeah, but we need something that works now. Let's go with this.
>
> Here is a revised patch. Please review.
>
> -/* If FILENAME has an ARCHIVE_EXT or SHLIB_EXT extension, try to
> - open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT,
> - and if a file is still not found try again with SHLIB_EXT appended
> - instead. */
> +/* If FILENAME has an ARCHIVE_EXT, SHLIB_VERSION_EXT or SHLIB_EXT
> + extension, try to open the FILENAME as passed. Otherwise try
> + appending ARCHIVE_EXT, and if a file is still not found try again
> + with SHLIB_VERSION_EXT appended. If the file is still not found,
> + try again with SHLIB_EXT appended. */
This comment needs to be updated to reflect the new search order.
> /* First try appending ARCHIVE_EXT. */
This one too.
> + /* As before, if the file was found but loading failed, return now
> + with the current error message. */
> + if (handle || ((errors > 0) && !file_not_found ()))
> + {
> + LT_DLFREE (tmp);
> + return handle;
> + }
> + else
> + {
> + LT_DLFREE (tmp);
> + }
The LT_DLFREE call can be moved to just before the if statement and the
else clause can be eliminated.
> - if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext))
> + if (LT_STRLEN (shlib_ext) > LT_STRLEN (shlib_version_ext))
This check cannot be changed since you're reusing the buffer sized
according to archive_ext's length.
Tom