public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* PATCH: Add a testcase for PR binutils/14481
@ 2012-08-16 20:35 H.J. Lu
  2012-10-16 15:14 ` Thomas Schwinge
  0 siblings, 1 reply; 6+ messages in thread
From: H.J. Lu @ 2012-08-16 20:35 UTC (permalink / raw)
  To: binutils

Hi,

I checkec in this patch to add a testcase for PR binutils/14481.

Thanks.


H.J.
---
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 3e8c2da..8b52cce 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,3 +1,14 @@
+2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR binutils/14481
+	* Makefile.am (BFDTEST1_PROG): New.
+	(TEST_PROGS): Likewise.
+	(bfdtest1_DEPENDENCIES): Likewise.
+	(noinst_PROGRAMS): Add $(TEST_PROGS).
+	* Makefile.in: Regenerated.
+
+	* bfdtest1.c: New file.
+
 2012-08-13  Ian Bolton  <ian.bolton@arm.com>
             Laurent Desnogues  <laurent.desnogues@arm.com>
             Jim MacArthur  <jim.macarthur@arm.com>
diff --git a/binutils/Makefile.am b/binutils/Makefile.am
index 3364bee..f16de99 100644
--- a/binutils/Makefile.am
+++ b/binutils/Makefile.am
@@ -65,10 +65,15 @@ bin_PROGRAMS = $(SIZE_PROG) $(OBJDUMP_PROG) $(AR_PROG) $(STRINGS_PROG) $(RANLIB_
 bin_SCRIPTS = @BUILD_INSTALL_MISC@
 EXTRA_SCRIPTS = embedspu
 
+## Test programs.
+BFDTEST1_PROG = bfdtest1
+
+TEST_PROGS = $(BFDTEST1_PROG)
+
 ## We need a special rule to install the programs which are built with
 ## -new, and to rename cxxfilt to c++filt.
 RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
-noinst_PROGRAMS = $(RENAMED_PROGS) @BUILD_MISC@
+noinst_PROGRAMS = $(RENAMED_PROGS) $(TEST_PROGS) @BUILD_MISC@
 
 EXTRA_PROGRAMS = $(NLMCONV_PROG) srconv sysdump coffdump $(DLLTOOL_PROG) $(WINDRES_PROG) $(WINDMC_PROG) $(DLLWRAP_PROG)
 
@@ -194,6 +199,7 @@ addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
 readelf_DEPENDENCIES =   $(LIBINTL_DEP) $(LIBIBERTY)
 elfedit_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
 dllwrap_DEPENDENCIES =   $(LIBINTL_DEP) $(LIBIBERTY)
+bfdtest1_DEPENDENCIES =  $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
 
 LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
 
diff --git a/binutils/Makefile.in b/binutils/Makefile.in
index 94331be..59b10aa 100644
--- a/binutils/Makefile.in
+++ b/binutils/Makefile.in
@@ -41,7 +41,7 @@ bin_PROGRAMS = $(am__EXEEXT_6) $(am__EXEEXT_7) $(am__EXEEXT_8) \
 	@BUILD_NLMCONV@ @BUILD_SRCONV@ @BUILD_DLLTOOL@ @BUILD_WINDRES@ \
 	@BUILD_WINDMC@ $(am__EXEEXT_12) $(am__EXEEXT_13) \
 	$(am__EXEEXT_14) @BUILD_DLLWRAP@
-noinst_PROGRAMS = $(am__EXEEXT_18) @BUILD_MISC@
+noinst_PROGRAMS = $(am__EXEEXT_18) $(am__EXEEXT_20) @BUILD_MISC@
 EXTRA_PROGRAMS = $(am__EXEEXT_1) srconv$(EXEEXT) sysdump$(EXEEXT) \
 	coffdump$(EXEEXT) $(am__EXEEXT_2) $(am__EXEEXT_3) \
 	$(am__EXEEXT_4) $(am__EXEEXT_5)
@@ -101,6 +101,8 @@ am__EXEEXT_15 = nm-new$(EXEEXT)
 am__EXEEXT_16 = strip-new$(EXEEXT)
 am__EXEEXT_17 = cxxfilt$(EXEEXT)
 am__EXEEXT_18 = $(am__EXEEXT_15) $(am__EXEEXT_16) $(am__EXEEXT_17)
+am__EXEEXT_19 = bfdtest1$(EXEEXT)
+am__EXEEXT_20 = $(am__EXEEXT_19)
 PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
 am__objects_1 = bucomm.$(OBJEXT) version.$(OBJEXT) filemode.$(OBJEXT)
 am_addr2line_OBJECTS = addr2line.$(OBJEXT) $(am__objects_1)
@@ -111,6 +113,9 @@ am_ar_OBJECTS = arparse.$(OBJEXT) arlex.$(OBJEXT) ar.$(OBJEXT) \
 	not-ranlib.$(OBJEXT) arsup.$(OBJEXT) rename.$(OBJEXT) \
 	binemul.$(OBJEXT) emul_$(EMULATION).$(OBJEXT) $(am__objects_1)
 ar_OBJECTS = $(am_ar_OBJECTS)
+bfdtest1_SOURCES = bfdtest1.c
+bfdtest1_OBJECTS = bfdtest1.$(OBJEXT)
+bfdtest1_LDADD = $(LDADD)
 am_coffdump_OBJECTS = coffdump.$(OBJEXT) coffgrok.$(OBJEXT) \
 	$(am__objects_1)
 coffdump_OBJECTS = $(am_coffdump_OBJECTS)
@@ -221,13 +226,13 @@ YACCCOMPILE = $(YACC) $(YFLAGS) $(AM_YFLAGS)
 LTYACCCOMPILE = $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
 	--mode=compile $(YACC) $(YFLAGS) $(AM_YFLAGS)
 SOURCES = $(addr2line_SOURCES) $(ar_SOURCES) $(EXTRA_ar_SOURCES) \
-	$(coffdump_SOURCES) $(cxxfilt_SOURCES) $(dlltool_SOURCES) \
-	$(dllwrap_SOURCES) $(elfedit_SOURCES) $(nlmconv_SOURCES) \
-	$(nm_new_SOURCES) $(objcopy_SOURCES) $(objdump_SOURCES) \
-	$(EXTRA_objdump_SOURCES) $(ranlib_SOURCES) $(readelf_SOURCES) \
-	$(size_SOURCES) $(srconv_SOURCES) $(strings_SOURCES) \
-	$(strip_new_SOURCES) $(sysdump_SOURCES) $(windmc_SOURCES) \
-	$(windres_SOURCES)
+	bfdtest1.c $(coffdump_SOURCES) $(cxxfilt_SOURCES) \
+	$(dlltool_SOURCES) $(dllwrap_SOURCES) $(elfedit_SOURCES) \
+	$(nlmconv_SOURCES) $(nm_new_SOURCES) $(objcopy_SOURCES) \
+	$(objdump_SOURCES) $(EXTRA_objdump_SOURCES) $(ranlib_SOURCES) \
+	$(readelf_SOURCES) $(size_SOURCES) $(srconv_SOURCES) \
+	$(strings_SOURCES) $(strip_new_SOURCES) $(sysdump_SOURCES) \
+	$(windmc_SOURCES) $(windres_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
 	install-dvi-recursive install-exec-recursive \
@@ -443,6 +448,8 @@ DLLWRAP_PROG = dllwrap
 SRCONV_PROG = srconv$(EXEEXT) sysdump$(EXEEXT) coffdump$(EXEEXT)
 bin_SCRIPTS = @BUILD_INSTALL_MISC@
 EXTRA_SCRIPTS = embedspu
+BFDTEST1_PROG = bfdtest1
+TEST_PROGS = $(BFDTEST1_PROG)
 RENAMED_PROGS = $(NM_PROG) $(STRIP_PROG) $(DEMANGLER_PROG)
 
 # Stuff that goes in tooldir/ if appropriate.
@@ -537,6 +544,7 @@ addr2line_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
 readelf_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
 elfedit_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
 dllwrap_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY)
+bfdtest1_DEPENDENCIES = $(LIBINTL_DEP) $(LIBIBERTY) $(BFDLIB)
 LDADD = $(BFDLIB) $(LIBIBERTY) $(LIBINTL)
 size_SOURCES = size.c $(BULIBS)
 objcopy_SOURCES = objcopy.c not-strip.c rename.c $(WRITE_DEBUG_SRCS) $(BULIBS)
@@ -710,6 +718,9 @@ arparse.h: arparse.c
 ar$(EXEEXT): $(ar_OBJECTS) $(ar_DEPENDENCIES) 
 	@rm -f ar$(EXEEXT)
 	$(LINK) $(ar_OBJECTS) $(ar_LDADD) $(LIBS)
+bfdtest1$(EXEEXT): $(bfdtest1_OBJECTS) $(bfdtest1_DEPENDENCIES) 
+	@rm -f bfdtest1$(EXEEXT)
+	$(LINK) $(bfdtest1_OBJECTS) $(bfdtest1_LDADD) $(LIBS)
 coffdump$(EXEEXT): $(coffdump_OBJECTS) $(coffdump_DEPENDENCIES) 
 	@rm -f coffdump$(EXEEXT)
 	$(LINK) $(coffdump_OBJECTS) $(coffdump_LDADD) $(LIBS)
@@ -830,6 +841,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arlex.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arparse.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/arsup.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bfdtest1.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bin2c.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/binemul.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bucomm.Po@am__quote@
diff --git a/binutils/bfdtest1.c b/binutils/bfdtest1.c
new file mode 100644
index 0000000..b246a04
--- /dev/null
+++ b/binutils/bfdtest1.c
@@ -0,0 +1,68 @@
+/* A program to test BFD.
+   Copyright 2012 Free Software Foundation, Inc.
+
+   This file is part of the GNU Binutils.
+
+   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, write to the Free Software
+   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+   MA 02110-1301, USA.  */
+
+#include "sysdep.h"
+#include "bfd.h"
+
+static void
+die (const char *s)
+{
+  printf ("oops: %s\n", s);
+  exit (1);
+}
+
+int
+main (int argc, char **argv)
+{
+  bfd *archive;
+  bfd *last, *next;
+
+  if (argc != 2)
+    die ("bad usage");
+
+  archive = bfd_openr (argv[1], NULL);
+
+  if (!bfd_check_format (archive, bfd_archive))
+    {
+      bfd_close (archive);
+      die ("bfd_check_format");
+    }
+
+  for (last = bfd_openr_next_archived_file (archive, NULL);
+       last;
+       last = next)
+    {
+      next = bfd_openr_next_archived_file (archive, last);
+      bfd_close (last);
+    }
+
+  for (last = bfd_openr_next_archived_file (archive, NULL);
+       last;
+       last = next)
+    {
+      next = bfd_openr_next_archived_file (archive, last);
+      bfd_close (last);
+    }
+
+  if (!bfd_close (archive))
+    die ("bfd_close");
+
+  return 0;
+}
diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 98555df..d7d3a04 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>
+
+	PR binutils/14481
+	* ar.exp (bfdtest1): New.
+	(long_filenames): Run bfdtest1.
+	(thin_archive): Likewise.
+	(thin_archive_with_nested): Likewise.
+
 2012-08-13  Ian Bolton  <ian.bolton@arm.com>
             Laurent Desnogues  <laurent.desnogues@arm.com>
             Jim MacArthur  <jim.macarthur@arm.com>
diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
index 0caa847..c66c43e 100644
--- a/binutils/testsuite/binutils-all/ar.exp
+++ b/binutils/testsuite/binutils-all/ar.exp
@@ -27,6 +27,8 @@ if ![is_remote host] {
     }
 }
 
+set bfdtest1 [findfile $base_dir/bfdtest1]
+
 # send_user "Version [binutil_version $AR]"
 
 # Test long file name support
@@ -34,6 +36,7 @@ if ![is_remote host] {
 proc long_filenames { } {
     global AR
     global host_triplet
+    global bfdtest1
 
     set testname "ar long file names"
 
@@ -124,6 +127,14 @@ proc long_filenames { } {
 	return
     }
 
+    verbose -log "$bfdtest1 $dest"
+    set exec_output [binutils_run $bfdtest1 "$dest"]
+    if ![string match "" $exec_output] {
+	verbose -log $exec_output
+	fail "$testname (bfdtest1)"
+	return
+    }
+
     if [is_remote host] {
 	remote_upload host $n1 tmpdir/$n1
 	remote_upload host $n2 tmpdir/$n2
@@ -224,6 +235,7 @@ proc thin_archive { } {
     global NM
     global srcdir
     global subdir
+    global bfdtest1
 
     set testname "ar thin archive"
 
@@ -249,6 +261,14 @@ proc thin_archive { } {
 	return
     }
 
+    verbose -log "$bfdtest1 $archive"
+    set exec_output [binutils_run $bfdtest1 "$archive"]
+    if ![string match "" $exec_output] {
+	verbose -log $exec_output
+	fail "$testname (bfdtest1)"
+	return
+    }
+
     set got [binutils_run $NM "--print-armap $archive"]
     if { ![string match "*text_symbol in *bintest.o*" $got] \
 	 || ![string match "*data_symbol in *bintest.o*" $got] \
@@ -271,6 +291,7 @@ proc thin_archive_with_nested { } {
     global NM
     global srcdir
     global subdir
+    global bfdtest1
 
     set testname "ar thin archive with nested archive"
 
@@ -306,6 +327,14 @@ proc thin_archive_with_nested { } {
 	return
     }
 
+    verbose -log "$bfdtest1 $archive"
+    set exec_output [binutils_run $bfdtest1 "$archive"]
+    if ![string match "" $exec_output] {
+	verbose -log $exec_output
+	fail "$testname (bfdtest1)"
+	return
+    }
+
     set got [binutils_run $NM "--print-armap $archive"]
     if { ![string match "*text_symbol in *bintest.o*" $got] \
 	 || ![string match "*data_symbol in *bintest.o*" $got] \

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

* Re: PATCH: Add a testcase for PR binutils/14481
  2012-08-16 20:35 PATCH: Add a testcase for PR binutils/14481 H.J. Lu
@ 2012-10-16 15:14 ` Thomas Schwinge
  2012-10-22 10:04   ` Thomas Schwinge
  2012-10-24 11:29   ` H.J. Lu
  0 siblings, 2 replies; 6+ messages in thread
