public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
@ 2010-09-21 18:24 H.J. Lu
  2011-06-28 19:35 ` Tom Tromey
  0 siblings, 1 reply; 17+ messages in thread
From: H.J. Lu @ 2010-09-21 18:24 UTC (permalink / raw)
  To: GDB

This isn't a proper fix since it depends on we load lib/ada.exp before
any Fortran tests.  I think ada.exp is the wrong place to provide
GDB functions.  It should be placed in something like gdb-support.exp and
ada.exp/fortran.exp can just load it.


H.J.
---
2010-09-20  H.J. Lu  <hongjiu.lu@intel.com>

	PR testsuite/12040
	* lib/ada.exp (gdb_find_gfortran): New.
	(gdb_default_target_compile): Use it.

diff --git a/gdb/testsuite/lib/ada.exp b/gdb/testsuite/lib/ada.exp
index 055d4d3..1e686bc 100644
--- a/gdb/testsuite/lib/ada.exp
+++ b/gdb/testsuite/lib/ada.exp
@@ -41,6 +41,25 @@ proc gdb_find_gnatmake {} {
     return $GM
 }   
 
+proc gdb_find_gfortran {} {
+    global tool_root_dir
+
+    if ![is_remote host] {
+	set file [lookfor_file $tool_root_dir gfortran]
+	if { $file == "" } {
+	    set file [lookfor_file $tool_root_dir gcc/gfortran]
+	}
+	if { $file != "" } {
+	    set CC "$file -B[file dirname $file]/"
+	} else {
+	    set CC [transform gfortran]
+	}
+    } else {
+	set CC [transform gfortran]
+    }
+    return $CC
+}
+
 # FIXME:brobecker/2004-03-31:
 # The following function is a copy of the function of the same name provided
 # by dejagnu, except that it has been modified to add support for building
@@ -112,7 +131,7 @@ proc gdb_default_target_compile {source destfile type options} {
 	    if [board_info $dest exists f77compiler] {
 		set compiler [target_info f77compiler]
 	    } else {
-		set compiler [find_g77]
+		set compiler [gdb_find_gfortran]
 	    }
 	}
 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2010-09-21 18:24 PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran H.J. Lu
@ 2011-06-28 19:35 ` Tom Tromey
  2011-06-28 19:56   ` H.J. Lu
  2011-06-29 16:10   ` Joel Brobecker
  0 siblings, 2 replies; 17+ messages in thread
From: Tom Tromey @ 2011-06-28 19:35 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GDB

>>>>> "HJ" == H J Lu <hongjiu.lu@intel.com> writes:

HJ> This isn't a proper fix since it depends on we load lib/ada.exp before
HJ> any Fortran tests.  I think ada.exp is the wrong place to provide
HJ> GDB functions.  It should be placed in something like gdb-support.exp and
HJ> ada.exp/fortran.exp can just load it.

I'm sorry that it took so long for me to review this patch.

HJ> 	PR testsuite/12040
HJ> 	* lib/ada.exp (gdb_find_gfortran): New.
HJ> 	(gdb_default_target_compile): Use it.

I would like something like this to go in, but I don't think this will
have the desired effect, since ada.exp is not always loaded.

Instead I think these procs must be moved elsewhere so they are always
used.

I sent a patch to dejagnu to allow f90 today; so perhaps the result
could be based on that.  I can do the work if you like, just let me
know.

Tom

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-28 19:35 ` Tom Tromey
@ 2011-06-28 19:56   ` H.J. Lu
  2011-06-29 14:44     ` Tom Tromey
  2011-06-29 16:10   ` Joel Brobecker
  1 sibling, 1 reply; 17+ messages in thread
From: H.J. Lu @ 2011-06-28 19:56 UTC (permalink / raw)
  To: Tom Tromey; +Cc: GDB

On Tue, Jun 28, 2011 at 12:35 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "HJ" == H J Lu <hongjiu.lu@intel.com> writes:
>
> HJ> This isn't a proper fix since it depends on we load lib/ada.exp before
> HJ> any Fortran tests.  I think ada.exp is the wrong place to provide
> HJ> GDB functions.  It should be placed in something like gdb-support.exp and
> HJ> ada.exp/fortran.exp can just load it.
>
> I'm sorry that it took so long for me to review this patch.
>
> HJ>     PR testsuite/12040
> HJ>     * lib/ada.exp (gdb_find_gfortran): New.
> HJ>     (gdb_default_target_compile): Use it.
>
> I would like something like this to go in, but I don't think this will
> have the desired effect, since ada.exp is not always loaded.
>
> Instead I think these procs must be moved elsewhere so they are always
> used.
>
> I sent a patch to dejagnu to allow f90 today; so perhaps the result
> could be based on that.  I can do the work if you like, just let me
> know.

Please do.

Thanks.


-- 
H.J.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-28 19:56   ` H.J. Lu
@ 2011-06-29 14:44     ` Tom Tromey
  2011-06-29 14:51       ` H.J. Lu
  0 siblings, 1 reply; 17+ messages in thread
From: Tom Tromey @ 2011-06-29 14:44 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GDB

Tom> I sent a patch to dejagnu to allow f90 today; so perhaps the result
Tom> could be based on that.  I 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  <tromey@redhat.com>

	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 <http://www.gnu.org/licenses/>.
 
-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 != "" } {
-            set GM "$file -I$root/ada/rts --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs --GCC=$root/xgcc -margs";
-        }   
-    }
-
-    if {$GM == ""} {
-        set GM [transform gnatmake]
-    }
-
-    return $GM
-}   
-
-# FIXME:brobecker/2004-03-31:
-# The following function is a copy of the function of the same name provided
-# 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 merged,
-# 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 == "" && $type != "preprocess" && $type != "none" } {
-	error "Must supply an output filename for the compile to default_target_compile"
-    }
-
-    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 == "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 == "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 == "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=" $i] {
-	    regsub "^dest=" $i "" tmp
-	    if [board_info $tmp exists name] {
-		set dest [board_info $tmp name];
-	    } else {
-		set dest $tmp;
-	    }
-	}
-	if [regexp "^compiler=" $i] {
-	    regsub "^compiler=" $i "" tmp
-	    set compiler $tmp
-	}
-	if [regexp "^additional_flags=" $i] {
-	    regsub "^additional_flags=" $i "" tmp
-	    append add_flags " $tmp"
-	}
-	if [regexp "^ldflags=" $i] {
-	    regsub "^ldflags=" $i "" tmp
-	    append ldflags " $tmp"
-	}
-	if [regexp "^libs=" $i] {
-	    regsub "^libs=" $i "" tmp
-	    append libs " $tmp"
-	}
-	if [regexp "^incdir=" $i] {
-	    regsub "^incdir=" $i "-I" tmp
-	    append add_flags " $tmp"
-	}
-	if [regexp "^libdir=" $i] {
-	    regsub "^libdir=" $i "-L" tmp
-	    append add_flags " $tmp"
-	}
-	if [regexp "^ldscript=" $i] {
-	    regsub "^ldscript=" $i "" ldscript
-	}
- 	if [regexp "^redirect=" $i] {
- 	    regsub "^redirect=" $i "" redirect
- 	}
- 	if [regexp "^optimize=" $i] {
- 	    regsub "^optimize=" $i "" optimize
- 	}
- 	if [regexp "^timeout=" $i] {
- 	    regsub "^timeout=" $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
-    
-    if [info exists CC_FOR_TARGET] {
-	if { $compiler == "" } {
-	    set compiler $CC_FOR_TARGET
-	}
-    }
-
-    if [info exists CXX_FOR_TARGET] {
-	if { $compiler_type == "c++" } {
-	    set compiler $CXX_FOR_TARGET
-	}
-    }
-
-    if [info exists F77_FOR_TARGET] {
-	if { $compiler_type == "f77" } {
-	    set compiler $F77_FOR_TARGET
-	}
-    }
-
-    if [info exists GNATMAKE_FOR_TARGET] {
-	if { $compiler_type == "ada" } {
-	    set compiler $GNATMAKE_FOR_TARGET
-	}
-    }
-
-    if { $compiler == "" } {
-	set compiler [board_info $dest compiler];
-	if { $compiler == "" } {
-	    return "default_target_compile: No compiler to compile with";
-	}
-    }
-
-    if ![is_remote host] {
-	if { [which $compiler] == 0 } {
-	    return "default_target_compile: Can't find $compiler."
-	}
-    }
-
-    if {$type == "object"} {
-	append add_flags " -c"
-    }
-
-    if { $type == "preprocess" } {
-	append add_flags " -E"
-    }
-    
-    if { $type == "assembly" } {
-	append add_flags " -S"
-    }
-
-    if [board_info $dest exists cflags] {
-	append add_flags " [board_info $dest cflags]"
-    }
-
-    if { $type == "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 == "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} != "" } {
-		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 == "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 == "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 == "" } {
-		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 != "" } {
-	    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 == "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] != 0 } {
-	verbose -log "compiler exited with status [lindex $status 0]";
-    }
-    if { [lindex $status 1] != "" } {
-	verbose -log "output is:\n[lindex $status 1]" 2;
-    }
-    if { [lindex $status 0] != 0 && "${comp_output}" == "" } {
-	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] == ""} {
-  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.
 
 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, Inc.
+#
+# 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 <http://www.gnu.org/licenses/>.
+
+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 != "" } {
+            set GM "$file -I$root/ada/rts --GCC=$root/xgcc --GNATBIND=$root/gnatbind --GNATLINK=$root/gnatlink -cargs -B$root -largs --GCC=$root/xgcc -margs";
+        }   
+    }
+
+    if {$GM == ""} {
+        set GM [transform gnatmake]
+    }
+
+    return $GM
+}   
+
+proc gdb_find_gfortran {} {
+    global tool_root_dir
+
+    if {![is_remote host]} {
+	set file [lookfor_file $tool_root_dir gfortran]
+	if { $file == "" } {
+	    set file [lookfor_file $tool_root_dir gcc/gfortran]
+	}
+	if { $file != "" } {
+	    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 == "" && $type != "preprocess" && $type != "none" } {
+	error "Must supply an output filename for the compile to default_target_compile"
+    }
+
+    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 == "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 == "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 == "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 == "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=" $i]} {
+	    regsub "^dest=" $i "" tmp
+	    if {[board_info $tmp exists name]} {
+		set dest [board_info $tmp name]
+	    } else {
+		set dest $tmp
+	    }
+	}
+	if {[regexp "^compiler=" $i]} {
+	    regsub "^compiler=" $i "" tmp
+	    set compiler $tmp
+	}
+	if {[regexp "^additional_flags=" $i]} {
+	    regsub "^additional_flags=" $i "" tmp
+	    append add_flags " $tmp"
+	}
+	if {[regexp "^ldflags=" $i]} {
+	    regsub "^ldflags=" $i "" tmp
+	    append ldflags " $tmp"
+	}
+	if {[regexp "^libs=" $i]} {
+	    regsub "^libs=" $i "" tmp
+	    append libs " $tmp"
+	}
+	if {[regexp "^incdir=" $i]} {
+	    regsub "^incdir=" $i "-I" tmp
+	    append add_flags " $tmp"
+	}
+	if {[regexp "^libdir=" $i]} {
+	    regsub "^libdir=" $i "-L" tmp
+	    append add_flags " $tmp"
+	}
+	if {[regexp "^ldscript=" $i]} {
+	    regsub "^ldscript=" $i "" ldscript
+	}
+	if {[regexp "^redirect=" $i]} {
+	    regsub "^redirect=" $i "" redirect
+	}
+	if {[regexp "^optimize=" $i]} {
+	    regsub "^optimize=" $i "" optimize
+	}
+	if {[regexp "^timeout=" $i]} {
+	    regsub "^timeout=" $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 == "ada" } {
+	    set compiler $GNATMAKE_FOR_TARGET
+	}
+    }
+
+    if {[info exists CC_FOR_TARGET]} {
+	if { $compiler == "" } {
+	    set compiler $CC_FOR_TARGET
+	}
+    }
+
+    if {[info exists CXX_FOR_TARGET]} {
+	if { $compiler_type == "c++" } {
+	    set compiler $CXX_FOR_TARGET
+	}
+    }
+
+    if {[info exists F77_FOR_TARGET]} {
+	if { $compiler_type == "f77" } {
+	    set compiler $F77_FOR_TARGET
+	}
+    }
+
+    if {[info exists F90_FOR_TARGET]} {
+	if { $compiler_type == "f90" } {
+	    set compiler $F90_FOR_TARGET
+	}
+    }
+
+    if { $compiler == "" } {
+	set compiler [board_info $dest compiler]
+	if { $compiler == "" } {
+	    return "default_target_compile: No compiler to compile with"
+	}
+    }
+
+    if {![is_remote host]} {
+	if { [which $compiler] == 0 } {
+	    return "default_target_compile: Can't find $compiler."
+	}
+    }
+
+    if {$type == "object"} {
+	append add_flags " -c"
+    }
+
+    if { $type == "preprocess" } {
+	append add_flags " -E"
+    }
+
+    if { $type == "assembly" } {
+	append add_flags " -S"
+    }
+
+    if {[board_info $dest exists cflags]} {
+	append add_flags " [board_info $dest cflags]"
+    }
+
+    if { $type == "executable" } {
+	if {[board_info $dest exists ldflags]} {
+	    append add_flags " [board_info $dest ldflags]"
+	}
+	if { $compiler_type == "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} != "" } {
+		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 == "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 == "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 == "" } {
+		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 != "" } {
+	    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 == "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] != 0 } {
+	verbose -log "compiler exited with status [lindex $status 0]"
+    }
+    if { [lindex $status 1] != "" } {
+	verbose -log "output is:\n[lindex $status 1]" 2
+    }
+    if { [lindex $status 0] != 0 && "${comp_output}" == "" } {
+	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] == ""} {
+    rename gdb_find_gnatmake find_gnatmake
+    set use_gdb_compile 1
+}
+
+if {[info procs find_gfortran] == ""} {
+    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 {} {
     }
 }
 
+# Always load compatibility stuff.
+load_lib future.exp

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-29 14:44     ` Tom Tromey
@ 2011-06-29 14:51       ` H.J. Lu
  2011-06-29 14:58         ` Tom Tromey
  0 siblings, 1 reply; 17+ messages in thread
From: H.J. Lu @ 2011-06-29 14:51 UTC (permalink / raw)
  To: Tom Tromey; +Cc: GDB

On Wed, Jun 29, 2011 at 7:43 AM, Tom Tromey <tromey@redhat.com> wrote:
> Tom> I sent a patch to dejagnu to allow f90 today; so perhaps the result
> Tom> could be based on that.  I 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  <tromey@redhat.com>
>
>        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.
>

Did we get gfortran when searching for F77/f77 compiler?

-- 
H.J.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-29 14:51       ` H.J. Lu
@ 2011-06-29 14:58         ` Tom Tromey
  2011-06-29 17:50           ` Tom Tromey
  0 siblings, 1 reply; 17+ messages in thread
From: Tom Tromey @ 2011-06-29 14:58 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GDB

>>>>> "H.J." == H J Lu <hjl.tools@gmail.com> writes:

H.J.> Did we get gfortran when searching for F77/f77 compiler?

No, I forgot the most crucial bit :)
I will write a follow-up patch to make our tests use gfortran.
I don't think supporting g77 is all that worthwhile any more.

Tom

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-28 19:35 ` Tom Tromey
  2011-06-28 19:56   ` H.J. Lu
@ 2011-06-29 16:10   ` Joel Brobecker
  2011-06-29 17:35     ` Tom Tromey
  1 sibling, 1 reply; 17+ messages in thread
From: Joel Brobecker @ 2011-06-29 16:10 UTC (permalink / raw)
  To: Tom Tromey; +Cc: H.J. Lu, GDB

> HJ> 	PR testsuite/12040
> HJ> 	* lib/ada.exp (gdb_find_gfortran): New.
> HJ> 	(gdb_default_target_compile): Use it.

I wonder if we could get rid of some of this ada.exp, since IIRC,
this file was created to work around a then-limitation in dejagnu
where Ada wasn't supported.

I will put that in my list.

-- 
Joel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-29 16:10   ` Joel Brobecker
@ 2011-06-29 17:35     ` Tom Tromey
  2011-06-29 17:58       ` Joel Brobecker
  0 siblings, 1 reply; 17+ messages in thread
