public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* ld testsuite failures
@ 2003-05-20  7:35 Alan Modra
  2003-05-20 16:35 ` PATCH: " H. J. Lu
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Modra @ 2003-05-20  7:35 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

HJ,
  Since your 2003-05-15 ld_simple_link $CC change, I'm seeing failures
like the following:

/usr/tmp/gas/x86/ld/tmpdir/ld/ld: cannot find -lc
collect2: ld returned 1 exit status
FAIL: visibility (hidden) (non PIC, load offset)
[snip more visibility failures]

/usr/tmp/gas/x86/ld/tmpdir/ld/ld: cannot find -lc
collect2: ld returned 1 exit status
FAIL: shared (non PIC, load offset)

The problem is that the failing tests use -T $srcdir/$subdir/elf-offset.ld,
and elf-offset.ld doesn't specify SEARCH_DIR.  On my system, ld.so.conf
doesn't specify the default dirs of /lib and /usr/lib, and I'm building
binutils with --prefix=/usr/local

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 6+ messages in thread

* PATCH: ld testsuite failures
  2003-05-20  7:35 ld testsuite failures Alan Modra
@ 2003-05-20 16:35 ` H. J. Lu
  2003-05-21  0:34   ` Alan Modra
  0 siblings, 1 reply; 6+ messages in thread
From: H. J. Lu @ 2003-05-20 16:35 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 1067 bytes --]

On Tue, May 20, 2003 at 04:59:33PM +0930, Alan Modra wrote:
> HJ,
>   Since your 2003-05-15 ld_simple_link $CC change, I'm seeing failures
> like the following:
> 
> /usr/tmp/gas/x86/ld/tmpdir/ld/ld: cannot find -lc
> collect2: ld returned 1 exit status
> FAIL: visibility (hidden) (non PIC, load offset)
> [snip more visibility failures]
> 
> /usr/tmp/gas/x86/ld/tmpdir/ld/ld: cannot find -lc
> collect2: ld returned 1 exit status
> FAIL: shared (non PIC, load offset)
> 
> The problem is that the failing tests use -T $srcdir/$subdir/elf-offset.ld,
> and elf-offset.ld doesn't specify SEARCH_DIR.  On my system, ld.so.conf
> doesn't specify the default dirs of /lib and /usr/lib, and I'm building
> binutils with --prefix=/usr/local
> 

How about this? I am not too happy about it since it only covers
native targets, which is sufficient since I only used CC with
default_ld_simple_link on native targets. It won't work CC on cross
targets. Only genscripts.sh knows what directories should be searched.
But I couldn't find a easy way to pass it to Makefile.


H.J.

[-- Attachment #2: ld-native-test.patch --]
[-- Type: text/plain, Size: 1268 bytes --]

ld/

2003-05-20  H.J. Lu <hongjiu.lu@intel.com>

	* Makefile.am (check-DEJAGNU): Also pass NATIVE_LIB_DIRS.
	* Makefile.in: Regenerated.

ld/testsuite/

2003-05-20  H.J. Lu <hongjiu.lu@intel.com>

	* lib/ld-lib.exp (default_ld_simple_link): Add NATIVE_LIB_DIRS
	for native targets.

--- ld/Makefile.am.libdir	2003-05-14 16:23:11.000000000 -0700
+++ ld/Makefile.am	2003-05-20 08:04:31.000000000 -0700
@@ -1421,6 +1421,7 @@ check-DEJAGNU: site.exp
 		CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
 		OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
 		LIBIBERTY="$(LIBIBERTY) $(INTLLIBS)" LIBS="$(LIBS)" \
+		NATIVE_LIB_DIRS="$(NATIVE_LIB_DIRS)" \
 		$(RUNTESTFLAGS); \
 	else echo "WARNING: could not find \`runtest'" 1>&2; :;\
 	fi
--- ld/testsuite/lib/ld-lib.exp.libdir	2003-05-18 21:48:13.000000000 -0700
+++ ld/testsuite/lib/ld-lib.exp	2003-05-20 08:15:58.000000000 -0700
@@ -167,6 +167,14 @@ proc default_ld_simple_link { ld target 
 	set flags ""
     }
 
+    if [isnative] {
+	global NATIVE_LIB_DIRS
+
+	foreach dir $NATIVE_LIB_DIRS { 
+	    set flags "-L$dir $flags"
+	}
+    }
+
     # If we are compiling with gcc, we want to add gcc_ld_flag to
     # flags.  Rather than determine this in some complex way, we guess
     # based on the name of the compiler.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PATCH: ld testsuite failures
  2003-05-20 16:35 ` PATCH: " H. J. Lu