From: Thomas Schwinge @ 2012-10-16 15:14 UTC (permalink / raw)
  To: H.J. Lu; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 3034 bytes --]

Hi!

On Thu, 16 Aug 2012 13:32:55 -0700, "H.J. Lu" <hongjiu.lu@intel.com> wrote:
> I checkec in this patch to add a testcase for PR binutils/14481.

> --- a/binutils/ChangeLog
> +++ b/binutils/ChangeLog
> @@ -1,3 +1,14 @@
> +2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>
> +
> +	PR binutils/14481
> +	* Makefile.am (BFDTEST1_PROG): New.
> +	(TEST_PROGS): Likewise.
> +	(bfdtest1_DEPENDENCIES): Likewise.
> +	(noinst_PROGRAMS): Add $(TEST_PROGS).
> +	* Makefile.in: Regenerated.
> +
> +	* bfdtest1.c: New file.
> +

> --- a/binutils/testsuite/ChangeLog
> +++ b/binutils/testsuite/ChangeLog
> @@ -1,3 +1,11 @@
> +2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>
> +
> +	PR binutils/14481
> +	* ar.exp (bfdtest1): New.
> +	(long_filenames): Run bfdtest1.
> +	(thin_archive): Likewise.
> +	(thin_archive_with_nested): Likewise.

> diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
> index 0caa847..c66c43e 100644
> --- a/binutils/testsuite/binutils-all/ar.exp
> +++ b/binutils/testsuite/binutils-all/ar.exp
> @@ -27,6 +27,8 @@ if ![is_remote host] {
>      }
>  }
>  
> +set bfdtest1 [findfile $base_dir/bfdtest1]

This is not correct for cross-testing on a Windows host, and results in a
bunch of ERRORs about the file not being found.  Here is a patch -- OK to
commit?

Index: binutils/testsuite/binutils-all/ar.exp
===================================================================
--- binutils/testsuite/binutils-all/ar.exp	(revision 390600)
+++ binutils/testsuite/binutils-all/ar.exp	(working copy)
@@ -27,7 +27,7 @@
     }
 }
 
-set bfdtest1 [findfile $base_dir/bfdtest1]
+set bfdtest1 [findfile $base_dir/bfdtest1[exe_ext_host]]
 
 # send_user "Version [binutil_version $AR]"
 
Index: binutils/testsuite/lib/utils-lib.exp
===================================================================
--- binutils/testsuite/lib/utils-lib.exp	(revision 390600)
+++ binutils/testsuite/lib/utils-lib.exp	(working copy)
@@ -125,8 +125,8 @@
 }
 
 #