From: Tom Tromey @ 2011-06-29 17:35 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: H.J. Lu, GDB

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

HJ> PR testsuite/12040
HJ> * lib/ada.exp (gdb_find_gfortran): New.
HJ> (gdb_default_target_compile): Use it.

Joel> I wonder if we could get rid of some of this ada.exp, since IIRC,
Joel> this file was created to work around a then-limitation in dejagnu
Joel> where Ada wasn't supported.

Joel> I will put that in my list.

It is definitely in upstream dejagnu.
But, I added a new bit to this code that isn't (yet -- submitted
yesterday) upstream.  So it must remain for a while yet.

Tom

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-29 14:58         ` Tom Tromey
@ 2011-06-29 17:50           ` Tom Tromey
  2011-06-29 17:52             ` H.J. Lu
  2011-06-29 20:45             ` Jan Kratochvil
  0 siblings, 2 replies; 17+ messages in thread
From: Tom Tromey @ 2011-06-29 17:50 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GDB

H.J.> Did we get gfortran when searching for F77/f77 compiler?

Tom> No, I forgot the most crucial bit :)
Tom> I will write a follow-up patch to make our tests use gfortran.
Tom> I don't think supporting g77 is all that worthwhile any more.

Here is the follow-up.  I am checking it in.

This patch switches all the gdb.fortran tests to use the new gfortran
support.

