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

Previous Next

Package: dejagnu;

Reported by: jcb62281 <at> gmail.com

Date: Fri, 15 May 2020 22:53:02 UTC

Severity: normal

Done: jcb62281 <at> gmail.com

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 41296 in the body.
You can then email your comments to 41296 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-dejagnu <at> gnu.org:
bug#41296; Package dejagnu. (Fri, 15 May 2020 22:53:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to jcb62281 <at> gmail.com:
New bug report received and forwarded. Copy sent to bug-dejagnu <at> gnu.org. (Fri, 15 May 2020 22:53:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jacob Bachmeyer <jcb62281 <at> gmail.com>
To: bug-dejagnu <at> gnu.org
Subject: Fix misuse of "target_info" in default_target_compile (with patch)
Date: Fri, 15 May 2020 17:52:38 -0500
[Message part 1 (text/plain, inline)]
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.

[0008-Fix-misuse-of-target_info-in-default_target_compile.patch (text/plain, inline)]
From 9e163d9a322a4e5e452d4c610665ea3330de868b Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <jcb62281+dev <at> gmail.com>
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


bug closed, send any further explanations to 41296 <at> debbugs.gnu.org and jcb62281 <at> gmail.com Request was from Jacob Bachmeyer <jcb62281 <at> gmail.com> to control <at> debbugs.gnu.org. (Tue, 26 May 2020 04:37:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 23 Jun 2020 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 306 days ago.

Previous Next


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