Bug#873929: gcc7: Enable libgo tests and rebuilds with make -C
Source: gcc-7
Version: 7.2.0-2
Severity: important
Tags: patch
Hello,
Currently the libgo tests are not run due to a bug in libgo/Makefile.am
(and Makefile.in). This error is found on all architectures where the
testsuite is enabled. The attached patch fixes this bug as well as
enables rebuilds with
make -C build/<arch-triple>/libgo clean;
<hack on>;
make -C build/<arch-triple>/libgo;
by adding more entries to the CLEANFILES target.
(The GOBENCH = entry is due to a trailing white space in the original
file)
On amd64:
tail build/x86_64-linux-gnu/libgo/libgo.sum
=== libgo Summary ===
# of expected passes 145
As a side note many go tests are not run:
tail build/gcc/testsuite/go/go.sum
=== go Summary ===
# of expected passes 486
# of untested testcases 834
Looking at build/x86_64-linux-gnu/libgo/libgo.log one finds:
ia3232309.c:2:6: error: size of array 'dummy' is negative
ia3232309.c:4:41: error: '__i386__' undeclared here (not in a
function); did you mean '__k8__'?
However, that problem is the subject of another bug report.
Thanks!
Index: gcc-7-7.2.0/src/libgo/Makefile.am
===================================================================
--- gcc-7-7.2.0.orig/src/libgo/Makefile.am
+++ gcc-7-7.2.0/src/libgo/Makefile.am
@@ -930,7 +930,7 @@ BUILDGOX = \
$(SHELL) $(srcdir)/mvifdiff.sh $@.tmp `echo $@ | sed -e 's/s-gox/gox/'`
GOTESTFLAGS =
-GOBENCH =
+GOBENCH =
# Check a package.
CHECK = \
@@ -955,6 +955,7 @@ CHECK = \
echo "$$RUNTESTFLAGS" | grep -q "$${MULTILIBDIR\#/*}" || run_check=; \
esac; \
if test "$$run_check" = "yes"; then \
+ if test "$(USE_DEJAGNU)" = "yes"; then \
$(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
elif test "$(GOBENCH)" != ""; then \
$(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \
@@ -969,6 +970,7 @@ CHECK = \
echo "FAIL: $(@D)" > $@-testsum; \
exit 1; \
fi; \
+ fi; \
fi
# Build all packages before checking any.
@@ -1421,7 +1423,9 @@ mostlyclean-local:
find . -name '*-testsum' -print | xargs rm -f
find . -name '*-testlog' -print | xargs rm -f
-CLEANFILES = *.go *.gox goc2c *.c s-version libgo.sum libgo.log
+CLEANFILES = *.go *.gox goc2c *.c s-* libgo.sum libgo.log \
+ *.dep */*.dep */*/*.dep */*/*/*.dep */*/*.dep */*/*/*/*.dep \
+ */*/*/*/*/*.dep
clean-local:
find . -name '*.la' -print | xargs $(LIBTOOL) --mode=clean rm -f
Index: gcc-7-7.2.0/src/libgo/Makefile.in
===================================================================
--- gcc-7-7.2.0.orig/src/libgo/Makefile.in
+++ gcc-7-7.2.0/src/libgo/Makefile.in
@@ -1111,6 +1111,7 @@ CHECK = \
echo "$$RUNTESTFLAGS" | grep -q "$${MULTILIBDIR\#/*}" || run_check=; \
esac; \
if test "$$run_check" = "yes"; then \
+ if test "$(USE_DEJAGNU)" = "yes"; then \
$(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --dejagnu=yes --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --testname="$(@D)" $(GOTESTFLAGS); \
elif test "$(GOBENCH)" != ""; then \
$(SHELL) $(srcdir)/testsuite/gotest --goarch=$(GOARCH) --goos=$(GOOS) --basedir=$(srcdir) --srcdir=$(srcdir)/go/$(@D) --pkgpath="$(@D)" --pkgfiles="$$files" --bench="$(GOBENCH)" $(GOTESTFLAGS); \
@@ -1125,6 +1126,7 @@ CHECK = \
echo "FAIL: $(@D)" > $@-testsum; \
exit 1; \
fi; \
+ fi; \
fi
@@ -1345,7 +1347,10 @@ TEST_PACKAGES = \
unicode/utf8/check
MOSTLYCLEAN_FILES = libgo.head libgo.sum.sep libgo.log.sep
-CLEANFILES = *.go *.gox goc2c *.c s-version libgo.sum libgo.log
+CLEANFILES = *.go *.gox goc2c *.c s-* libgo.sum libgo.log \
+ *.dep */*.dep */*/*.dep */*/*/*.dep */*/*.dep */*/*/*/*.dep \
+ */*/*/*/*/*.dep
+
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
Reply to: