diff mbox series

libgo patch committed: Better error messages for unsupported target

Message ID CAOyqgcX+aYLfRgKBExu3vZGvfjSTjsn5vU0ss72wTWNMSa=sLg@mail.gmail.com
State New
Headers show
Series libgo patch committed: Better error messages for unsupported target | expand

Commit Message

Ian Lance Taylor Feb. 2, 2024, 11:10 p.m. UTC
This libgo patch generates better error messages then the Go GOARCH
and GOOS values can't be determined from the target.  This indicates
that the target is not supported.  This is for GCC PR 113530.
Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian
cfc6d9ae8143cf0e903384bc63e8d659ca1c9fe7
diff mbox series

Patch

diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index 18281c6cd1e..429904a2b8f 100644
--- a/gcc/go/gofrontend/MERGE
+++ b/gcc/go/gofrontend/MERGE
@@ -1,4 +1,4 @@ 
-7ab229670f7dad1d79f33929f9a4f8e6e4a71526
+8c056e335cecec67d1d223a329b7ba4dac778a65
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
diff --git a/libgo/Makefile.am b/libgo/Makefile.am
index c95dc2106cd..3eccadbac67 100644
--- a/libgo/Makefile.am
+++ b/libgo/Makefile.am
@@ -497,6 +497,10 @@  s-version: Makefile
 zgoarch.go: s-zgoarch; @true
 s-zgoarch: Makefile goarch.sh
 	rm -f zgoarch.go.tmp
+	if ! $(SHELL) $(srcdir)/goarch.sh $(GOARCH) family >/dev/null 2>/dev/null;  then \
+	  $(SHELL) $(srcdir)/goarch.sh $(GOARCH) family; \
+	  exit 1; \
+	fi
 	echo "package goarch" > zgoarch.go.tmp
 	echo >> zgoarch.go.tmp
 	echo 'const GOARCH = "'$(GOARCH)'"' >> zgoarch.go.tmp
diff --git a/libgo/configure.ac b/libgo/configure.ac
index e8d66f8415d..22158ac7f5d 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -209,6 +209,10 @@  AM_CONDITIONAL(LIBGO_IS_BSD, test $is_darwin = yes -o $is_dragonfly = yes -o $is
 AC_SUBST(GOOS)
 AC_SUBST(ALLGOOS)
 
+if test "${GOOS}" = "unknown"; then
+   AC_MSG_ERROR("could not determine GOOS from ${host}")
+fi
+
 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.
@@ -376,6 +380,10 @@  AC_SUBST(GOARCH)
 AC_SUBST(ALLGOARCH)
 AC_SUBST(ALLGOARCHFAMILY)
 
+if test "${GOARCH}" = "unknown"; then
+   AC_MSG_ERROR("could not determine GOARCH from ${host}")
+fi
+
 AM_CONDITIONAL(LIBGO_IS_X86, test "$GOARCH" = "386" -o "$GOARCH" = "amd64" -o "$GOARCH" = "amd64p32")
 
 FUNCTION_DESCRIPTORS=false