From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20014 invoked by alias); 14 Oct 2010 05:01:10 -0000 Received: (qmail 20004 invoked by uid 22791); 14 Oct 2010 05:01:07 -0000 X-SWARE-Spam-Status: No, hits=-0.3 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,TW_EG X-Spam-Check-By: sourceware.org Received: from mail-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 Oct 2010 05:01:02 +0000 Received: by wyf28 with SMTP id 28so3435701wyf.0 for ; Wed, 13 Oct 2010 22:01:00 -0700 (PDT) Received: by 10.227.145.20 with SMTP id b20mr9743073wbv.28.1287032459571; Wed, 13 Oct 2010 22:00:59 -0700 (PDT) Received: from [192.168.2.99] (cpc2-cmbg8-0-0-cust61.5-4.cable.virginmedia.com [82.6.108.62]) by mx.google.com with ESMTPS id b30sm6029030wbb.16.2010.10.13.22.00.58 (version=SSLv3 cipher=RC4-MD5); Wed, 13 Oct 2010 22:00:59 -0700 (PDT) Message-ID: <4CB693F4.1040008@gmail.com> Date: Thu, 14 Oct 2010 05:01:00 -0000 From: Dave Korn User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: "binutils@sourceware.org" , Hans-Peter Nilsson Subject: [PATCH] Fix oopsie in ld-plugin tests. Content-Type: multipart/mixed; boundary="------------030207040406080209010900" Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00214.txt.bz2 This is a multi-part message in MIME format. --------------030207040406080209010900 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-length: 628 Good morning list, H-P pointed out to me that I overlooked to avoid returning an "ERROR:" in the testsuite results when there is no target compiler available. Sorry for cluttering up your overnight test results. The attached patch copies a test that I have in fact seen before and should have thought of, and uses it to mark the tests "UNSUPPORTED:" if no target compiler is available. ld/testsuite/ChangeLog: * ld-plugin/plugin.exp: Don't error out if there is no target compiler available, make tests UNSUPPORTED instead. I don't know if it counts as obvious, though. OK to commit? cheers, DaveK --------------030207040406080209010900 Content-Type: text/x-c; name="tests-fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tests-fix.diff" Content-length: 1598 diff --git a/ld/testsuite/ld-plugin/plugin.exp b/ld/testsuite/ld-plugin/plugin.exp index 796cb0e..416159a 100644 --- a/ld/testsuite/ld-plugin/plugin.exp +++ b/ld/testsuite/ld-plugin/plugin.exp @@ -24,6 +24,13 @@ if ![check_plugin_api_available] { return } +# And a compiler to be available. +set can_compile 1 +if { [which $CC] == 0 } { + # Don't fail immediately, + set can_compile 0 +} + pass "plugin API enabled" global base_dir @@ -62,12 +69,15 @@ set regcln "-plugin-opt registercleanup" set failed_compile 0 set _ "" set plugin_nm_output "" -if { ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/main.c tmpdir/main.o] - || ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/func.c tmpdir/func.o] - || ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/text.c tmpdir/text.o] } { +if { $can_compile && \ + (![ld_compile "$CC $CFLAGS" $srcdir/$subdir/main.c tmpdir/main.o] \ + || ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/func.c tmpdir/func.o] \ + || ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/text.c tmpdir/text.o]) } { # Defer fail until we have list of tests set. set failed_compile 1 -} else { +} + +if { $can_compile && !$failed_compile } { # Find out if symbols have prefix on this platform before setting tests. catch "exec $NM tmpdir/func.o" plugin_nm_output if { [regexp "_func" "$plugin_nm_output"] } { @@ -142,7 +152,7 @@ set plugin_extra_elf_tests [list \ {readelf -s plugin-vis-1.d}} "main.x" ] \ ] -if { $failed_compile != 0 } { +if { !$can_compile || $failed_compile } { foreach testitem $plugin_tests { unresolved [lindex $testitem 0] } --------------030207040406080209010900--