From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12897 invoked by alias); 18 Dec 2001 13:59:11 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 12853 invoked from network); 18 Dec 2001 13:59:10 -0000 Received: from unknown (HELO cygnus.com) (205.180.230.5) by sources.redhat.com with SMTP; 18 Dec 2001 13:59:10 -0000 Received: from cygbert.vinschen.de (cse.cygnus.com [205.180.230.236]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id FAA17753; Tue, 18 Dec 2001 05:59:06 -0800 (PST) Received: (from corinna@localhost) by cygbert.vinschen.de (8.9.3/8.9.3/Linux sendmail 8.9.3) id OAA27443; Tue, 18 Dec 2001 14:58:13 +0100 Date: Tue, 18 Dec 2001 05:59:00 -0000 From: Corinna Vinschen To: gdb , gdb-patches Subject: [RFC]: Use `gdb_compile' instead of `target_link' for linking asm-source testcase Message-ID: <20011218145813.Y21898@cygbert.vinschen.de> Mail-Followup-To: gdb , gdb-patches Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i X-SW-Source: 2001-12/txt/msg00440.txt.bz2 Hi, I would like to propose a change in the asm testcase in testsuite/gdb.asm. The target_link should get substituted by a call to gdb_compile using the `-nostartfiles' option for the following reason. Some (many?) targets have to support several different variants as, e.g., coff or elf exec format, simulated or real HW targets, etc. Each of these styles need a slightly different handling. E.g. some embedded boards need a special link flag while another board using the same CPU need another link flag while the simulated target needs again another flag (-Tfoo.ld, -Tfoo-bar.ld, -Tfoo-sim.ld, ...) While the gcc flags for these variants are typically correctly setup in the external board files, we can't rely on these flags correctly set up for a direct call to the linker, resulting in an increasingly messy target depended prologue in asm-source.exp as new targets support that test. Therefore I'm proposing to change the call to target_link in this testcase as soon as possible to a call to gdb_compile with the gcc flag `-nostartfiles' set, which result in the same testcase but w/o the need to care for each single flag needed for our targets. The patch itself is easy. If it's really necessary, a target could still add link-flags but e.g. for the XStormy16 target I could even drop that setting. It's superfluous now since the board description files already care for the correct settings. The below patch would do it (including dropping the XScale link-flags setting. Corinna 2001-12-18 Corinna Vinschen * gdb.asm/asm-source.exp: Drop setting link-flags for xstormy16. Substitute call to target_link by call to gdb_compile. Index: gdb.asm/asm-source.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.asm/asm-source.exp,v retrieving revision 1.14 diff -u -p -r1.14 asm-source.exp --- asm-source.exp 2001/12/13 13:42:19 1.14 +++ asm-source.exp 2001/12/18 13:58:18 @@ -53,7 +53,6 @@ if [istarget "sparc-*-*"] then { if [istarget "xstormy16-*-*"] then { set asm-arch xstormy16 set asm-flags "-gdwarf2 -I${srcdir}/${subdir} -I${objdir}/${subdir}" - set link-flags "-L${objdir}/../../gcc" } if { "${asm-arch}" == "" } { gdb_suppress_entire_file "Assembly source test -- not implemented for this target." @@ -76,7 +75,11 @@ if {[target_assemble ${src2} asmsrc2.o " gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } -if { [target_link "asmsrc1.o asmsrc2.o" ${binfile} "${link-flags}"] != "" } { +set opts "debug ldflags=-nostartfiles" +foreach i ${link-flags} { + append opts " ldflags=$i" +} +if { [gdb_compile "asmsrc1.o asmsrc2.o" "${binfile}" executable $opts] != "" } { gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." } -- Corinna Vinschen Cygwin Developer Red Hat, Inc. mailto:vinschen@redhat.com