-# exe_ext
-#	Returns target executable extension, if any.
+# exe_ext, exe_ext_host
+#	Returns target/host executable extension, if any.
 #
 proc exe_ext {} {
     if { [istarget *-*-mingw*] || [istarget *-*-cygwin*] } {
@@ -136,6 +136,14 @@
     }
 }
 
+proc exe_ext_host {} {
+    if { [ishost *-*-mingw*] || [ishost *-*-cygwin*] } {
+        return ".exe"
+    } else {
+        return ""
+    }
+}
+
 # Copied and modified from gas.
 
 # run_dump_test FILE (optional:) EXTRA_OPTIONS


Then, with that patch applied, the tests still FAIL on Windows hosts:

    FAIL: ar long file names (bfdtest1)
    FAIL: ar thin archive (bfdtest1)
    FAIL: ar thin archive with nested archive (bfdtest1)

The first two will go away (PASS) if I force (by copying it over) the
unstripped executable binutils/.libs/bfdtest1.exe to be used instead of
the stripped one -- huh.  Yet, the last of the three still FAILs.
Debugging that is for another day.


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: PATCH: Add a testcase for PR binutils/14481
  2012-10-16 15:14 ` Thomas Schwinge
@ 2012-10-22 10:04   ` Thomas Schwinge
  2012-10-24 11:29   ` H.J. Lu
  1 sibling, 0 replies; 6+ messages in thread
From: Thomas Schwinge @ 2012-10-22 10:04 UTC (permalink / raw)
  To: H.J. Lu; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 3287 bytes --]

Hi!

Ping.


On Tue, 16 Oct 2012 17:14:04 +0200, I wrote:
> On Thu, 16 Aug 2012 13:32:55 -0700, "H.J. Lu" <hongjiu.lu@intel.com> wrote:
> > I checkec in this patch to add a testcase for PR binutils/14481.
> 
> > --- a/binutils/ChangeLog
> > +++ b/binutils/ChangeLog
> > @@ -1,3 +1,14 @@
> > +2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>
> > +
> > +	PR binutils/14481
> > +	* Makefile.am (BFDTEST1_PROG): New.
> > +	(TEST_PROGS): Likewise.
> > +	(bfdtest1_DEPENDENCIES): Likewise.
> > +	(noinst_PROGRAMS): Add $(TEST_PROGS).
> > +	* Makefile.in: Regenerated.
> > +
> > +	* bfdtest1.c: New file.
> > +
> 
> > --- a/binutils/testsuite/ChangeLog
> > +++ b/binutils/testsuite/ChangeLog
> > @@ -1,3 +1,11 @@
> > +2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>
> > +
> > +	PR binutils/14481
> > +	* ar.exp (bfdtest1): New.
> > +	(long_filenames): Run bfdtest1.
> > +	(thin_archive): Likewise.
> > +	(thin_archive_with_nested): Likewise.
> 
> > diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
> > index 0caa847..c66c43e 100644
> > --- a/binutils/testsuite/binutils-all/ar.exp
> > +++ b/binutils/testsuite/binutils-all/ar.exp
> > @@ -27,6 +27,8 @@ if ![is_remote host] {
> >      }
> >  }
> >  
> > +set bfdtest1 [findfile $base_dir/bfdtest1]
> 
> This is not correct for cross-testing on a Windows host, and results in a
> bunch of ERRORs about the file not being found.  Here is a patch -- OK to
> commit?
> 
> Index: binutils/testsuite/binutils-all/ar.exp
> ===================================================================
> --- binutils/testsuite/binutils-all/ar.exp	(revision 390600)
> +++ binutils/testsuite/binutils-all/ar.exp	(working copy)
> @@ -27,7 +27,7 @@
>      }
>  }
>  
> -set bfdtest1 [findfile $base_dir/bfdtest1]
> +set bfdtest1 [findfile $base_dir/bfdtest1[exe_ext_host]]
>  
>  # send_user "Version [binutil_version $AR]"
>  
> Index: binutils/testsuite/lib/utils-lib.exp
> ===================================================================
> --- binutils/testsuite/lib/utils-lib.exp	(revision 390600)
> +++ binutils/testsuite/lib/utils-lib.exp	(working copy)
> @@ -125,8 +125,8 @@
>  }
>  
>  #
> -# exe_ext
> -#	Returns target executable extension, if any.
> +# exe_ext, exe_ext_host
> +#	Returns target/host executable extension, if any.
>  #
>  proc exe_ext {} {
>      if { [istarget *-*-mingw*] || [istarget *-*-cygwin*] } {
> @@ -136,6 +136,14 @@
>      }
>  }
>  
> +proc exe_ext_host {} {
> +    if { [ishost *-*-mingw*] || [ishost *-*-cygwin*] } {
> +        return ".exe"
> +    } else {
> +        return ""
> +    }
> +}
> +
>  # Copied and modified from gas.
>  
>  # run_dump_test FILE (optional:) EXTRA_OPTIONS
> 
> 
> Then, with that patch applied, the tests still FAIL on Windows hosts:
> 
>     FAIL: ar long file names (bfdtest1)
>     FAIL: ar thin archive (bfdtest1)
>     FAIL: ar thin archive with nested archive (bfdtest1)
> 
> The first two will go away (PASS) if I force (by copying it over) the
> unstripped executable binutils/.libs/bfdtest1.exe to be used instead of
> the stripped one -- huh.  Yet, the last of the three still FAILs.
> Debugging that is for another day.


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: PATCH: Add a testcase for PR binutils/14481
  2012-10-16 15:14 ` Thomas Schwinge
  2012-10-22 10:04   ` Thomas Schwinge
@ 2012-10-24 11:29   ` H.J. Lu
  2012-10-24 12:17     ` Thomas Schwinge
  1 sibling, 1 reply; 6+ messages in thread
From: H.J. Lu @ 2012-10-24 11:29 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: binutils

On Tue, Oct 16, 2012 at 8:14 AM, Thomas Schwinge
<thomas@codesourcery.com> wrote:
> Hi!
>
> On Thu, 16 Aug 2012 13:32:55 -0700, "H.J. Lu" <hongjiu.lu@intel.com> wrote:
>> I checkec in this patch to add a testcase for PR binutils/14481.
>
>> --- a/binutils/ChangeLog
>> +++ b/binutils/ChangeLog
>> @@ -1,3 +1,14 @@
>> +2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>
>> +
>> +     PR binutils/14481
>> +     * Makefile.am (BFDTEST1_PROG): New.
>> +     (TEST_PROGS): Likewise.
>> +     (bfdtest1_DEPENDENCIES): Likewise.
>> +     (noinst_PROGRAMS): Add $(TEST_PROGS).
>> +     * Makefile.in: Regenerated.
>> +
>> +     * bfdtest1.c: New file.
>> +
>
>> --- a/binutils/testsuite/ChangeLog
>> +++ b/binutils/testsuite/ChangeLog
>> @@ -1,3 +1,11 @@
>> +2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>
>> +
>> +     PR binutils/14481
>> +     * ar.exp (bfdtest1): New.
>> +     (long_filenames): Run bfdtest1.
>> +     (thin_archive): Likewise.
>> +     (thin_archive_with_nested): Likewise.
>
>> diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
>> index 0caa847..c66c43e 100644
>> --- a/binutils/testsuite/binutils-all/ar.exp
>> +++ b/binutils/testsuite/binutils-all/ar.exp
>> @@ -27,6 +27,8 @@ if ![is_remote host] {
>>      }
>>  }
>>
>> +set bfdtest1 [findfile $base_dir/bfdtest1]
>
> This is not correct for cross-testing on a Windows host, and results in a
> bunch of ERRORs about the file not being found.  Here is a patch -- OK to
> commit?

diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutil
s-all/ar.exp
index 05cc261..8b7629e 100644
--- a/binutils/testsuite/binutils-all/ar.exp
+++ b/binutils/testsuite/binutils-all/ar.exp
@@ -27,7 +27,7 @@ if ![is_remote host] {
     }
 }

-set bfdtest1 [findfile $base_dir/bfdtest1]
+set bfdtest1 $base_dir/bfdtest1

 # send_user "Version [binutil_version $AR]"

Can you try this instead?


-- 
H.J.

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

* Re: PATCH: Add a testcase for PR binutils/14481
  2012-10-24 11:29   ` H.J. Lu
