public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Iain Sandoe <developer@sandoe-acoustics.co.uk>
Cc: Jan Hubicka <hubicka@ucw.cz>,
	       Hans-Peter Nilsson <hans-peter.nilsson@axis.com>,
	       GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [RFA:] fix breakage with "Update testsuite to run with slim	LTO"
Date: Fri, 21 Oct 2011 12:35:00 -0000	[thread overview]
Message-ID: <yddk47yeeww.fsf@manam.CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <63B3C6F6-2C30-4A7C-A324-8805D8AA8667@sandoe-acoustics.co.uk>	(Iain Sandoe's message of "Fri, 21 Oct 2011 12:10:04 +0100")

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

Iain Sandoe <developer@sandoe-acoustics.co.uk> writes:

> It looks like the gnat testsuite is also broken - but HP's fix doesn't
> recover that.
> .. will try and take a look - but short on time today,

I think I see what's going on: in gnat.log, I find

Running /vol/gcc/src/hg/trunk/local/gcc/testsuite/gnat.dg/dg.exp ...
ERROR: tcl error sourcing library file /vol/gcc/src/hg/trunk/local/gcc/testsuite/lib/gcc-dg.exp.
can't read "GCC_UNDER_TEST": no such variable
can't read "GCC_UNDER_TEST": no such variable
    while executing
"lappend options "compiler=$GCC_UNDER_TEST""
    (procedure "gcc_target_compile" line 37)
    invoked from within
"gcc_target_compile $source $dest $type $options"
    invoked from within
"if [ string match "*.c" $source ] then {
	return [gcc_target_compile $source $dest $type $options]
    }"
    (procedure "gnat_target_compile" line 12)
    invoked from within
"${tool}_target_compile $src $output $compile_type "$options""
    (procedure "check_compile" line 39)
    invoked from within
"check_compile linker_plugin executable {
     int main() { return 0; }
  } {-flto -fuse-linker-plugin}"
    ("eval" body line 1)
    invoked from within
"eval check_compile $args"
    (procedure "check_no_compiler_messages_nocache" line 2)
    invoked from within
"check_no_compiler_messages_nocache linker_plugin executable {
     int main() { return 0; }
  } "-flto -fuse-linker-plugin""
    (procedure "check_linker_plugin_available" line 2)
    invoked from within
"check_linker_plugin_available"
    invoked from within
"if [check_effective_target_lto] {
    # When having plugin test both slim and fat LTO and plugin/nonplugin
    # path.
    if [check_linker_plugin_ava..."
    (file "/vol/gcc/src/hg/trunk/local/gcc/testsuite/lib/gcc-dg.exp" line 71)
    invoked from within
"source /vol/gcc/src/hg/trunk/local/gcc/testsuite/lib/gcc-dg.exp"
    ("uplevel" body line 1)
    invoked from within
"uplevel #0 source /vol/gcc/src/hg/trunk/local/gcc/testsuite/lib/gcc-dg.exp"

If running the gnat.dg testsuite, lib/gcc-dg.exp is now calling
check_linker_plugin_available early, which ultimately calls
${tool}_target_compile.  For all languages but Ada,
${tool}_target_compile can compile .c files just fine, but
gnat_target_compile (which uses gnatmake) cannot, so it falls back to
directly calling gcc_target_compile in that case.  gcc_target_compile
relies on GCC_UNDER_TEST being set, which in this case hasn't yet
happened, thus the error.

My solution (a hack, actually) is to move the initialization of
GCC_UNDER_TEST in gcc-dg.exp before the calls to
check_linker_plugin_available.  x86_64-unknown-linux-gnu testing in
progress, will commit once that's finished.

Btw., the ChangeLog entry for Jan's patch was riddled with typos and
wrong pathnames.  I've corrected that with a separate checkin.

	Rainer


2011-10-21  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* lib/gcc-dg.exp (GCC_UNDER_TEST): Set before calling
	check_linker_plugin_available.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: testsuite-gnat-linker-plugin.patch --]
