From 2a208bc2570b07b64deb1d549332e5d981c867bc Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 22 Jun 2017 14:27:09 +0000 Subject: [PATCH] runtime: don't build test files that use SetCgoTraceback for gccgo The gofrontend doesn't support the runtime.SetCgoTraceback function, which is specifically for handling mixed Go and C tracebacks. Use a build tag to avoid compiling the runtime/testdata/testprogcgo files that refer to SetCgoTraceback. These files are not currently compiled anyhow, but they will be with a future gotools patch. Reviewed-on: https://go-review.googlesource.com/46452 From-SVN: r249556 --- gcc/go/gofrontend/MERGE | 2 +- libgo/go/runtime/testdata/testprogcgo/pprof.go | 2 ++ libgo/go/runtime/testdata/testprogcgo/raceprof.go | 1 + libgo/go/runtime/testdata/testprogcgo/threadpprof.go | 1 + libgo/go/runtime/testdata/testprogcgo/traceback.go | 2 ++ libgo/go/runtime/testdata/testprogcgo/tracebackctxt.go | 2 ++ libgo/go/runtime/testdata/testprogcgo/tracebackctxt_c.c | 2 ++ 7 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index d9839390c5b..42c8f853f7e 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -bbc4f30a027ee09475d08aa4aeed1f2f7067e2e9 +e017833e4ce4a3bc3ba02eac4351b15c86157ec0 The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/libgo/go/runtime/testdata/testprogcgo/pprof.go b/libgo/go/runtime/testdata/testprogcgo/pprof.go index 4460b9304e5..c4fde0251ae 100644 --- a/libgo/go/runtime/testdata/testprogcgo/pprof.go +++ b/libgo/go/runtime/testdata/testprogcgo/pprof.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build !gccgo + package main // Run a slow C function saving a CPU profile. diff --git a/libgo/go/runtime/testdata/testprogcgo/raceprof.go b/libgo/go/runtime/testdata/testprogcgo/raceprof.go index fe624c541fd..466a367873c 100644 --- a/libgo/go/runtime/testdata/testprogcgo/raceprof.go +++ b/libgo/go/runtime/testdata/testprogcgo/raceprof.go @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. // +build linux,amd64 +// +build !gccgo package main diff --git a/libgo/go/runtime/testdata/testprogcgo/threadpprof.go b/libgo/go/runtime/testdata/testprogcgo/threadpprof.go index 3da82961b9b..bec4ef50d76 100644 --- a/libgo/go/runtime/testdata/testprogcgo/threadpprof.go +++ b/libgo/go/runtime/testdata/testprogcgo/threadpprof.go @@ -3,6 +3,7 @@ // license that can be found in the LICENSE file. // +build !plan9,!windows +// +build !gccgo package main diff --git a/libgo/go/runtime/testdata/testprogcgo/traceback.go b/libgo/go/runtime/testdata/testprogcgo/traceback.go index 2a023f66cae..d21990e5531 100644 --- a/libgo/go/runtime/testdata/testprogcgo/traceback.go +++ b/libgo/go/runtime/testdata/testprogcgo/traceback.go @@ -2,6 +2,8 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// +build !gccgo + package main // This program will crash. diff --git a/libgo/go/runtime/testdata/testprogcgo/tracebackctxt.go b/libgo/go/runtime/testdata/testprogcgo/tracebackctxt.go index 51fa4ad25c3..3940a77d4f9 100644 --- a/libgo/go/runtime/testdata/testprogcgo/tracebackctxt.go +++ b/libgo/go/runtime/testdata/testprogcgo/tracebackctxt.go @@ -4,6 +4,8 @@ // The __attribute__((weak)) used below doesn't seem to work on Windows. +// +build !gccgo + package main // Test the context argument to SetCgoTraceback. diff --git a/libgo/go/runtime/testdata/testprogcgo/tracebackctxt_c.c b/libgo/go/runtime/testdata/testprogcgo/tracebackctxt_c.c index 900cada0d3d..f02b7ca3924 100644 --- a/libgo/go/runtime/testdata/testprogcgo/tracebackctxt_c.c +++ b/libgo/go/runtime/testdata/testprogcgo/tracebackctxt_c.c @@ -5,6 +5,8 @@ // The C definitions for tracebackctxt.go. That file uses //export so // it can't put function definitions in the "C" import comment. +// +build !gccgo + #include #include -- 2.30.2