public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Mitchell <mark@codesourcery.com>
To: binutils@sources.redhat.com
Subject: PATCH: Make ld testsuite usable outside build directory
Date: Thu, 24 Mar 2005 14:45:00 -0000	[thread overview]
Message-ID: <200503240344.j2O3iJZh020945@sirius.codesourcery.com> (raw)


At present, the ld testsuite does not work on an installed linker due
to two minor problems:

1. The testsuite wants to read tmpdir/libpath.exp, which is generated
   by the Makefiles, but obviously not available when testing outside
   of the build directory.  Since the point of testing an installed
   toolchain is to see if it works by itself, this list of explict -L
   options is unncessary in that situation.

2. Several test scripts check [which $CC] to see if there's a compiler
   available.  That depends on the fact that "make check" passes in
   "CC=$(CC_FOR_TARGET)".  Users who run with "runtest" directly won't
   have CC set; this should be treated just like the case where there
   is no available compiler.

   (I think a further improvement would be to actually look for a
   compiler, using [transform gcc].  If people agree that this is a
   good idea, I can add that.)

Tested with an arm-linux toolchain.  OK?

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2005-03-23  Mark Mitchell  <mark@codesourcery.com>

	* config/default.exp: Do not load libpath.exp if it does not
	exist.
	* ld-elfcomm/elfcomm.exp: Do not use CC if it does not exist.
	* ld-scripts/crossref.exp: Likewise.
	* ld-srec/srec.exp: Likewise.
	* ld-undefined/undefined.exp: Likewise.

Index: config/default.exp
===================================================================
RCS file: /home/cvs/Repository/binutils/ld/testsuite/config/default.exp,v
retrieving revision 1.1.5.1
diff -c -5 -p -r1.1.5.1 default.exp
*** config/default.exp	26 Nov 2003 04:18:08 -0000	1.1.5.1
--- config/default.exp	24 Mar 2005 03:36:57 -0000
*************** if {![file isdirectory tmpdir/ld]} then 
*** 68,81 ****
      catch "exec ln -s ../../ld-new tmpdir/ld/ld" status
  }
  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
--- 68,83 ----
      catch "exec ln -s ../../ld-new tmpdir/ld/ld" status
  }
  set gcc_ld_flag "-B[pwd]/tmpdir/ld/"
  
  # load the linker path
