This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] fix testsuite ldscripts problem [was Re: mips and frv testsuite failures after plugin patch]
On Tue, Oct 26, 2010 at 06:10:39PM +1030, Alan Modra wrote:
> On Mon, Oct 25, 2010 at 09:23:18PM +0100, Dave Korn wrote:
> > [ A bigger problem ISTM is that find_scripts_dir() will always prefer an
> > existing installed ldscripts directory if there is one
>
> Err, yeah. For a typical setup,
> -DSCRIPTDIR='"/usr/local/powerpc-linux/lib"'
> -DBINDIR='"/usr/local/bin"'
> -DTOOLBINDIR='"/usr/local/powerpc-linux/bin"'
> the first call to check_for_scripts_dir in find_scripts_dir will look
> for dir_path_to_ld/../powerpc-linux/lib/ldscripts, the second for
> dir_path_to_ld/../lib/ldscripts, and the third for
> /usr/local/powerpc-linux/lib/ldscripts. The comment on the third call
> says "We've been installed normally", however, that actually handles
> the case where ld *hasn't* been installed normally. The normal ld
> install will be in /usr/local/bin, so the first call to
> check_for_scripts_dir will find it, even when ld is a symbolic link to
> /usr/local/bin/ld.
>
> I think that we could probably remove the third call. If ld is moved
> somewhere without its accompanying ldscripts dir (assuming ld is built
> to use ldscripts), I'd say that is an error on the part of whoever
> moved ld.
Applied.
* ldfile.c (find_scripts_dir): Don't look in absolute SCRIPTDIR.
Index: ld/ldfile.c
===================================================================
RCS file: /cvs/src/src/ld/ldfile.c,v
retrieving revision 1.55
diff -u -p -r1.55 ldfile.c
--- ld/ldfile.c 14 Oct 2010 01:31:31 -0000 1.55
+++ ld/ldfile.c 28 Oct 2010 03:49:48 -0000
@@ -547,7 +547,6 @@ check_for_scripts_dir (char *dir)
SCRIPTDIR (passed from Makefile)
(adjusted according to the current location of the binary)
- SCRIPTDIR (passed from Makefile)
the dir where this program is (for using it from the build tree). */
static char *
@@ -571,10 +570,6 @@ find_scripts_dir (void)
free (dir);
}
- if (check_for_scripts_dir (SCRIPTDIR))
- /* We've been installed normally. */
- return SCRIPTDIR;
-
/* Look for "ldscripts" in the dir where our binary is. */
dir = make_relative_prefix (program_name, ".", ".");
if (dir)
--
Alan Modra
Australia Development Lab, IBM