@ 2012-10-24 12:17     ` Thomas Schwinge
  2012-10-24 12:30       ` H.J. Lu
  0 siblings, 1 reply; 6+ messages in thread
From: Thomas Schwinge @ 2012-10-24 12:17 UTC (permalink / raw)
  To: H.J. Lu; +Cc: binutils

[-- Attachment #1: Type: text/plain, Size: 2898 bytes --]

Hi!

On Wed, 24 Oct 2012 04:28:59 -0700, "H.J. Lu" <hjl.tools@gmail.com> wrote:
> On Tue, Oct 16, 2012 at 8:14 AM, Thomas Schwinge
> <thomas@codesourcery.com> wrote:
> > Hi!
> >
> > On Thu, 16 Aug 2012 13:32:55 -0700, "H.J. Lu" <hongjiu.lu@intel.com> wrote:
> >> I checkec in this patch to add a testcase for PR binutils/14481.
> >
> >> --- a/binutils/ChangeLog
> >> +++ b/binutils/ChangeLog
> >> @@ -1,3 +1,14 @@
> >> +2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>
> >> +
> >> +     PR binutils/14481
> >> +     * Makefile.am (BFDTEST1_PROG): New.
> >> +     (TEST_PROGS): Likewise.
> >> +     (bfdtest1_DEPENDENCIES): Likewise.
> >> +     (noinst_PROGRAMS): Add $(TEST_PROGS).
> >> +     * Makefile.in: Regenerated.
> >> +
> >> +     * bfdtest1.c: New file.
> >> +
> >
> >> --- a/binutils/testsuite/ChangeLog
> >> +++ b/binutils/testsuite/ChangeLog
> >> @@ -1,3 +1,11 @@
> >> +2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>
> >> +
> >> +     PR binutils/14481
> >> +     * ar.exp (bfdtest1): New.
> >> +     (long_filenames): Run bfdtest1.
> >> +     (thin_archive): Likewise.
> >> +     (thin_archive_with_nested): Likewise.
> >
> >> diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
> >> index 0caa847..c66c43e 100644
> >> --- a/binutils/testsuite/binutils-all/ar.exp
> >> +++ b/binutils/testsuite/binutils-all/ar.exp
> >> @@ -27,6 +27,8 @@ if ![is_remote host] {
> >>      }
> >>  }
> >>
> >> +set bfdtest1 [findfile $base_dir/bfdtest1]
> >
> > This is not correct for cross-testing on a Windows host, and results in a
> > bunch of ERRORs about the file not being found.  Here is a patch -- OK to
> > commit?
> 
> diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutil
> s-all/ar.exp
> index 05cc261..8b7629e 100644
> --- a/binutils/testsuite/binutils-all/ar.exp
> +++ b/binutils/testsuite/binutils-all/ar.exp
> @@ -27,7 +27,7 @@ if ![is_remote host] {
>      }
>  }
> 
> -set bfdtest1 [findfile $base_dir/bfdtest1]
> +set bfdtest1 $base_dir/bfdtest1
> 
>  # send_user "Version [binutil_version $AR]"
> 
> Can you try this instead?

