GNU bug report logs - #41296
Fix misuse of "target_info" in default_target_compile (with patch)

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: dejagnu; Reported by: jcb62281@HIDDEN; Done: jcb62281@HIDDEN; Maintainer for dejagnu is bug-dejagnu@HIDDEN.
bug closed, send any further explanations to 41296 <at> debbugs.gnu.org and jcb62281@HIDDEN Request was from Jacob Bachmeyer <jcb62281@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 15 May 2020 22:52:49 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 15 18:52:49 2020
Received: from localhost ([127.0.0.1]:39096 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jZjCC-0003j4-Lk
	for submit <at> debbugs.gnu.org; Fri, 15 May 2020 18:52:48 -0400
Received: from lists.gnu.org ([209.51.188.17]:35600)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jcb62281@HIDDEN>) id 1jZjC7-0003it-MB
 for submit <at> debbugs.gnu.org; Fri, 15 May 2020 18:52:47 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:54992)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <jcb62281@HIDDEN>)
 id 1jZjC7-0006u1-CZ
 for bug-dejagnu@HIDDEN; Fri, 15 May 2020 18:52:43 -0400
Received: from mail-ot1-x32d.google.com ([2607:f8b0:4864:20::32d]:37130)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <jcb62281@HIDDEN>)
 id 1jZjC6-0007MH-MI
 for bug-dejagnu@HIDDEN; Fri, 15 May 2020 18:52:43 -0400
Received: by mail-ot1-x32d.google.com with SMTP id g11so1760901ots.4
 for <bug-dejagnu@HIDDEN>; Fri, 15 May 2020 15:52:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=message-id:date:from:reply-to:user-agent:mime-version:to:subject;
 bh=hUG0ZxsTp41R/AbYdUcvncReOi4QnwFwVxA8kpDUbYY=;
 b=VyTv2kl7wLFJji4v1qhVrfHXTkzzoY3I3YQglVBIJTSe/DNSW6a8QXDLtDQulZ15QB
 n719xptra8FoKNiKrWspGGMEFAF4MgmrlvlV7Fty4exa9eh49QpGOuLH8GaKNa0XPmQZ
 eKDHCWB7DanUxM9uXbzVZbmhV1AsgqbPqobMuCQSboNuSY+S0pThdXjQZTMUO+Uj5mbk
 f64k6CIMcYDlulLqi/+KOosvA7CkiWjI0JALfLprCHtuojUHl57124BfacH3KFaRMAsS
 ihmU+t1lEOatZPP4yaCAv6bbYDMsk+PDSv+WVLUINAfLv2y6s55+LM0cFIOL3PMoLQKN
 nTRg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:message-id:date:from:reply-to:user-agent
 :mime-version:to:subject;
 bh=hUG0ZxsTp41R/AbYdUcvncReOi4QnwFwVxA8kpDUbYY=;
 b=Pw0HNOJIc8X9BLMRj3DqCzoSOWJimpqhbFFw6rpDPGx2y7QRn5vupxsbU/oNOmMb3e
 Ii2yEvbbUn33dUq6n32JuZCkBIqPXk2KuLDherLPUFAdLDIr9vvI2YPJFCLhKK7/BrIh
 RTp63xXPQrZjahmY3Iav6hmk33+W/HRuquV0kf67Cv2JRyLEinA525+jwl7bg8vyFz2Y
 Vj4eNXGh+rq+wepeGPyQ+hLk89aFBL/lJI6KFnpDrEFqCJZN7K36+vwBu/ZEOU3bVFlk
 nYuDuO+KTGL7uB72zMovFsJ4KzCB1+lRm0ePW7dQAQgO70oOxUJcSDumXZmF7f5nO+9a
 /BHA==
X-Gm-Message-State: AOAM532rl8kNcVl8ktlEDpl3NYnLwghkyEL6bNqYBTfRhnygjKMTwS6T
 a4JCK8tsnYfmMslz+/dppTXN9vyQ
X-Google-Smtp-Source: ABdhPJzgf0C3yTbFuSTvD554e9BXkOfKD03kHb4j+MINNfVSbWIbVCbhZ7gnxiW7GoTBs7Zj4A4F+w==
X-Received: by 2002:a9d:444:: with SMTP id 62mr3803610otc.272.1589583161358;
 Fri, 15 May 2020 15:52:41 -0700 (PDT)
Received: from [192.168.2.42] (adsl-70-133-146-38.dsl.ablntx.sbcglobal.net.
 [70.133.146.38])
 by smtp.gmail.com with ESMTPSA id z12sm926016otk.11.2020.05.15.15.52.40
 for <bug-dejagnu@HIDDEN>
 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
 Fri, 15 May 2020 15:52:40 -0700 (PDT)
Message-ID: <5EBF1D36.9060606@HIDDEN>
Date: Fri, 15 May 2020 17:52:38 -0500
From: Jacob Bachmeyer <jcb62281@HIDDEN>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
 rv:1.8.1.22) Gecko/20090807 MultiZilla/1.8.3.4e SeaMonkey/1.1.17
 Mnenhy/0.7.6.0