@ 2003-05-21  0:34   ` Alan Modra
  2003-05-21  2:42     ` Daniel Jacobowitz
  2003-05-22 16:32     ` PATCH: Provide linker search path to ld testsuite H. J. Lu
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Modra @ 2003-05-21  0:34 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

On Tue, May 20, 2003 at 08:35:52AM -0700, H. J. Lu wrote:
> On Tue, May 20, 2003 at 04:59:33PM +0930, Alan Modra wrote:
> > The problem is that the failing tests use -T $srcdir/$subdir/elf-offset.ld,
> > and elf-offset.ld doesn't specify SEARCH_DIR.  On my system, ld.so.conf
> > doesn't specify the default dirs of /lib and /usr/lib, and I'm building
> > binutils with --prefix=/usr/local
> > 
> 
> How about this? I am not too happy about it since it only covers
> native targets, which is sufficient since I only used CC with

OK.  Hmm, it would be better to do without elf-offset.ld somehow.  I
wonder whether something like

. = (. != 0 ? . : ${TEXT_BASE_ADDRESS});

instead of the existing expression in elf.sc SECTIONS would work,
and similarly for the shared lib case.  The idea being to set dot on
the command line, and not have it overridden by the default script.
I might play with the idea after the gcc summit.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PATCH: ld testsuite failures
  2003-05-21  0:34   ` Alan Modra
@ 2003-05-21  2:42     ` Daniel Jacobowitz
  2003-05-22 16:32     ` PATCH: Provide linker search path to ld testsuite H. J. Lu
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Jacobowitz @ 2003-05-21  2:42 UTC (permalink / raw)
  To: H. J. Lu, binutils

On Wed, May 21, 2003 at 10:04:42AM +0930, Alan Modra wrote:
> On Tue, May 20, 2003 at 08:35:52AM -0700, H. J. Lu wrote:
> > On Tue, May 20, 2003 at 04:59:33PM +0930, Alan Modra wrote:
> > > The problem is that the failing tests use -T $srcdir/$subdir/elf-offset.ld,
> > > and elf-offset.ld doesn't specify SEARCH_DIR.  On my system, ld.so.conf
> > > doesn't specify the default dirs of /lib and /usr/lib, and I'm building
> > > binutils with --prefix=/usr/local
> > > 
> > 
> > How about this? I am not too happy about it since it only covers
> > native targets, which is sufficient since I only used CC with
> 
> OK.  Hmm, it would be better to do without elf-offset.ld somehow.  I
> wonder whether something like
> 
> . = (. != 0 ? . : ${TEXT_BASE_ADDRESS});
> 
> instead of the existing expression in elf.sc SECTIONS would work,
> and similarly for the shared lib case.  The idea being to set dot on
> the command line, and not have it overridden by the default script.
> I might play with the idea after the gcc summit.

This is not the first time I've wanted a way to inherit things from the
default linker script... perhaps there should be a way to do this,
either in general or at least specifically for SEARCH_DIRS.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer

^ permalink raw reply	[flat|nested] 6+ messages in thread

* PATCH: Provide linker search path to ld testsuite
  2003-05-21  0:34   ` Alan Modra
  2003-05-21  2:42     ` Daniel Jacobowitz
@ 2003-05-22 16:32     ` H. J. Lu
  2003-05-30  8:09       ` Nick Clifton
  1 sibling, 1 reply; 6+ messages in thread
From: H. J. Lu @ 2003-05-22 16:32 UTC (permalink / raw)
  To: binutils

