From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11116 invoked by alias); 24 Mar 2005 03:44:25 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 11098 invoked from network); 24 Mar 2005 03:44:20 -0000 Received: from unknown (HELO sirius.codesourcery.com) (65.74.133.4) by sourceware.org with SMTP; 24 Mar 2005 03:44:20 -0000 Received: from sirius.codesourcery.com (localhost.localdomain [127.0.0.1]) by sirius.codesourcery.com (8.12.8/8.12.5) with ESMTP id j2O3iKYE020949 for ; Wed, 23 Mar 2005 19:44:20 -0800 Received: (from mitchell@localhost) by sirius.codesourcery.com (8.12.8/8.12.8/Submit) id j2O3iJZh020945; Wed, 23 Mar 2005 19:44:19 -0800 Date: Thu, 24 Mar 2005 14:45:00 -0000 Message-Id: <200503240344.j2O3iJZh020945@sirius.codesourcery.com> From: Mark Mitchell To: binutils@sources.redhat.com Subject: PATCH: Make ld testsuite usable outside build directory Reply-to: mark@codesourcery.com X-SW-Source: 2005-03/txt/msg00728.txt.bz2 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 * 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