Built and regested both locally and by the buildbot.

Note that this introduces new FAILs:

FAIL: gdb.fortran/array-element.exp: continue to breakpoint once again (the program exited)
FAIL: gdb.fortran/array-element.exp: print the second element of array a


These tests were previously not run, at least not on the machines I use.
This is really just a single failure; I looked at it briefly and it is
either a gfortran bug, or a bad assumption on the part of the testcase
writer.  I don't actually know Fortran so it is hard to say.

Tom

2011-06-29  Tom Tromey  <tromey@redhat.com>

	PR testsuite/12040:
	* gdb.fortran/array-element.exp: Use f90, not f77.
	* gdb.fortran/complex.exp: Use f90, not f77.
	* gdb.fortran/derived-type.exp: Use f90, not f77.
	* gdb.fortran/library-module.exp: Use f90, not f77.
	* gdb.fortran/logical.exp: Use f90, not f77.
	* gdb.fortran/module.exp: Use f90, not f77.
	* gdb.fortran/multi-dim.exp: Use f90, not f77.
	* gdb.fortran/subarray.exp: Use f90, not f77.

diff --git a/gdb/testsuite/gdb.fortran/array-element.exp b/gdb/testsuite/gdb.fortran/array-element.exp
index 0ce2621..1fc4059 100644
--- a/gdb/testsuite/gdb.fortran/array-element.exp
+++ b/gdb/testsuite/gdb.fortran/array-element.exp
@@ -29,7 +29,7 @@ set srcfile ${testfile}.f
 set binfile ${objdir}/${subdir}/${testfile}
 
 if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-	 executable {debug f77}] != ""} {
+	 executable {debug f90}] != ""} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.fortran/complex.exp b/gdb/testsuite/gdb.fortran/complex.exp
index ba58cb2..103ec8e 100644
--- a/gdb/testsuite/gdb.fortran/complex.exp
+++ b/gdb/testsuite/gdb.fortran/complex.exp
@@ -18,7 +18,7 @@ set srcfile ${testfile}.f
 set binfile ${objdir}/${subdir}/${testfile}
 
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-	  executable {debug f77 quiet}] != "" } {
+	  executable {debug f90 quiet}] != "" } {
     untested "Couldn't compile ${srcfile}"
     return -1
 }
