Patchwork libgo patch committed: Use DejaGNU when testing a cross-compiler

login
register
mail settings
Submitter Ian Taylor
Date Feb. 5, 2013, 10:22 p.m.
Message ID <mcrr4ku8kpu.fsf@google.com>
Download mbox | patch
Permalink /patch/218454/
State New
Headers show

Comments

Ian Taylor - Feb. 5, 2013, 10:22 p.m.
This patch to libgo uses DejaGNU when testing a cross-compiler.  The
shell script is simpler but only works for a native configuration.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.  This should fix PR 56017.

Ian
Andreas Schwab - Feb. 7, 2013, 5:11 p.m.
Ian Lance Taylor <iant@google.com> writes:

> +dnl Test whether we need to use DejaGNU or whether we can use the
> +dnl simpler gotest approach.  We can only use gotest for a native
> +dnl build.
> +USE_DEJAGNU=no
> +case ${host} in
> +  *-*-rtems*) USE_DEJAGNU=yes ;;
> +  ${target}) ;;

This is a target library, so you need to check build != host to detect
building with a cross-compiler.

Andreas.
Ian Taylor - Feb. 7, 2013, 6:02 p.m.
On Thu, Feb 7, 2013 at 9:11 AM, Andreas Schwab <schwab@suse.de> wrote:
> Ian Lance Taylor <iant@google.com> writes:
>
>> +dnl Test whether we need to use DejaGNU or whether we can use the
>> +dnl simpler gotest approach.  We can only use gotest for a native
>> +dnl build.
>> +USE_DEJAGNU=no
>> +case ${host} in
>> +  *-*-rtems*) USE_DEJAGNU=yes ;;
>> +  ${target}) ;;
>
> This is a target library, so you need to check build != host to detect
> building with a cross-compiler.

Argh.  Thanks.  Fixed like so.

Ian

Patch

diff -r 27e1a46c9cc2 libgo/Makefile.am
--- a/libgo/Makefile.am	Mon Feb 04 17:10:28 2013 -0800
+++ b/libgo/Makefile.am	Tue Feb 05 14:13:17 2013 -0800
@@ -1991,12 +1991,6 @@ 
 	files=`echo $^ | sed -e 's/[^ ]*\.gox//g'`; \
 	$(LTGOCOMPILE) -I . -c -fgo-pkgpath=`echo $@ | sed -e 's/.lo$$//' -e 's/-go$$//'` -o $@ $$files
 
-if LIBGO_IS_RTEMS
-use_dejagnu = yes
-else
-use_dejagnu = no
-endif
-
 GOTESTFLAGS =
 
 # Check a package.
@@ -2015,7 +2009,7 @@ 
 	export LD_LIBRARY_PATH; \
 	$(MKDIR_P) $(@D); \
 	rm -f $@-testsum $@-testlog; \
-	if test "$(use_dejagnu)" = "yes"; then \
+	if test "$(USE_DEJAGNU)" = "yes"; then \
 	  $(SHELL) $(srcdir)/testsuite/gotest --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" --testname="$(@D)" --goarch="$(GOARCH)" $(GOTESTFLAGS) $(go_$(subst /,_,$(@D))_test_files); \
 	else \
 	  if $(SHELL) $(srcdir)/testsuite/gotest --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$(go_$(subst /,_,$(@D))_files)" --goarch="$(GOARCH)" $(GOTESTFLAGS) $(go_$(subst /,_,$(@D))_test_files) >>$@-testlog 2>&1; then \
diff -r 27e1a46c9cc2 libgo/configure.ac
--- a/libgo/configure.ac	Mon Feb 04 17:10:28 2013 -0800
+++ b/libgo/configure.ac	Tue Feb 05 14:13:17 2013 -0800
@@ -156,6 +156,17 @@ 
 AM_CONDITIONAL(LIBGO_IS_SOLARIS, test $is_solaris = yes)
 AC_SUBST(GOOS)
 
+dnl Test whether we need to use DejaGNU or whether we can use the
+dnl simpler gotest approach.  We can only use gotest for a native
+dnl build.
+USE_DEJAGNU=no
+case ${host} in
+  *-*-rtems*) USE_DEJAGNU=yes ;;
+  ${target}) ;;
+  *) USE_DEJAGNU=yes ;;
+esac
+AC_SUBST(USE_DEJAGNU)
+
 dnl N.B. Keep in sync with gcc/testsuite/go.test/go-test.exp (go-set-goarch).
 is_386=no
 is_alpha=no