Yes, that seems a reasonable change anyway (no need ever to transform
bfdtest1), and it also solves the Windows host issue: Windows allows
running executables without specifying the .exe suffix.


These problems remain:

| Then, with that patch applied, the tests still FAIL on Windows hosts:
| 
|     FAIL: ar long file names (bfdtest1)
|     FAIL: ar thin archive (bfdtest1)
|     FAIL: ar thin archive with nested archive (bfdtest1)
| 
| The first two will go away (PASS) if I force (by copying it over) the
| unstripped executable binutils/.libs/bfdtest1.exe to be used instead of
| the stripped one -- huh.  Yet, the last of the three still FAILs.
| Debugging that is for another day.


Grüße,
 Thomas

[-- Attachment #2: Type: application/pgp-signature, Size: 489 bytes --]

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

* Re: PATCH: Add a testcase for PR binutils/14481
  2012-10-24 12:17     ` Thomas Schwinge
@ 2012-10-24 12:30       ` H.J. Lu
  0 siblings, 0 replies; 6+ messages in thread
From: H.J. Lu @ 2012-10-24 12:30 UTC (permalink / raw)
  To: Thomas Schwinge; +Cc: binutils

On Wed, Oct 24, 2012 at 5:17 AM, Thomas Schwinge
<thomas@codesourcery.com> wrote:
> Hi!
>
> On Wed, 24 Oct 2012 04:28:59 -0700, "H.J. Lu" <hjl.tools@gmail.com> wrote:
>> On Tue, Oct 16, 2012 at 8:14 AM, Thomas Schwinge
>> <thomas@codesourcery.com> wrote:
>> > Hi!
>> >
>> > On Thu, 16 Aug 2012 13:32:55 -0700, "H.J. Lu" <hongjiu.lu@intel.com> wrote:
>> >> I checkec in this patch to add a testcase for PR binutils/14481.
>> >
>> >> --- a/binutils/ChangeLog
>> >> +++ b/binutils/ChangeLog
>> >> @@ -1,3 +1,14 @@
>> >> +2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>
>> >> +
>> >> +     PR binutils/14481
>> >> +     * Makefile.am (BFDTEST1_PROG): New.
>> >> +     (TEST_PROGS): Likewise.
>> >> +     (bfdtest1_DEPENDENCIES): Likewise.
>> >> +     (noinst_PROGRAMS): Add $(TEST_PROGS).
>> >> +     * Makefile.in: Regenerated.
>> >> +
>> >> +     * bfdtest1.c: New file.
>> >> +
>> >
>> >> --- a/binutils/testsuite/ChangeLog
>> >> +++ b/binutils/testsuite/ChangeLog
>> >> @@ -1,3 +1,11 @@
>> >> +2012-08-16  H.J. Lu  <hongjiu.lu@intel.com>
>> >> +
>> >> +     PR binutils/14481
>> >> +     * ar.exp (bfdtest1): New.
>> >> +     (long_filenames): Run bfdtest1.
>> >> +     (thin_archive): Likewise.
>> >> +     (thin_archive_with_nested): Likewise.
>> >
>> >> diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
>> >> index 0caa847..c66c43e 100644
>> >> --- a/binutils/testsuite/binutils-all/ar.exp
>> >> +++ b/binutils/testsuite/binutils-all/ar.exp
>> >> @@ -27,6 +27,8 @@ if ![is_remote host] {
>> >>      }
>> >>  }
>> >>
>> >> +set bfdtest1 [findfile $base_dir/bfdtest1]
>> >
>> > This is not correct for cross-testing on a Windows host, and results in a
>> > bunch of ERRORs about the file not being found.  Here is a patch -- OK to
>> > commit?
>>
>> diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutil
>> s-all/ar.exp
>> index 05cc261..8b7629e 100644
>> --- a/binutils/testsuite/binutils-all/ar.exp
>> +++ b/binutils/testsuite/binutils-all/ar.exp
>> @@ -27,7 +27,7 @@ if ![is_remote host] {
>>      }
>>  }
>>
>> -set bfdtest1 [findfile $base_dir/bfdtest1]
>> +set bfdtest1 $base_dir/bfdtest1
>>
>>  # send_user "Version [binutil_version $AR]"
>>
>> Can you try this instead?
>
> Yes, that seems a reasonable change anyway (no need ever to transform
> bfdtest1), and it also solves the Windows host issue: Windows allows
> running executables without specifying the .exe suffix.
>