MIME-Version: 1.0
To: bug-dejagnu@HIDDEN
Subject: Fix misuse of "target_info" in default_target_compile (with patch)
Content-Type: multipart/mixed; boundary="------------050606020802050506040307"
Received-SPF: pass client-ip=2607:f8b0:4864:20::32d;
 envelope-from=jcb62281@HIDDEN; helo=mail-ot1-x32d.google.com
X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache.
 That's all we know.
X-Spam_score_int: -15
X-Spam_score: -1.6
X-Spam_bar: -
X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,
 FREEMAIL_REPLYTO_END_DIGIT=0.25, RCVD_IN_DNSWL_NONE=-0.0001,
 SPF_PASS=-0.001 autolearn=_AUTOLEARN
X-Spam_action: no action
X-Spam-Score: 0.2 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Reply-To: jcb62281@HIDDEN
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.8 (-)

This is a multi-part message in MIME format.
--------------050606020802050506040307
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

This patch fixes an interesting bug in default_target_compile:  if the options set dest= prior to specifying a language, the language defaults are loaded incorrectly.  Specifically, for each board_info value, the *existence* of that value is tested for the board specified using dest=, but the actual value is
read from the information for the current target.  Since the current target is the default destination, the only reason to specify the dest= option is to override the current target, so this must be wrong and this patch fixes the bug.


--------------050606020802050506040307
Content-Type: text/plain;
 name="0008-Fix-misuse-of-target_info-in-default_target_compile.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename*0="0008-Fix-misuse-of-target_info-in-default_target_compile.pat";
 filename*1="ch"

From 9e163d9a322a4e5e452d4c610665ea3330de868b Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <jcb62281+dev@HIDDEN>
Date: Fri, 31 May 2019 18:16:08 -0500
Subject: [PATCH 8/9] Fix misuse of "target_info" in default_target_compile

*ChangeLog entry:
	* lib/target.exp (default_target_compile): Use the "board_info"
	procedure correctly when loading language defaults, instead of
	checking for each option under the $dest board, but reading the
	value using "target_info", which uses the current target instead
	of the target specified using the "dest=" option.
---
 lib/target.exp |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/lib/target.exp b/lib/target.exp
index a9ac83e..6a940af 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -337,10 +337,10 @@ proc default_target_compile {source destfile type options} {
 	if { $i eq "ada" } {
 	    set compiler_type "ada"
 	    if {[board_info $dest exists adaflags]} {
-		append add_flags " [target_info adaflags]"
+		append add_flags " [board_info $dest adaflags]"
 	    }
 	    if {[board_info $dest exists gnatmake]} {
-		set compiler [target_info gnatmake]
+		set compiler [board_info $dest gnatmake]
 	    } else {
 		set compiler [find_gnatmake]
 	    }
@@ -349,11 +349,11 @@ proc default_target_compile {source destfile type options} {
 	if { $i eq "c++" } {
 	    set compiler_type "c++"
 	    if {[board_info $dest exists cxxflags]} {
-		append add_flags " [target_info cxxflags]"
+		append add_flags " [board_info $dest cxxflags]"
 	    }
 	    append add_flags " [g++_include_flags]"
 	    if {[board_info $dest exists c++compiler]} {
-		set compiler [target_info c++compiler]
+		set compiler [board_info $dest c++compiler]
 	    } else {
 		set compiler [find_g++]
 	    }
@@ -362,10 +362,10 @@ proc default_target_compile {source destfile type options} {
 	if { $i eq "d" } {
 	    set compiler_type "d"
 	    if {[board_info $dest exists dflags]} {
-		append add_flags " [target_info dflags]"
+		append add_flags " [board_info $dest dflags]"
 	    }
 	    if {[board_info $dest exists dcompiler]} {
-		set compiler [target_info dcompiler]
+		set compiler [board_info $dest dcompiler]
 	    } else {
 		set compiler [find_gdc]
 	    }
@@ -374,10 +374,10 @@ proc default_target_compile {source destfile type options} {
 	if { $i eq "f77" } {
 	    set compiler_type "f77"
 	    if {[board_info $dest exists f77flags]} {
-		append add_flags " [target_info f77flags]"
+		append add_flags " [board_info $dest f77flags]"
 	    }
 	    if {[board_info $dest exists f77compiler]} {
-		set compiler [target_info f77compiler]
+		set compiler [board_info $dest f77compiler]
 	    } else {
 		set compiler [find_g77]
 	    }
@@ -386,10 +386,10 @@ proc default_target_compile {source destfile type options} {
 	if { $i eq "f90" } {
 	    set compiler_type "f90"
 	    if {[board_info $dest exists f90flags]} {
-		append add_flags " [target_info f90flags]"
+		append add_flags " [board_info $dest f90flags]"
 	    }
 	    if {[board_info $dest exists f90compiler]} {
-		set compiler [target_info f90compiler]
+		set compiler [board_info $dest f90compiler]
 	    } else {
 		set compiler [find_gfortran]
 	    }
-- 
1.7.4.1


--------------050606020802050506040307--




Acknowledgement sent to jcb62281@HIDDEN:
New bug report received and forwarded. Copy sent to bug-dejagnu@HIDDEN. Full text available.
Report forwarded to bug-dejagnu@HIDDEN:
bug#41296; Package dejagnu. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 26 May 2020 04:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.