From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fencepost.gnu.org (fencepost.gnu.org [IPv6:2001:470:142:3::e]) by sourceware.org (Postfix) with ESMTPS id 1110D39450FB for ; Wed, 2 Sep 2020 15:30:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1110D39450FB Received: from eggs.gnu.org ([2001:470:142:3::10]:60088) by fencepost.gnu.org with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kDUig-0007zV-FT for gcc-patches@gnu.org; Wed, 02 Sep 2020 11:30:42 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:60606) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kDUie-0002jQ-Id; Wed, 02 Sep 2020 11:30:42 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 082FTpCh014061; Wed, 2 Sep 2020 15:30:38 GMT Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2120.oracle.com with ESMTP id 339dmn1rnu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 02 Sep 2020 15:30:37 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 082FQ1sS196270; Wed, 2 Sep 2020 15:30:37 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3030.oracle.com with ESMTP id 3380xyw0rp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 02 Sep 2020 15:30:37 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 082FUVbv024467; Wed, 2 Sep 2020 15:30:36 GMT Received: from termi.oracle.com (/10.175.48.72) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 02 Sep 2020 08:30:31 -0700 From: "Jose E. Marchesi" To: gcc-patches@gnu.org Cc: dejagnu@gnu.org Subject: dg-options after board/cflags Date: Wed, 02 Sep 2020 17:30:27 +0200 Message-ID: <87h7sg42ng.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9732 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 adultscore=0 phishscore=0 malwarescore=0 bulkscore=0 mlxscore=0 mlxlogscore=866 suspectscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009020147 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9732 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 phishscore=0 mlxlogscore=870 adultscore=0 impostorscore=0 mlxscore=0 suspectscore=1 spamscore=0 clxscore=1011 malwarescore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2009020147 Received-SPF: pass client-ip=156.151.31.85; envelope-from=jose.marchesi@oracle.com; helo=userp2120.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/02 11:30:38 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, SPF_HELO_NONE, SPF_PASS, TXREP, UNPARSEABLE_RELAY 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: , X-List-Received-Date: Wed, 02 Sep 2020 15:30:44 -0000 Hi people! While adding a bpf-sim.exp to dejagnu, I noticed that the flags in board/cflags were included in the final compilation line _after_ the flags in the test's dg-options. Since the test options are more particular than the board options, I would expect them to be placed after any board-defined flags, so I prepared the patch below for dejagnu, which does the right thing for the gcc.target/bpf testsuite. However: 1. There could be tests around that depend (erroneously) on some of their dg-options to not have effect (or a different effect) because they are annulled (or modified) by some flag in a board file. 2. This could also impact other programs using dejagnu. How do you people recommend to proceed? Should we fix dejagnu and then fix buggy tests? Or the other way around? :-) diff --git a/lib/target.exp b/lib/target.exp index 36ae639..f0bfe20 100644 --- a/lib/target.exp +++ b/lib/target.exp @@ -455,7 +455,7 @@ proc default_target_compile {source destfile type options} { } if {[regexp "^additional_flags=" $i]} { regsub "^additional_flags=" $i "" tmp - append add_flags " $tmp" + append additional_flags " $tmp" } if {[regexp "^ldflags=" $i]} { regsub "^ldflags=" $i "" tmp @@ -703,6 +703,8 @@ proc default_target_compile {source destfile type options} { } } + append add_flags " $additional_flags" + verbose "doing compile" set sources "" @@ -728,7 +730,7 @@ proc default_target_compile {source destfile type options} { append add_flags " -o $destfile" } } - + # This is obscure: we put SOURCES at the end when building an # object, because otherwise, in some situations, libtool will # become confused about the name of the actual source file.