I checked in

diff --git a/binutils/testsuite/ChangeLog b/binutils/testsuite/ChangeLog
index 6514b1a..6745baa 100644
--- a/binutils/testsuite/ChangeLog
+++ b/binutils/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2012-10-24  H.J. Lu  <hongjiu.lu@intel.com>
+
+	* binutils-all/ar.exp (bfdtest1): Remove findfile.
+
 2012-10-21  H.J. Lu  <hongjiu.lu@intel.com>

 	* binutils-all/dw2-1.W: Updated.
diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutil
s-all/ar.exp
index 05cc261..8b7629e 100644
--- a/binutils/testsuite/binutils-all/ar.exp
+++ b/binutils/testsuite/binutils-all/ar.exp
@@ -27,7 +27,7 @@ if ![is_remote host] {
     }
 }

-set bfdtest1 [findfile $base_dir/bfdtest1]
+set bfdtest1 $base_dir/bfdtest1

 # send_user "Version [binutil_version $AR]"



> These problems remain:
>
> | Then, with that patch applied, the tests still FAIL on Windows hosts:
> |
> |     FAIL: ar long file names (bfdtest1)
> |     FAIL: ar thin archive (bfdtest1)
> |     FAIL: ar thin archive with nested archive (bfdtest1)
> |
> | The first two will go away (PASS) if I force (by copying it over) the
> | unstripped executable binutils/.libs/bfdtest1.exe to be used instead of
> | the stripped one -- huh.  Yet, the last of the three still FAILs.
> | Debugging that is for another day.
>

Those are real Windows target problems.


-- 
H.J.

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

end of thread, other threads:[~2012-10-24 12:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-16 20:35 PATCH: Add a testcase for PR binutils/14481 H.J. Lu
2012-10-16 15:14 ` Thomas Schwinge
2012-10-22 10:04   ` Thomas Schwinge
2012-10-24 11:29   ` H.J. Lu
2012-10-24 12:17     ` Thomas Schwinge
2012-10-24 12:30       ` H.J. Lu

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).