diff --git a/gdb/testsuite/gdb.fortran/derived-type.exp b/gdb/testsuite/gdb.fortran/derived-type.exp
index 9751dc2..508c1f9 100644
--- a/gdb/testsuite/gdb.fortran/derived-type.exp
+++ b/gdb/testsuite/gdb.fortran/derived-type.exp
@@ -29,7 +29,7 @@ set srcfile ${testfile}.f90
 set binfile ${objdir}/${subdir}/${testfile}
 
 if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-	 executable {debug f77}] != ""} {
+	 executable {debug f90}] != ""} {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.fortran/library-module.exp b/gdb/testsuite/gdb.fortran/library-module.exp
index b0b4068..8c9f43c 100644
--- a/gdb/testsuite/gdb.fortran/library-module.exp
+++ b/gdb/testsuite/gdb.fortran/library-module.exp
@@ -25,7 +25,7 @@ if [get_compiler_info not-used] {
    return -1
 }
 
-if  { [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfile}" $objdir/$subdir/$libfile {debug f77}] != "" } {
+if  { [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfile}" $objdir/$subdir/$libfile {debug f90}] != "" } {
     untested "Couldn't compile ${srclibfile}"
     return -1
 }
@@ -34,7 +34,7 @@ if  { [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfile}" $objdir/$subdir/$li
 # just for the linking phase (and not the source compilation phase).  And any
 # warnings on ignored $libfile abort the process.
 
-if  { [gdb_compile [list $srcdir/$subdir/$srcfile $objdir/$subdir/$libfile] $objdir/$subdir/$binfile executable {debug f77}] != "" } {
+if  { [gdb_compile [list $srcdir/$subdir/$srcfile $objdir/$subdir/$libfile] $objdir/$subdir/$binfile executable {debug f90}] != "" } {
     untested "Couldn't compile ${srcfile}"
     return -1
 }
diff --git a/gdb/testsuite/gdb.fortran/logical.exp b/gdb/testsuite/gdb.fortran/logical.exp
index 06d6f0b..c3719b4 100644
--- a/gdb/testsuite/gdb.fortran/logical.exp
+++ b/gdb/testsuite/gdb.fortran/logical.exp
@@ -2,7 +2,7 @@
 
 # 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 2 of the License, or
+# 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,
@@ -19,7 +19,7 @@
 set test "logical"
 set srcfile ${test}.f90
 
-if { [prepare_for_testing "${test}.exp" "${test}" "${srcfile}" {debug f77 quiet}] } {
+if { [prepare_for_testing "${test}.exp" "${test}" "${srcfile}" {debug f90 quiet}] } {
     untested "Could not compile ${srcfile}."
     return -1
 }
diff --git a/gdb/testsuite/gdb.fortran/module.exp b/gdb/testsuite/gdb.fortran/module.exp
index d96baac..364c59d 100644
--- a/gdb/testsuite/gdb.fortran/module.exp
+++ b/gdb/testsuite/gdb.fortran/module.exp
@@ -16,7 +16,7 @@
 set testfile "module"
 set srcfile ${testfile}.f90
 
-if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f77}] } {
+if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}] } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.fortran/multi-dim.exp b/gdb/testsuite/gdb.fortran/multi-dim.exp
index d41ce0f..33b7574 100644
--- a/gdb/testsuite/gdb.fortran/multi-dim.exp
+++ b/gdb/testsuite/gdb.fortran/multi-dim.exp
@@ -20,7 +20,7 @@ if { [skip_fortran_tests] } { return -1 }
 
 set testfile "multi-dim"
 set srcfile ${testfile}.f90
-if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f77}] } {
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } {
     return -1
 }
 
diff --git a/gdb/testsuite/gdb.fortran/subarray.exp b/gdb/testsuite/gdb.fortran/subarray.exp
index 58d020b..b4324dd 100644
--- a/gdb/testsuite/gdb.fortran/subarray.exp
+++ b/gdb/testsuite/gdb.fortran/subarray.exp
@@ -29,7 +29,7 @@ set srcfile ${testfile}.f
 set binfile ${objdir}/${subdir}/${testfile}
 
 if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \
-	executable {debug f77}] != ""} {
+	executable {debug f90}] != ""} {
     return -1
 }
 

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-29 17:50           ` Tom Tromey
@ 2011-06-29 17:52             ` H.J. Lu
  2011-06-29 18:26               ` Tom Tromey
  2011-06-29 20:45             ` Jan Kratochvil
  1 sibling, 1 reply; 17+ messages in thread