[-- Attachment #1: Type: text/plain, Size: 717 bytes --]

On Wed, May 21, 2003 at 10:04:42AM +0930, Alan Modra wrote:
> On Tue, May 20, 2003 at 08:35:52AM -0700, H. J. Lu wrote:
> > On Tue, May 20, 2003 at 04:59:33PM +0930, Alan Modra wrote:
> > > The problem is that the failing tests use -T $srcdir/$subdir/elf-offset.ld,
> > > and elf-offset.ld doesn't specify SEARCH_DIR.  On my system, ld.so.conf
> > > doesn't specify the default dirs of /lib and /usr/lib, and I'm building
> > > binutils with --prefix=/usr/local
> > > 
> > 
> > How about this? I am not too happy about it since it only covers
> > native targets, which is sufficient since I only used CC with
> 
> OK.  Hmm, it would be better to do without elf-offset.ld somehow.  I

I like this patch better.


H.J.

[-- Attachment #2: ld-test-link.patch --]
[-- Type: text/plain, Size: 1519 bytes --]

ld/

2003-05-22  H.J. Lu <hongjiu.lu@intel.com>

	* genscripts.sh: Create tmpdir/libpath.exp.

ld/testsuite/

2003-05-22  H.J. Lu <hongjiu.lu@intel.com>

	* config/default.exp: Load tmpdir/libpath.exp.
	(gcc_ld_flag): Set from $libpath.

--- ld/genscripts.sh.link	2003-02-27 11:27:17.000000000 -0800
+++ ld/genscripts.sh	2003-05-22 09:23:37.000000000 -0700
@@ -119,6 +119,15 @@ fi
 
 LIB_SEARCH_DIRS=`echo ${LIB_PATH} | sed -e 's/:/ /g' -e 's/\([^ ][^ ]*\)/SEARCH_DIR(\\"\1\\");/g'`
 
+# We need it for testsuite.
+case " $EMULATION_LIBPATH " in
+  *" ${EMULATION_NAME} "*)
+    test -d tmpdir || mkdir tmpdir
+    rm -f tmpdir/libpath
+    echo "set libpath \"${LIB_PATH}\"" | sed -e 's/:/ /g' > tmpdir/libpath.exp
+    ;;
+esac
+
 # Generate 5 or 6 script files from a master script template in
 # ${srcdir}/scripttempl/${SCRIPT_NAME}.sh.  Which one of the 5 or 6
 # script files is actually used depends on command line options given
--- ld/testsuite/config/default.exp.link	2003-05-19 08:23:00.000000000 -0700
+++ ld/testsuite/config/default.exp	2003-05-22 09:22:40.000000000 -0700
@@ -69,6 +69,13 @@ if {![file isdirectory tmpdir/ld]} then 
 }
 set gcc_ld_flag "-B[pwd]/tmpdir/ld/"
 
+# load the linker path
+load_lib tmpdir/libpath.exp
+
+foreach dir $libpath {
+    set gcc_ld_flag "$gcc_ld_flag -L$dir"
+}
+
 # The mips64-*-linux-gnu compiler defaults to the N32 ABI after
 # installed, but to the O32 ABI in the build tree, because of some
 # specs-file hacks.  Make sure we use an ABI that is compatible with

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: PATCH: Provide linker search path to ld testsuite
  2003-05-22 16:32     ` PATCH: Provide linker search path to ld testsuite H. J. Lu
@ 2003-05-30  8:09       ` Nick Clifton
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Clifton @ 2003-05-30  8:09 UTC (permalink / raw)
  To: H. J. Lu; +Cc: binutils

Hi H.J.

> ld/
>
> 2003-05-22  H.J. Lu <hongjiu.lu@intel.com>
>
> 	* genscripts.sh: Create tmpdir/libpath.exp.
>
> ld/testsuite/
>
> 2003-05-22  H.J. Lu <hongjiu.lu@intel.com>
>
> 	* config/default.exp: Load tmpdir/libpath.exp.
> 	(gcc_ld_flag): Set from $libpath.

Approved - please apply.

Cheers
        Nick
        

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-05-30  7:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-20  7:35 ld testsuite failures Alan Modra
2003-05-20 16:35 ` PATCH: " H. J. Lu
2003-05-21  0:34   ` Alan Modra
2003-05-21  2:42     ` Daniel Jacobowitz
2003-05-22 16:32     ` PATCH: Provide linker search path to ld testsuite H. J. Lu
2003-05-30  8:09       ` Nick Clifton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).