This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
A patch for binutils testsuite
- To: binutils at sourceware dot cygnus dot com
- Subject: A patch for binutils testsuite
- From: "H . J . Lu" <hjl at valinux dot com>
- Date: Mon, 5 Feb 2001 23:35:53 -0800
gcc on ia64 will report warnings even if without -Wall. That is why
I changed binutils-all/testprog.c. Also we should use the just built
as/ld if possible.
--
H.J. Lu (hjl@valinux.com)
--
2001-02-05 H.J. Lu <hjl@gnu.org>
* config/default.exp: Set up gcc_gas_flag.
* binutils-all/objcopy.exp (copy_setup): Process gcc_gas_flag
for Linux only.
* binutils-all/testprog.c: Include <string.h> and don't use
exit ().
Index: binutils-all/objcopy.exp
===================================================================
RCS file: /work/cvs/gnu/binutils/binutils/testsuite/binutils-all/objcopy.exp,v
retrieving revision 1.1.1.5
diff -u -p -r1.1.1.5 objcopy.exp
--- binutils-all/objcopy.exp 2000/06/20 17:24:25 1.1.1.5
+++ binutils-all/objcopy.exp 2001/02/06 07:34:39
@@ -398,6 +398,7 @@ strip_test_with_saving_a_symbol
proc copy_setup { } {
global srcdir
global subdir
+ global gcc_gas_flag
set res [build_wrapper testglue.o];
set flags { debug };
@@ -409,6 +410,11 @@ proc copy_setup { } {
set add_libs "";
}
+ if { [istarget *-*-linux*] } {
+ foreach i $gcc_gas_flag {
+ set flags "additional_flags=$i $flags"
+ }
+ }
if { [target_compile "$srcdir/$subdir/testprog.c $add_libs" tmpdir/testprog executable $flags] != "" } {
return 2
}
Index: binutils-all/testprog.c
===================================================================
RCS file: /work/cvs/gnu/binutils/binutils/testsuite/binutils-all/testprog.c,v
retrieving revision 1.2
diff -u -p -r1.2 testprog.c
--- binutils-all/testprog.c 1999/07/19 16:46:43 1.2
+++ binutils-all/testprog.c 2001/02/06 05:49:53
@@ -1,6 +1,7 @@
/* This program is used to test objcopy and strip. */
#include <stdio.h>
+#include <string.h>
int common;
int global = 1;
@@ -22,9 +23,9 @@ main ()
|| strcmp (string, "string") != 0)
{
printf ("failed\n");
- exit (1);
+ return (1);
}
printf ("ok\n");
- exit (0);
+ return (0);
}
Index: config/default.exp
===================================================================
RCS file: /work/cvs/gnu/binutils/binutils/testsuite/config/default.exp,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 default.exp
--- config/default.exp 1999/06/03 18:01:56 1.1.1.1
+++ config/default.exp 2001/02/06 06:50:25
@@ -70,6 +70,20 @@ if ![info exists READELFFLAGS] then {
if ![file isdirectory tmpdir] {catch "exec mkdir tmpdir" status}
+# Make a symlink from tmpdir/gas/as and tmpdir/gas/ld to the assembler
+# and linker in the build tree, so that we can use a -B option to gcc
+# to force it to use the newly built assembler/linker.
+if {![file isdirectory tmpdir/gas]} then {
+ catch "exec mkdir tmpdir/gas" status
+ if {[file isfile ../gas/as-new]} then {
+ catch "exec ln -s ../../../gas/as-new tmpdir/gas/as" status
+ }
+ if {[file isfile ../ld/ld-new]} then {
+ catch "exec ln -s ../../../ld/ld-new tmpdir/gas/ld" status
+ }
+}
+set gcc_gas_flag "-B[pwd]/tmpdir/gas/"
+
#
# binutils_run
# run a program, returning the output