From: H.J. Lu @ 2011-06-29 17:52 UTC (permalink / raw)
  To: Tom Tromey; +Cc: GDB

On Wed, Jun 29, 2011 at 10:50 AM, Tom Tromey <tromey@redhat.com> wrote:
> H.J.> Did we get gfortran when searching for F77/f77 compiler?
>
> Tom> No, I forgot the most crucial bit :)
> Tom> I will write a follow-up patch to make our tests use gfortran.
> Tom> I don't think supporting g77 is all that worthwhile any more.
>
> Here is the follow-up.  I am checking it in.
>
> This patch switches all the gdb.fortran tests to use the new gfortran
> support.
>
> Built and regested both locally and by the buildbot.
>
> Note that this introduces new FAILs:
>
> FAIL: gdb.fortran/array-element.exp: continue to breakpoint once again (the program exited)
> FAIL: gdb.fortran/array-element.exp: print the second element of array a
>
>
> These tests were previously not run, at least not on the machines I use.
> This is really just a single failure; I looked at it briefly and it is
> either a gfortran bug, or a bad assumption on the part of the testcase
> writer.  I don't actually know Fortran so it is hard to say.
>
> Tom
>
> 2011-06-29  Tom Tromey  <tromey@redhat.com>
>
>        PR testsuite/12040:
>        * gdb.fortran/array-element.exp: Use f90, not f77.
>        * gdb.fortran/complex.exp: Use f90, not f77.
>        * gdb.fortran/derived-type.exp: Use f90, not f77.
>        * gdb.fortran/library-module.exp: Use f90, not f77.
>        * gdb.fortran/logical.exp: Use f90, not f77.
>        * gdb.fortran/module.exp: Use f90, not f77.
>        * gdb.fortran/multi-dim.exp: Use f90, not f77.
>        * gdb.fortran/subarray.exp: Use f90, not f77.
>

gfortran can be used as F77 compiler.  Why not just return gfortran
for f77?


-- 
H.J.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-29 17:35     ` Tom Tromey
@ 2011-06-29 17:58       ` Joel Brobecker
  0 siblings, 0 replies; 17+ messages in thread
From: Joel Brobecker @ 2011-06-29 17:58 UTC (permalink / raw)
  To: Tom Tromey; +Cc: H.J. Lu, GDB

> It is definitely in upstream dejagnu.
> But, I added a new bit to this code that isn't (yet -- submitted
> yesterday) upstream.  So it must remain for a while yet.

I am actually wondering now whether we might want to ever remove
this code. It's pretty convenient when we discover dejagnu bugs
and limitations... We could possibly treat the entire dejagnu
library the way we treat readline? (thinking aloud)

-- 
Joel

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-29 17:52             ` H.J. Lu
@ 2011-06-29 18:26               ` Tom Tromey
  2011-06-29 18:29                 ` H.J. Lu
  0 siblings, 1 reply; 17+ messages in thread
From: Tom Tromey @ 2011-06-29 18:26 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GDB

>>>>> "H.J." == H J Lu <hjl.tools@gmail.com> writes:

H.J.> gfortran can be used as F77 compiler.  Why not just return gfortran
H.J.> for f77?

No particular reason.
I can implement it that way if you feel strongly about it.

Tom

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-29 18:26               ` Tom Tromey
@ 2011-06-29 18:29                 ` H.J. Lu
  2011-06-30 13:29                   ` Tom Tromey
  0 siblings, 1 reply; 17+ messages in thread
From: H.J. Lu @ 2011-06-29 18:29 UTC (permalink / raw)
  To: Tom Tromey; +Cc: GDB

On Wed, Jun 29, 2011 at 11:25 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "H.J." == H J Lu <hjl.tools@gmail.com> writes:
>
> H.J.> gfortran can be used as F77 compiler.  Why not just return gfortran
> H.J.> for f77?
>
> No particular reason.
> I can implement it that way if you feel strongly about it.
>

That is fine with gdb testsuite.  But in general, dejagnu should try
gfortran first when F77 compiler is requested.

-- 
H.J.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-29 17:50           ` Tom Tromey
  2011-06-29 17:52             ` H.J. Lu
