GNU bug report logs - #41295
Fix access to target_info global in default_target_compile (with patch)

Previous Next

Package: dejagnu;

Reported by: jcb62281 <at> gmail.com

Date: Fri, 15 May 2020 22:52:01 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 41295 in the body.
You can then email your comments to 41295 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#41295; Package dejagnu. (Fri, 15 May 2020 22:52:01 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:52:01 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 access to target_info global in default_target_compile (with
 patch)
Date: Fri, 15 May 2020 17:51:15 -0500
[Message part 1 (text/plain, inline)]
This bug was uncovered while developing tests for default_target_compile.  The procedure attempts to determine if a host is set using [info exists target_info(host,name)], but does not use the global target_info.  As a result, the configuration for "unix" is used unconditionally.  This is clearly a bug.

The only potential impact of this patch is that the cflags_for_target board_info parameter will now be correctly retrieved from the host board configuration instead of always from the "unix" board configuration.  It is clear that this was the intent of the original code and doubtful that any testsuites are depending on the current broken behavior.  (If anyone is working around this bug, we should have received complaints about default_target_compile ignoring the selected host.  Had such complaints been received, this bug would have been fixed long ago, therefore no tests will be broken by this patch.  I suspect that nearly all current use of DejaGnu is on "unix" hosts, thus camouflaging this bug very effectively.)

[0003-Fix-access-to-target_info-global-in-default_target_c.patch (text/plain, inline)]
From 7cb6a9fcd198d11c5f969d867d24a17b47d3cdf4 Mon Sep 17 00:00:00 2001
From: Jacob Bachmeyer <jcb62281+dev <at> gmail.com>
Date: Fri, 17 May 2019 17:53:54 -0500
Subject: [PATCH 3/9] Fix access to target_info global in default_target_compile

*ChangeLog entry:
	* lib/target.exp (default_target_compile): Use "host_info"
	procedure to probe for a host configuration, instead of checking a
	local empty target_info array due to lacking "global target_info".
---
 lib/target.exp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/target.exp b/lib/target.exp
index 2620e30..9cc262d 100644
--- a/lib/target.exp
+++ b/lib/target.exp
@@ -326,7 +326,7 @@ proc default_target_compile {source destfile type options} {
 	append ldflags " $LDFLAGS_FOR_TARGET"
     }
 
-    if {[info exists target_info(host,name)]} {
+    if {[host_info exists]} {
 	set host [host_info name]
     } else {
 	set host "unix"
-- 
1.7.4.1


bug closed, send any further explanations to 41295 <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 304 days ago.

Previous Next


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