! if {[file exists tmpdir/libpath.exp]} {
!     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
Index: ld-elfcomm/elfcomm.exp
===================================================================
RCS file: /home/cvs/Repository/binutils/ld/testsuite/ld-elfcomm/elfcomm.exp,v
retrieving revision 1.1.5.1
diff -c -5 -p -r1.1.5.1 elfcomm.exp
*** ld-elfcomm/elfcomm.exp	26 Nov 2003 04:18:09 -0000	1.1.5.1
--- ld-elfcomm/elfcomm.exp	24 Mar 2005 03:36:57 -0000
*************** set test1	"size/aligment change of commo
*** 29,39 ****
  set test1w1	"$test1 (warning 1)"
  set test1w2	"$test1 (warning 2)"
  set test1c1	"$test1 (change 1)"
  set test1c2	"$test1 (change 2)"
  
! if { [which $CC] == 0 } {
      untested $test1w1
      untested $test1w2
      untested $test1c1
      untested $test1c2
      return
--- 29,39 ----
  set test1w1	"$test1 (warning 1)"
  set test1w2	"$test1 (warning 2)"
  set test1c1	"$test1 (change 1)"
  set test1c2	"$test1 (change 2)"
  
! if { ![info exists CC] || [which $CC] == 0 } {
      untested $test1w1
      untested $test1w2
      untested $test1c1
      untested $test1c2
      return
Index: ld-scripts/crossref.exp
===================================================================
RCS file: /home/cvs/Repository/binutils/ld/testsuite/ld-scripts/crossref.exp,v
retrieving revision 1.1.5.2
diff -c -5 -p -r1.1.5.2 crossref.exp
*** ld-scripts/crossref.exp	17 Jan 2005 03:28:41 -0000	1.1.5.2
--- ld-scripts/crossref.exp	24 Mar 2005 03:36:57 -0000
***************
*** 18,28 ****
  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  
  set test1 "NOCROSSREFS 1"
  set test2 "NOCROSSREFS 2"
  
! if { [which $CC] == 0 } {
      untested $test1
      untested $test2
      return
  }
  
--- 18,28 ----
  # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  
  set test1 "NOCROSSREFS 1"
  set test2 "NOCROSSREFS 2"
  
! if { ![info exists CC] || [which $CC] == 0 } {
      untested $test1
      untested $test2
      return
  }
  
Index: ld-srec/srec.exp
===================================================================
RCS file: /home/cvs/Repository/binutils/ld/testsuite/ld-srec/srec.exp,v
retrieving revision 1.1.5.2
diff -c -5 -p -r1.1.5.2 srec.exp
*** ld-srec/srec.exp	17 Jan 2005 03:28:41 -0000	1.1.5.2
--- ld-srec/srec.exp	24 Mar 2005 03:36:57 -0000
*************** set sizeof_headers [string match "*SIZEO
*** 332,342 ****
  # First test linking a C program.  We don't require any libraries.  We
  # link it normally, and objcopy to the S-record format, and then link
  # directly to the S-record format, and require that the two files
  # contain the same data.
  
! if { [which $CC] == 0 } {
      untested $test1
      untested $test2
      return
  }
  
--- 332,342 ----
  # First test linking a C program.  We don't require any libraries.  We
  # link it normally, and objcopy to the S-record format, and then link
  # directly to the S-record format, and require that the two files
  # contain the same data.
  
! if { ![info exists CC] || [which $CC] == 0 } {
      untested $test1
      untested $test2
      return
  }
  
Index: ld-undefined/undefined.exp
===================================================================
RCS file: /home/cvs/Repository/binutils/ld/testsuite/ld-undefined/undefined.exp,v
retrieving revision 1.1.5.2
diff -c -5 -p -r1.1.5.2 undefined.exp
*** ld-undefined/undefined.exp	17 Jan 2005 03:28:41 -0000	1.1.5.2
--- ld-undefined/undefined.exp	24 Mar 2005 03:36:57 -0000
***************
*** 20,30 ****
  
  set testund "undefined"
  set testfn "undefined function"
  set testline "undefined line"
  
! if { [which $CC] == 0 } {
      verbose "Could not find C compiler!" 1
      untested $testund
      untested $testfn
      untested $testline
      return
--- 20,30 ----
  
  set testund "undefined"
  set testfn "undefined function"
  set testline "undefined line"
  
! if { ![info exists CC] || [which $CC] == 0 } {
      verbose "Could not find C compiler!" 1
      untested $testund
      untested $testfn
      untested $testline
      return

             reply	other threads:[~2005-03-24  3:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-24 14:45 Mark Mitchell [this message]
2005-03-24 14:52 ` Ian Lance Taylor
2005-03-24 14:56   ` Mark Mitchell
2005-03-24 19:34     ` Daniel Jacobowitz
2005-03-24 20:39       ` Mark Mitchell
2005-03-24 20:51         ` Daniel Jacobowitz
2005-03-24 20:59           ` Mark Mitchell
2005-03-24 21:15           ` Mark Mitchell
2005-03-24 21:25             ` Ian Lance Taylor
2005-03-25  9:31               ` Mark Mitchell
2005-03-25 15:23                 ` Daniel Jacobowitz
2005-03-25 16:00                   ` Mark Mitchell
2005-03-24 14:54 ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200503240344.j2O3iJZh020945@sirius.codesourcery.com \
    --to=mark@codesourcery.com \
    --cc=binutils@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).