From patchwork Mon Oct 19 16:03:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 1384391 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CFM471hxKz9sSG for ; Tue, 20 Oct 2020 03:03:17 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 758473854825; Mon, 19 Oct 2020 16:03:15 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com [68.232.141.98]) by sourceware.org (Postfix) with ESMTPS id 7017B3857C56 for ; Mon, 19 Oct 2020 16:03:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7017B3857C56 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=Tobias_Burnus@mentor.com IronPort-SDR: P0xzV+sFAEHFQDQFnV5VFiGu9tTg0h7RLtN1RcCGdfxh3bXhUXnPloqemlHWW6tfKvp8f/8lPM pFOgWHfmuJsKutAaYhjIcEBhEOHSAJXr6rY0fyD8jb+v9GgfUPHi03K1wwPw+8wQsDp3hKZVzy wRVRWbtwVQKHsvuoAxJMvLtm5wQtQeX2JyJ95oLsexcbmTw+qybDG1DntXfFA1mVtmekMmm2Tk XeIRF4/7rtx1ewpUC0mLqetxJasPoiQN8OC1JhR7GY4Xt906hudR5kkgZSD9d5mLOtosY7xl6P rgs= X-IronPort-AV: E=Sophos;i="5.77,394,1596528000"; d="diff'?scan'208";a="54159927" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 19 Oct 2020 08:03:10 -0800 IronPort-SDR: cIlqr6oW6yr7E95rvAswORPGRoMmEtsqXkxsCthMAIsGeAJ9WDZumPE9FAj7yZuNXZtXcVDoj7 9OL+bQa3sUOpYRJnfGHLwbstXgsmiqKn7VK3qlIGkwZ0zzHh6RJz7F20fmgY9fmu50Obg6j1ZT eJYa4wEbBmcpls3atPMQ3/YjyCLWL1ybTv8sLqeP7HHA4DfEJJNGY0T7l/9lvfJo0yqvKrIIVl gl7H4fWaYlnADMqm5aY3mspS819hvghSVRHILYW0Z6Ddi05BraB5xz+xOSu2Wc4ojEmUdqg/jh jc8= Subject: [Patch] testsuite: Avoid TCL errors when rootme or ASAN/TSAN/UBSAN is not available (was: Re: [Patch] testsuite: Avoid TCL errors when ASAN/TSAN/UBSAN is not available) From: Tobias Burnus To: gcc-patches , Rainer Orth , Mike Stump References: Message-ID: Date: Mon, 19 Oct 2020 18:03:06 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.2 MIME-Version: 1.0 In-Reply-To: Content-Language: en-US X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: SVR-IES-MBX-07.mgc.mentorg.com (139.181.222.7) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Thomas Schwinge and Joseph convinced me that 'rootme' only makes sense for in-tree testing and, hence, does not need (or: should not) be set in site.exp. Thus, if it is not set, we have to check its existence before using it – to avoid similar TCL errors. Hence, I updated the patch to check also for 'rootme'. OK? Tobias On 10/19/20 11:46 AM, Tobias Burnus wrote: > In a --disable-libsanitizer build, I see errors such as: > g++.sum:ERROR: can't read "asan_saved_library_path": no such variable > > I believe the following patch is the right way to solve this. > OK? > > Tobias > ----------------- Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter testsuite: Avoid TCL errors when rootme or ASAN/TSAN/UBSAN is not avail * g++.dg/guality/guality.exp: * gcc.dg/guality/guality.exp: * gfortran.dg/guality/guality.exp: * lib/asan-dg.exp: * lib/tsan-dg.exp: * lib/ubsan-dg.exp: gcc/testsuite/g++.dg/guality/guality.exp | 2 +- gcc/testsuite/gcc.dg/guality/guality.exp | 2 +- gcc/testsuite/gfortran.dg/guality/guality.exp | 2 +- gcc/testsuite/lib/asan-dg.exp | 6 ++++-- gcc/testsuite/lib/tsan-dg.exp | 6 ++++-- gcc/testsuite/lib/ubsan-dg.exp | 6 ++++-- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/gcc/testsuite/g++.dg/guality/guality.exp b/gcc/testsuite/g++.dg/guality/guality.exp index 33571f1f28f..1d5b65fef57 100644 --- a/gcc/testsuite/g++.dg/guality/guality.exp +++ b/gcc/testsuite/g++.dg/guality/guality.exp @@ -38,7 +38,7 @@ global GDB if ![info exists ::env(GUALITY_GDB_NAME)] { if [info exists GDB] { set guality_gdb_name "$GDB" - } elseif [file exists $rootme/../gdb/gdb] { + } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } { # If we're doing a combined build, and gdb is available, use it. set guality_gdb_name "$rootme/../gdb/gdb" } else { diff --git a/gcc/testsuite/gcc.dg/guality/guality.exp b/gcc/testsuite/gcc.dg/guality/guality.exp index 89cd896d05c..ba87132aef2 100644 --- a/gcc/testsuite/gcc.dg/guality/guality.exp +++ b/gcc/testsuite/gcc.dg/guality/guality.exp @@ -38,7 +38,7 @@ global GDB if ![info exists ::env(GUALITY_GDB_NAME)] { if [info exists GDB] { set guality_gdb_name "$GDB" - } elseif [file exists $rootme/../gdb/gdb] { + } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } { # If we're doing a combined build, and gdb is available, use it. set guality_gdb_name "$rootme/../gdb/gdb" } else { diff --git a/gcc/testsuite/gfortran.dg/guality/guality.exp b/gcc/testsuite/gfortran.dg/guality/guality.exp index eaa7ae770d6..0375edfffe4 100644 --- a/gcc/testsuite/gfortran.dg/guality/guality.exp +++ b/gcc/testsuite/gfortran.dg/guality/guality.exp @@ -19,7 +19,7 @@ global GDB if ![info exists ::env(GUALITY_GDB_NAME)] { if [info exists GDB] { set guality_gdb_name "$GDB" - } elseif [file exists $rootme/../gdb/gdb] { + } elseif { [info exists rootme] && [file exists $rootme/../gdb/gdb] } { # If we're doing a combined build, and gdb is available, use it. set guality_gdb_name "$rootme/../gdb/gdb" } else { diff --git a/gcc/testsuite/lib/asan-dg.exp b/gcc/testsuite/lib/asan-dg.exp index 2124607245e..ce745dfdf8d 100644 --- a/gcc/testsuite/lib/asan-dg.exp +++ b/gcc/testsuite/lib/asan-dg.exp @@ -151,8 +151,10 @@ proc asan_finish { args } { unset TEST_ALWAYS_FLAGS } } - set ld_library_path $asan_saved_library_path - set_ld_library_path_env_vars + if [info exists asan_saved_library_path ] { + set ld_library_path $asan_saved_library_path + set_ld_library_path_env_vars + } clear_effective_target_cache } diff --git a/gcc/testsuite/lib/tsan-dg.exp b/gcc/testsuite/lib/tsan-dg.exp index b5631a79bcf..6dcfd0a2f83 100644 --- a/gcc/testsuite/lib/tsan-dg.exp +++ b/gcc/testsuite/lib/tsan-dg.exp @@ -150,7 +150,9 @@ proc tsan_finish { args } { } else { unset dg-do-what-default } - set ld_library_path $tsan_saved_library_path - set_ld_library_path_env_vars + if [info exists tsan_saved_library_path ] { + set ld_library_path $tsan_saved_library_path + set_ld_library_path_env_vars + } clear_effective_target_cache } diff --git a/gcc/testsuite/lib/ubsan-dg.exp b/gcc/testsuite/lib/ubsan-dg.exp index f4ab29e2add..31740e02ab4 100644 --- a/gcc/testsuite/lib/ubsan-dg.exp +++ b/gcc/testsuite/lib/ubsan-dg.exp @@ -141,7 +141,9 @@ proc ubsan_finish { args } { unset TEST_ALWAYS_FLAGS } } - set ld_library_path $ubsan_saved_library_path - set_ld_library_path_env_vars + if [info exists ubsan_saved_library_path ] { + set ld_library_path $ubsan_saved_library_path + set_ld_library_path_env_vars + } clear_effective_target_cache }