From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13037 invoked by alias); 24 Mar 2011 03:28:13 -0000 Received: (qmail 13025 invoked by uid 22791); 24 Mar 2011 03:28:12 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-fx0-f41.google.com (HELO mail-fx0-f41.google.com) (209.85.161.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Mar 2011 03:28:07 +0000 Received: by fxm18 with SMTP id 18so9326416fxm.0 for ; Wed, 23 Mar 2011 20:28:06 -0700 (PDT) Received: by 10.223.26.205 with SMTP id f13mr692413fac.49.1300937286053; Wed, 23 Mar 2011 20:28:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.5.15 with HTTP; Wed, 23 Mar 2011 20:27:46 -0700 (PDT) In-Reply-To: <20110323164236.GA21315@adacore.com> References: <1300057848-2316-1-git-send-email-vapier@gentoo.org> <1300136769-5921-1-git-send-email-vapier@gentoo.org> <20110323164236.GA21315@adacore.com> From: Mike Frysinger Date: Thu, 24 Mar 2011 05:38:00 -0000 Message-ID: Subject: Re: [PATCH] sim: tests: support .S/.c files To: Joel Brobecker Cc: gdb-patches@sourceware.org, toolchain-devel@blackfin.uclinux.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-03/txt/msg01059.txt.bz2 On Wed, Mar 23, 2011 at 12:42 PM, Joel Brobecker wrote: >> - =A0 =A0 set comp_output [target_assemble $sourcefile ${name}.o "$as_op= tions $global_as_options"] >> - >> - =A0 =A0 if ![string match "" $comp_output] { >> - =A0 =A0 =A0 =A0 verbose -log "$comp_output" 3 >> - =A0 =A0 =A0 =A0 fail "$mach $testname (assembling)" >> - =A0 =A0 =A0 =A0 continue >> - =A0 =A0 } >> + =A0 =A0 regsub {(^ *| +)([^ ]+)} "$as_options $global_as_options" { -W= a,\2} c_as_options >> >> =A0 =A0 =A0 if ![info exists opts(ld,$mach)] { >> =A0 =A0 =A0 =A0 =A0 set opts(ld,$mach) $opts(ld) >> =A0 =A0 =A0 } >> + =A0 =A0 regsub {(^ *| +)([^ ]+)} "$opts(ld,$mach) $global_ld_options" = { -Wl,\2} c_ld_options >> + >> + =A0 =A0 if ![info exists opts(cc,$mach)] { >> + =A0 =A0 =A0 =A0 set opts(cc,$mach) $opts(cc) >> + =A0 =A0 } >> + >> + =A0 =A0 if [string match "*.c" $sourcefile] { >> + =A0 =A0 =A0 =A0 set comp_output [target_compile $sourcefile ${name}.x = "executable" \ >> + =A0 =A0 =A0 =A0 =A0 =A0 [list "incdir=3D$srcdir/$subdir" "additional_f= lags=3D$c_as_options $c_ld_options $opts(cc,$mach) $global_cc_options"]] >> + =A0 =A0 =A0 =A0 set method "compiling/linking" >> + =A0 =A0 } else { >> + =A0 =A0 =A0 =A0 if [string match "*.S" $sourcefile] { >> + =A0 =A0 =A0 =A0 =A0 =A0 set comp_output [target_compile $sourcefile ${= name}.o "object" \ >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 [list "incdir=3D$srcdir/$subdir" "addi= tional_flags=3D$c_as_options"]] >> + =A0 =A0 =A0 =A0 =A0 =A0 set method "compiling" >> + =A0 =A0 =A0 =A0 } else { >> + =A0 =A0 =A0 =A0 =A0 =A0 set comp_output [target_assemble $sourcefile $= {name}.o "$as_options $global_as_options"] >> + =A0 =A0 =A0 =A0 =A0 =A0 set method "assembling" >> + =A0 =A0 =A0 =A0 } >> + >> + =A0 =A0 =A0 =A0 if ![string match "" $comp_output] { >> + =A0 =A0 =A0 =A0 =A0 =A0 verbose -log "$comp_output" 3 >> + =A0 =A0 =A0 =A0 =A0 =A0 fail "$mach $testname (${method})" >> + =A0 =A0 =A0 =A0 =A0 =A0 continue >> + =A0 =A0 =A0 =A0 } > > It looks like you are not checking the output from the compilation > of .c files, while you kept that check for all other files. Is that > intentional? mmm, that's not the case after all. if you look at the wider context, the .c statement will fall down to the *next* comp_output branch. old code was basically: - assemble - check - link - check new code is: if (*.c) { - compile & link } else { if (*.S) { - compile } else { - assemble } - check - link } -check so that intended check isnt "removed" from the .c step, it's simply made obsolete because the compiler driver (i.e. gcc) is allowed to compile/link in one shot. -mike