[-- Type: text/x-patch, Size: 800 bytes --]

# HG changeset patch
# Parent 9c45ed5cb653fa8053d3c7a9d6502a85b0ffbafc
Fix gnat.dg testing with linker plugin check

diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -41,6 +41,11 @@ if { [ishost "*-*-cygwin*"] } {
   setenv LANG C.ASCII
 }
 
+global GCC_UNDER_TEST
+if ![info exists GCC_UNDER_TEST] {
+    set GCC_UNDER_TEST "[find_gcc]"
+}
+
 if [info exists TORTURE_OPTIONS] {
     set DG_TORTURE_OPTIONS $TORTURE_OPTIONS
 } else {
@@ -84,12 +89,6 @@ if [check_effective_target_lto] {
     }
 }
 
-
-global GCC_UNDER_TEST
-if ![info exists GCC_UNDER_TEST] {
-    set GCC_UNDER_TEST "[find_gcc]"
-}
-
 global orig_environment_saved
 
 # This file may be sourced, so don't override environment settings

[-- Attachment #3: Type: text/plain, Size: 143 bytes --]


-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

  reply	other threads:[~2011-10-21 11:57 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-27 17:54 Update testsuite to run with slim LTO Jan Hubicka
2011-09-30 14:56 ` Diego Novillo
2011-10-20 19:34 ` Breakage with "Update testsuite to run with slim LTO" Hans-Peter Nilsson
2011-10-20 19:53   ` Andi Kleen
2011-10-21  0:39   ` Jan Hubicka
2011-10-21  5:22     ` [RFA:] fix breakage " Hans-Peter Nilsson
2011-10-21  9:58       ` Jan Hubicka
2011-10-21 12:23         ` Iain Sandoe
2011-10-21 12:35           ` Rainer Orth [this message]
2011-10-21 16:20             ` Jan Hubicka
2011-10-21 17:40               ` Hans-Peter Nilsson
2011-10-21 18:52                 ` Jan Hubicka
2011-10-21 19:56                   ` Hans-Peter Nilsson
2011-10-24 12:08             ` Richard Guenther
2011-10-28 14:59       ` ping: [RFA:] testsuite infrastructure for options implied by dg-final methods Hans-Peter Nilsson
2011-11-04 13:56         ` ping*2: " Hans-Peter Nilsson
2011-11-04 17:05           ` Mike Stump
2011-11-04 17:54             ` Hans-Peter Nilsson
2011-11-04 18:14               ` Mike Stump
2011-11-04 18:16                 ` Hans-Peter Nilsson
2023-05-03 11:16 ` Let each 'lto_init' determine the default 'LTO_OPTIONS', and 'torture-init' the 'LTO_TORTURE_OPTIONS' (was: Update testsuite to run with slim LTO) Thomas Schwinge
2023-05-03 11:46   ` Richard Biener
2023-05-09  7:32     ` Christophe Lyon
2023-05-09  9:00       ` Testsuite: Add missing 'torture-init'/'torture-finish' around 'LTO_TORTURE_OPTIONS' usage (was: Let each 'lto_init' determine the default 'LTO_OPTIONS', and 'torture-init' the 'LTO_TORTURE_OPTIONS') Thomas Schwinge
2023-05-09 15:17         ` Christophe Lyon
2023-05-09 19:14           ` Christophe Lyon
2023-05-10  7:51             ` Testsuite: Add 'torture-init-done', and use it to conditionalize implicit 'torture-init' (was: Testsuite: Add missing 'torture-init'/'torture-finish' around 'LTO_TORTURE_OPTIONS' usage (was: Let each 'lto_init' determine the default 'LTO_OPTIONS', and 'torture-init' the 'LTO_TORTURE_OPTIONS')) Thomas Schwinge
2023-05-10 13:42               ` Christophe Lyon

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=yddk47yeeww.fsf@manam.CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=developer@sandoe-acoustics.co.uk \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hans-peter.nilsson@axis.com \
    --cc=hubicka@ucw.cz \
    /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).