From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9178 invoked by alias); 29 Jun 2011 14:44:15 -0000 Received: (qmail 9166 invoked by uid 22791); 29 Jun 2011 14:44:12 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Jun 2011 14:43:55 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5TEhqBU024652 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 29 Jun 2011 10:43:52 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p5TEhq2p001904; Wed, 29 Jun 2011 10:43:52 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p5TEhoQf026465; Wed, 29 Jun 2011 10:43:51 -0400 From: Tom Tromey To: "H.J. Lu" Cc: GDB Subject: Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran References: <20100920135856.GA27953@intel.com> Date: Wed, 29 Jun 2011 14:44:00 -0000 In-Reply-To: (H. J. Lu's message of "Tue, 28 Jun 2011 12:55:55 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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-06/txt/msg00447.txt.bz2 Tom> I sent a patch to dejagnu to allow f90 today; so perhaps the result Tom> could be based on that. =C2=A0I can do the work if you like, just let = me Tom> know. H.J.> Please do. Here is what I am checking in. This moves the copied code to a new file, future.exp, and arranges to always load it. I refreshed one copied proc from dejagnu, with my gfortran patch included. I also changed how the overrides are installed. Tom 2011-06-29 Tom Tromey PR testsuite/12040: * lib/future.exp: New file, mostly extracted from ada.exp. Rewrote compatibility code to use rename. (gdb_find_gfortran): New proc. (gdb_default_target_compile): Refresh from dejagnu; plus a pending gfortran patch. * lib/ada.exp (gdb_find_gnatmake, gdb_default_target_compile): Move to future.exp. * lib/gdb.exp: Always load future.exp. diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp index fd194eb..0872277 100644 --- a/gdb/testsuite/lib/ada.exp +++ b/gdb/testsuite/lib/ada.exp @@ -13,396 +13,6 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . =20 -load_lib libgloss.exp - -# FIXME:brobecker/2004-03-31: -# The following function should eventually be part of dejagnu. Even after -# this function becomes available in dejagnu, we will keep for a while -# a copy of this function here in order to avoid increasing the dejagnu -# version requirement. - -proc gdb_find_gnatmake {} { - global tool_root_dir - - set root "$tool_root_dir/gcc" - set GM "" - - if ![is_remote host] { - set file [lookfor_file $root gnatmake] - if { $file !=3D "" } { - set GM "$file -I$root/ada/rts --GCC=3D$root/xgcc --GNATBIND=3D= $root/gnatbind --GNATLINK=3D$root/gnatlink -cargs -B$root -largs --GCC=3D$r= oot/xgcc -margs"; - }=20=20=20 - } - - if {$GM =3D=3D ""} { - set GM [transform gnatmake] - } - - return $GM -}=20=20=20 - -# FIXME:brobecker/2004-03-31: -# The following function is a copy of the function of the same name provid= ed -# by dejagnu, except that it has been modified to add support for building -# Ada programs. This copy is temporarily placed here until the changes -# are merged into the dejagnu official release. Once the changes are merge= d, -# we will likely keep this local copy for a while to avoid increasing the -# dejagnu version requirement. - -proc gdb_default_target_compile {source destfile type options} { - global target_triplet - global tool_root_dir - global CFLAGS_FOR_TARGET - global compiler_flags - - if { $destfile =3D=3D "" && $type !=3D "preprocess" && $type !=3D "non= e" } { - error "Must supply an output filename for the compile to default_target_c= ompile" - } - - set add_flags "" - set libs "" - set compiler_type "c" - set compiler "" - set ldflags "" - set dest [target_info name] - - if [info exists CFLAGS_FOR_TARGET] { - append add_flags " $CFLAGS_FOR_TARGET" - } - - if [info exists target_info(host,name)] { - set host [host_info name]; - } else { - set host "unix"; - } - - foreach i $options { - if { $i =3D=3D "ada" } { - set compiler_type "ada" - if [board_info $dest exists adaflags] { - append add_flags " [target_info adaflags]" - } - # append add_flags " [gnatmake_include_flags]"; - if [board_info $dest exists gnatmake] { - set compiler [target_info gnatmake]; - } else { - set compiler [find_gnatmake]; - } - } - - if { $i =3D=3D "c++" } { - set compiler_type "c++" - if [board_info $dest exists cxxflags] { - append add_flags " [target_info cxxflags]" - } - append add_flags " [g++_include_flags]"; - if [board_info $dest exists c++compiler] { - set compiler [target_info c++compiler]; - } else { - set compiler [find_g++]; - } - } - - if { $i =3D=3D "f77" } { - set compiler_type "f77" - if [board_info $dest exists f77flags] { - append add_flags " [target_info f77flags]" - } -# append add_flags " [f77_include_flags]" - if [board_info $dest exists f77compiler] { - set compiler [target_info f77compiler] - } else { - set compiler [find_g77] - } - } - - if [regexp "^dest=3D" $i] { - regsub "^dest=3D" $i "" tmp - if [board_info $tmp exists name] { - set dest [board_info $tmp name]; - } else { - set dest $tmp; - } - } - if [regexp "^compiler=3D" $i] { - regsub "^compiler=3D" $i "" tmp - set compiler $tmp - } - if [regexp "^additional_flags=3D" $i] { - regsub "^additional_flags=3D" $i "" tmp - append add_flags " $tmp" - } - if [regexp "^ldflags=3D" $i] { - regsub "^ldflags=3D" $i "" tmp - append ldflags " $tmp" - } - if [regexp "^libs=3D" $i] { - regsub "^libs=3D" $i "" tmp - append libs " $tmp" - } - if [regexp "^incdir=3D" $i] { - regsub "^incdir=3D" $i "-I" tmp - append add_flags " $tmp" - } - if [regexp "^libdir=3D" $i] { - regsub "^libdir=3D" $i "-L" tmp - append add_flags " $tmp" - } - if [regexp "^ldscript=3D" $i] { - regsub "^ldscript=3D" $i "" ldscript - } - if [regexp "^redirect=3D" $i] { - regsub "^redirect=3D" $i "" redirect - } - if [regexp "^optimize=3D" $i] { - regsub "^optimize=3D" $i "" optimize - } - if [regexp "^timeout=3D" $i] { - regsub "^timeout=3D" $i "" timeout - } - } - - if [board_info $host exists cflags_for_target] { - append add_flags " [board_info $host cflags_for_target]"; - } - - global CC_FOR_TARGET - global CXX_FOR_TARGET - global F77_FOR_TARGET - global GNATMAKE_FOR_TARGET -=20=20=20=20 - if [info exists CC_FOR_TARGET] { - if { $compiler =3D=3D "" } { - set compiler $CC_FOR_TARGET - } - } - - if [info exists CXX_FOR_TARGET] { - if { $compiler_type =3D=3D "c++" } { - set compiler $CXX_FOR_TARGET - } - } - - if [info exists F77_FOR_TARGET] { - if { $compiler_type =3D=3D "f77" } { - set compiler $F77_FOR_TARGET - } - } - - if [info exists GNATMAKE_FOR_TARGET] { - if { $compiler_type =3D=3D "ada" } { - set compiler $GNATMAKE_FOR_TARGET - } - } - - if { $compiler =3D=3D "" } { - set compiler [board_info $dest compiler]; - if { $compiler =3D=3D "" } { - return "default_target_compile: No compiler to compile with"; - } - } - - if ![is_remote host] { - if { [which $compiler] =3D=3D 0 } { - return "default_target_compile: Can't find $compiler." - } - } - - if {$type =3D=3D "object"} { - append add_flags " -c" - } - - if { $type =3D=3D "preprocess" } { - append add_flags " -E" - } -=20=20=20=20 - if { $type =3D=3D "assembly" } { - append add_flags " -S" - } - - if [board_info $dest exists cflags] { - append add_flags " [board_info $dest cflags]" - } - - if { $type =3D=3D "executable" } { - # This must be added here. - # if [board_info $dest exists ldscript] { - # append add_flags " [board_info $dest ldscript]" - # } - - if [board_info $dest exists ldflags] { - append add_flags " [board_info $dest ldflags]" - } - if { $compiler_type =3D=3D "c++" } { - append add_flags " [g++_link_flags]"; - } - if [isnative] { - # This is a lose. - catch "glob -nocomplain $tool_root_dir/libstdc++/libstdc++.so* $tool_= root_dir/libstdc++/libstdc++.sl" tmp - if { ${tmp} !=3D "" } { - if [regexp ".*solaris2.*" $target_triplet] { - # Solaris 2 - append add_flags " -R$tool_root_dir/libstdc++" - } elseif [regexp ".*(osf|irix5|linux).*" $target_triplet] { - # OSF/1 or Irix5 - append add_flags " -Wl,-rpath,$tool_root_dir/libstdc++" - } elseif [regexp ".*hppa.*" $target_triplet] { - # HP/UX - append add_flags " -Wl,-a,shared_archive" - } - } - } - } - - if ![info exists ldscript] { - set ldscript [board_info $dest ldscript] - } - - foreach i $options { - if { $i =3D=3D "debug" } { - if [board_info $dest exists debug_flags] { - append add_flags " [board_info $dest debug_flags]"; - } else { - append add_flags " -g" - } - } - } - - if [info exists optimize] { - append add_flags " $optimize"; - } - - if { $type =3D=3D "executable" } { - append add_flags " $ldflags" - foreach x $libs { - if [file exists $x] { - append source " $x" - } else { - append add_flags " $x"; - } - } - - if [board_info $dest exists libs] { - append add_flags " [board_info $dest libs]" - } - - # This probably isn't such a good idea, but it avoids nasty - # hackiness in the testsuites. - # The math library must be linked in before the C library. The C - # library is linked in by the linker script, so this must be before - # the linker script. - if [board_info $dest exists mathlib] { - append add_flags " [board_info $dest mathlib]" - } else { - append add_flags " -lm" - } - - # This must be added here. - append add_flags " $ldscript"; - - if [board_info $dest exists remote_link] { - # Relink option. - append add_flags " -Wl,-r" - } - if [board_info $dest exists output_format] { - append add_flags " -Wl,-oformat,[board_info $dest output_format]"; - } - } - - if [board_info $dest exists multilib_flags] { - append add_flags " [board_info $dest multilib_flags]"; - } - - verbose "doing compile" - - set sources "" - if [is_remote host] { - foreach x $source { - set file [remote_download host $x]; - if { $file =3D=3D "" } { - warning "Unable to download $x to host." - return "Unable to download $x to host." - } else { - append sources " $file"; - } - } - } else { - set sources $source - } - - if [is_remote host] { - append add_flags " -o a.out" - remote_file host delete a.out; - } else { - if { $destfile !=3D "" } { - 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. - if {$type =3D=3D "object"} { - set opts "$add_flags $sources" - } else { - set opts "$sources $add_flags" - } - - if [is_remote host] { - if [host_info exists use_at] { - set fid [open "atfile" "w"]; - puts $fid "$opts"; - close $fid; - set opts "@[remote_download host atfile]" - remote_file build delete atfile - } - } - - verbose "Invoking the compiler as $compiler $opts" 2 - - if [info exists redirect] { - verbose "Redirecting output to $redirect" 2 - set status [remote_exec host "$compiler $opts" "" "" $redirect]; - } else { - if [info exists timeout] { - verbose "Setting timeout to $timeout" 2 - set status [remote_exec host "$compiler $opts" "" "" "" $timeout]; - } else { - set status [remote_exec host "$compiler $opts"]; - } - } - - set compiler_flags $opts - if [is_remote host] { - remote_upload host a.out $destfile; - remote_file host delete a.out; - } - set comp_output [prune_warnings [lindex $status 1]]; - regsub "^\[\r\n\]+" $comp_output "" comp_output; - if { [lindex $status 0] !=3D 0 } { - verbose -log "compiler exited with status [lindex $status 0]"; - } - if { [lindex $status 1] !=3D "" } { - verbose -log "output is:\n[lindex $status 1]" 2; - } - if { [lindex $status 0] !=3D 0 && "${comp_output}" =3D=3D "" } { - set comp_output "exit status is [lindex $status 0]"; - } - return ${comp_output}; -} - -# See if the version of dejaGNU being used to run the testsuite is -# recent enough to contain support for building Ada programs or not. -# If not, then use the functions above in place of the ones provided -# by dejaGNU. This is only temporary (brobecker/2004-03-31). - -if {[info procs find_gnatmake] =3D=3D ""} { - proc find_gnatmake { } { return [gdb_find_gnatmake] } - proc default_target_compile { source destfile type options } { - return [gdb_default_target_compile $source $destfile $type $options] - } -} - # Compile some Ada code. =20 proc gdb_compile_ada {source dest type options} { diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp new file mode 100644 index 0000000..c95860d --- /dev/null +++ b/gdb/testsuite/lib/future.exp @@ -0,0 +1,437 @@ +# Copyright 2004, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, I= nc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +load_lib libgloss.exp + +# FIXME:brobecker/2004-03-31: +# The following functions should eventually be part of dejagnu. Even after +# these functions becomes available in dejagnu, we will keep for a while +# a copy here in order to avoid increasing the dejagnu version +# requirement. + +proc gdb_find_gnatmake {} { + global tool_root_dir + + set root "$tool_root_dir/gcc" + set GM "" + + if ![is_remote host] { + set file [lookfor_file $root gnatmake] + if { $file !=3D "" } { + set GM "$file -I$root/ada/rts --GCC=3D$root/xgcc --GNATBIND=3D= $root/gnatbind --GNATLINK=3D$root/gnatlink -cargs -B$root -largs --GCC=3D$r= oot/xgcc -margs"; + }=20=20=20 + } + + if {$GM =3D=3D ""} { + set GM [transform gnatmake] + } + + return $GM +}=20=20=20 + +proc gdb_find_gfortran {} { + global tool_root_dir + + if {![is_remote host]} { + set file [lookfor_file $tool_root_dir gfortran] + if { $file =3D=3D "" } { + set file [lookfor_file $tool_root_dir gcc/gfortran] + } + if { $file !=3D "" } { + set CC "$file -B[file dirname $file]/" + } else { + set CC [transform gfortran] + } + } else { + set CC [transform gfortran] + } + return $CC +} + +proc gdb_default_target_compile {source destfile type options} { + global target_triplet + global tool_root_dir + global CFLAGS_FOR_TARGET + global compiler_flags + + if { $destfile =3D=3D "" && $type !=3D "preprocess" && $type !=3D "non= e" } { + error "Must supply an output filename for the compile to default_target_c= ompile" + } + + set add_flags "" + set libs "" + set compiler_type "c" + set compiler "" + set ldflags "" + set dest [target_info name] + + if {[info exists CFLAGS_FOR_TARGET]} { + append add_flags " $CFLAGS_FOR_TARGET" + } + + if {[info exists target_info(host,name)]} { + set host [host_info name] + } else { + set host "unix" + } + + foreach i $options { + + if { $i =3D=3D "ada" } { + set compiler_type "ada" + if {[board_info $dest exists adaflags]} { + append add_flags " [target_info adaflags]" + } + if {[board_info $dest exists gnatmake]} { + set compiler [target_info gnatmake] + } else { + set compiler [find_gnatmake] + } + } + + if { $i =3D=3D "c++" } { + set compiler_type "c++" + if {[board_info $dest exists cxxflags]} { + append add_flags " [target_info cxxflags]" + } + append add_flags " [g++_include_flags]" + if {[board_info $dest exists c++compiler]} { + set compiler [target_info c++compiler] + } else { + set compiler [find_g++] + } + } + + if { $i =3D=3D "f77" } { + set compiler_type "f77" + if {[board_info $dest exists f77flags]} { + append add_flags " [target_info f77flags]" + } + if {[board_info $dest exists f77compiler]} { + set compiler [target_info f77compiler] + } else { + set compiler [find_g77] + } + } + + if { $i =3D=3D "f90" } { + set compiler_type "f90" + if {[board_info $dest exists f90flags]} { + append add_flags " [target_info f90flags]" + } + if {[board_info $dest exists f90compiler]} { + set compiler [target_info f90compiler] + } else { + set compiler [find_gfortran] + } + } + + if {[regexp "^dest=3D" $i]} { + regsub "^dest=3D" $i "" tmp + if {[board_info $tmp exists name]} { + set dest [board_info $tmp name] + } else { + set dest $tmp + } + } + if {[regexp "^compiler=3D" $i]} { + regsub "^compiler=3D" $i "" tmp + set compiler $tmp + } + if {[regexp "^additional_flags=3D" $i]} { + regsub "^additional_flags=3D" $i "" tmp + append add_flags " $tmp" + } + if {[regexp "^ldflags=3D" $i]} { + regsub "^ldflags=3D" $i "" tmp + append ldflags " $tmp" + } + if {[regexp "^libs=3D" $i]} { + regsub "^libs=3D" $i "" tmp + append libs " $tmp" + } + if {[regexp "^incdir=3D" $i]} { + regsub "^incdir=3D" $i "-I" tmp + append add_flags " $tmp" + } + if {[regexp "^libdir=3D" $i]} { + regsub "^libdir=3D" $i "-L" tmp + append add_flags " $tmp" + } + if {[regexp "^ldscript=3D" $i]} { + regsub "^ldscript=3D" $i "" ldscript + } + if {[regexp "^redirect=3D" $i]} { + regsub "^redirect=3D" $i "" redirect + } + if {[regexp "^optimize=3D" $i]} { + regsub "^optimize=3D" $i "" optimize + } + if {[regexp "^timeout=3D" $i]} { + regsub "^timeout=3D" $i "" timeout + } + } + + if {[board_info $host exists cflags_for_target]} { + append add_flags " [board_info $host cflags_for_target]" + } + + global CC_FOR_TARGET + global CXX_FOR_TARGET + global F77_FOR_TARGET + global F90_FOR_TARGET + global GNATMAKE_FOR_TARGET + + if {[info exists GNATMAKE_FOR_TARGET]} { + if { $compiler_type =3D=3D "ada" } { + set compiler $GNATMAKE_FOR_TARGET + } + } + + if {[info exists CC_FOR_TARGET]} { + if { $compiler =3D=3D "" } { + set compiler $CC_FOR_TARGET + } + } + + if {[info exists CXX_FOR_TARGET]} { + if { $compiler_type =3D=3D "c++" } { + set compiler $CXX_FOR_TARGET + } + } + + if {[info exists F77_FOR_TARGET]} { + if { $compiler_type =3D=3D "f77" } { + set compiler $F77_FOR_TARGET + } + } + + if {[info exists F90_FOR_TARGET]} { + if { $compiler_type =3D=3D "f90" } { + set compiler $F90_FOR_TARGET + } + } + + if { $compiler =3D=3D "" } { + set compiler [board_info $dest compiler] + if { $compiler =3D=3D "" } { + return "default_target_compile: No compiler to compile with" + } + } + + if {![is_remote host]} { + if { [which $compiler] =3D=3D 0 } { + return "default_target_compile: Can't find $compiler." + } + } + + if {$type =3D=3D "object"} { + append add_flags " -c" + } + + if { $type =3D=3D "preprocess" } { + append add_flags " -E" + } + + if { $type =3D=3D "assembly" } { + append add_flags " -S" + } + + if {[board_info $dest exists cflags]} { + append add_flags " [board_info $dest cflags]" + } + + if { $type =3D=3D "executable" } { + if {[board_info $dest exists ldflags]} { + append add_flags " [board_info $dest ldflags]" + } + if { $compiler_type =3D=3D "c++" } { + append add_flags " [g++_link_flags]" + } + if {[isnative]} { + # This is a lose. + catch "glob -nocomplain $tool_root_dir/libstdc++/libstdc++.so* $tool_= root_dir/libstdc++/libstdc++.sl" tmp + if { ${tmp} !=3D "" } { + if {[regexp ".*solaris2.*" $target_triplet]} { + # Solaris 2 + append add_flags " -R$tool_root_dir/libstdc++" + } elseif {[regexp ".*(osf|irix5|linux).*" $target_triplet]} { + # OSF/1 or IRIX 5 + append add_flags " -Wl,-rpath,$tool_root_dir/libstdc++" + } elseif {[regexp ".*hppa.*" $target_triplet]} { + # HP-UX + append add_flags " -Wl,-a,shared_archive" + } + } + } + } + + if {![info exists ldscript]} { + set ldscript [board_info $dest ldscript] + } + + foreach i $options { + if { $i =3D=3D "debug" } { + if {[board_info $dest exists debug_flags]} { + append add_flags " [board_info $dest debug_flags]" + } else { + append add_flags " -g" + } + } + } + + if {[info exists optimize]} { + append add_flags " $optimize" + } + + if { $type =3D=3D "executable" } { + append add_flags " $ldflags" + foreach x $libs { + if {[file exists $x]} { + append source " $x" + } else { + append add_flags " $x" + } + } + + if {[board_info $dest exists libs]} { + append add_flags " [board_info $dest libs]" + } + + # This probably isn't such a good idea, but it avoids nasty + # hackiness in the testsuites. + # The math library must be linked in before the C library. The C + # library is linked in by the linker script, so this must be before + # the linker script. + if {[board_info $dest exists mathlib]} { + append add_flags " [board_info $dest mathlib]" + } else { + append add_flags " -lm" + } + + # This must be added here. + append add_flags " $ldscript" + + if {[board_info $dest exists remote_link]} { + # Relink option. + append add_flags " -Wl,-r" + } + if {[board_info $dest exists output_format]} { + append add_flags " -Wl,-oformat,[board_info $dest output_format]" + } + } + + if {[board_info $dest exists multilib_flags]} { + append add_flags " [board_info $dest multilib_flags]" + } + + verbose "doing compile" + + set sources "" + if {[is_remote host]} { + foreach x $source { + set file [remote_download host $x] + if { $file =3D=3D "" } { + warning "Unable to download $x to host." + return "Unable to download $x to host." + } else { + append sources " $file" + } + } + } else { + set sources $source + } + + if {[is_remote host]} { + append add_flags " -o a.out" + remote_file host delete a.out + } else { + if { $destfile !=3D "" } { + 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. + if {$type =3D=3D "object"} { + set opts "$add_flags $sources" + } else { + set opts "$sources $add_flags" + } + + if {[is_remote host]} { + if {[host_info exists use_at]} { + set fid [open "atfile" "w"] + puts $fid "$opts" + close $fid + set opts "@[remote_download host atfile]" + remote_file build delete atfile + } + } + + verbose "Invoking the compiler as $compiler $opts" 2 + + if {[info exists redirect]} { + verbose "Redirecting output to $redirect" 2 + set status [remote_exec host "$compiler $opts" "" "" $redirect] + } else { + if {[info exists timeout]} { + verbose "Setting timeout to $timeout" 2 + set status [remote_exec host "$compiler $opts" "" "" "" $timeout] + } else { + set status [remote_exec host "$compiler $opts"] + } + } + + set compiler_flags $opts + if {[is_remote host]} { + remote_upload host a.out $destfile + remote_file host delete a.out + } + set comp_output [prune_warnings [lindex $status 1]] + regsub "^\[\r\n\]+" $comp_output "" comp_output + if { [lindex $status 0] !=3D 0 } { + verbose -log "compiler exited with status [lindex $status 0]" + } + if { [lindex $status 1] !=3D "" } { + verbose -log "output is:\n[lindex $status 1]" 2 + } + if { [lindex $status 0] !=3D 0 && "${comp_output}" =3D=3D "" } { + set comp_output "exit status is [lindex $status 0]" + } + return ${comp_output} +} + +# See if the version of dejaGNU being used to run the testsuite is +# recent enough to contain support for building Ada programs or not. +# If not, then use the functions above in place of the ones provided +# by dejaGNU. This is only temporary (brobecker/2004-03-31). + +set use_gdb_compile 0 +if {[info procs find_gnatmake] =3D=3D ""} { + rename gdb_find_gnatmake find_gnatmake + set use_gdb_compile 1 +} + +if {[info procs find_gfortran] =3D=3D ""} { + rename gdb_find_gfortran find_gfortran + set use_gdb_compile 1 +} + +if {$use_gdb_compile} { + catch {rename default_target_compile {}} + rename gdb_default_target_compile default_target_compile +} diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index f465398..dc16cfa 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3735,3 +3735,5 @@ proc gdb_target_symbol_prefix_flags {} { } } =20 +# Always load compatibility stuff. +load_lib future.exp