@ 2011-06-29 20:45             ` Jan Kratochvil
  2011-06-29 20:49               ` Tom Tromey
  1 sibling, 1 reply; 17+ messages in thread
From: Jan Kratochvil @ 2011-06-29 20:45 UTC (permalink / raw)
  To: Tom Tromey; +Cc: H.J. Lu, GDB

On Wed, 29 Jun 2011 19:50:07 +0200, Tom Tromey wrote:
> Note that this introduces new FAILs:
> 
> FAIL: gdb.fortran/array-element.exp: continue to breakpoint once again (the program exited)
> FAIL: gdb.fortran/array-element.exp: print the second element of array a
> 
> These tests were previously not run, at least not on the machines I use.

I am used to these two FAILs, it always has been this way.


Regards,
Jan

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-29 20:45             ` Jan Kratochvil
@ 2011-06-29 20:49               ` Tom Tromey
  2011-06-29 20:56                 ` Jan Kratochvil
  0 siblings, 1 reply; 17+ messages in thread
From: Tom Tromey @ 2011-06-29 20:49 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: H.J. Lu, GDB

>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:

Jan> I am used to these two FAILs, it always has been this way.

Do you install g77?  Or make the tests run some other way?

Tom

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-29 20:49               ` Tom Tromey
@ 2011-06-29 20:56                 ` Jan Kratochvil
  0 siblings, 0 replies; 17+ messages in thread
From: Jan Kratochvil @ 2011-06-29 20:56 UTC (permalink / raw)
  To: Tom Tromey; +Cc: H.J. Lu, GDB

On Wed, 29 Jun 2011 22:48:50 +0200, Tom Tromey wrote:
> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> 
> Jan> I am used to these two FAILs, it always has been this way.
> 
> Do you install g77?  Or make the tests run some other way?

I just always used gfortran, sorry if it was not clear, I do not know if these
tests failed on real g77 or not.

Fedora gdb.spec:
g77="`which gfortran 2>/dev/null || true`"
test -z "$g77" || ln -s "$g77" ./g77
../configure [...]


Regards,
Jan

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran
  2011-06-29 18:29                 ` H.J. Lu
@ 2011-06-30 13:29                   ` Tom Tromey
  0 siblings, 0 replies; 17+ messages in thread
From: Tom Tromey @ 2011-06-30 13:29 UTC (permalink / raw)
  To: H.J. Lu; +Cc: GDB, Public DejaGNU List

>>>>> "H.J." == H J Lu <hjl.tools@gmail.com> writes:

CC'ing the dejagnu list.

H.J.> gfortran can be used as F77 compiler.  Why not just return gfortran
H.J.> for f77?

Tom> No particular reason.
Tom> I can implement it that way if you feel strongly about it.

H.J.> That is fine with gdb testsuite.  But in general, dejagnu should try
H.J.> gfortran first when F77 compiler is requested.

I agree, this would make the most sense.

However, I don't see how to reasonably modify find_g77 to do this.  I
could add a check for [which gfortran] to the not-remote-host case, but
I don't know how to search $PATH on a remote host.

I'm also not sure if searching $PATH is ok here at all.

Tom

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-06-30 13:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-21 18:24 PATCH: PR testsuite/12040: GDB Fortran tests use g77 instead of gfortran H.J. Lu
2011-06-28 19:35 ` Tom Tromey
2011-06-28 19:56   ` H.J. Lu
2011-06-29 14:44     ` Tom Tromey
2011-06-29 14:51       ` H.J. Lu
2011-06-29 14:58         ` Tom Tromey
2011-06-29 17:50           ` Tom Tromey
2011-06-29 17:52             ` H.J. Lu
2011-06-29 18:26               ` Tom Tromey
2011-06-29 18:29                 ` H.J. Lu
2011-06-30 13:29                   ` Tom Tromey
2011-06-29 20:45             ` Jan Kratochvil
2011-06-29 20:49               ` Tom Tromey
2011-06-29 20:56                 ` Jan Kratochvil
2011-06-29 16:10   ` Joel Brobecker
2011-06-29 17:35     ` Tom Tromey
2011-06-29 17:58       ` Joel Brobecker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).