From af3f94ce646201914a62145821630cc232c1d014 Mon Sep 17 00:00:00 2001 From: "Paul E. Murphy" Date: Wed, 14 Feb 2024 16:42:27 -0600 Subject: [PATCH] cmd/cgo/internal/test: disable issue8694 and issue9510 on ppc64x with internal linking These link in libgcc functions which require more advanced handling of small toc relocations. The internal linker is not capable of placing these functions to ensure they are always resolvable. Change-Id: Idd4a0264bfbbd7016472120dc4bee84814e8c2eb Reviewed-on: https://go-review.googlesource.com/c/go/+/564235 Run-TryBot: Paul Murphy Reviewed-by: Than McIntosh Reviewed-by: Lynn Boger Reviewed-by: Cherry Mui TryBot-Result: Gopher Robot LUCI-TryBot-Result: Go LUCI --- .../cgo_stubs_ppc64x_internal_linking_test.go | 15 +++++++++++++++ src/cmd/cgo/internal/test/issue8694.go | 2 +- src/cmd/cgo/internal/test/issue9510.go | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 src/cmd/cgo/internal/test/cgo_stubs_ppc64x_internal_linking_test.go diff --git a/src/cmd/cgo/internal/test/cgo_stubs_ppc64x_internal_linking_test.go b/src/cmd/cgo/internal/test/cgo_stubs_ppc64x_internal_linking_test.go new file mode 100644 index 0000000000..015a62ccbe --- /dev/null +++ b/src/cmd/cgo/internal/test/cgo_stubs_ppc64x_internal_linking_test.go @@ -0,0 +1,15 @@ +// Copyright 2024 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +//go:build (ppc64 || ppc64le) && internal + +package cgotest + +import "testing" + +// If gcc is used, and linking internally, __mulsc3 and __muldc3 +// will be linked in from libgcc which make several R_PPC64_TOC16_DS +// relocations which may not be resolvable with the internal linker. +func test8694(t *testing.T) { t.Skip("not supported on ppc64/ppc64le with internal linking") } +func test9510(t *testing.T) { t.Skip("not supported on ppc64/ppc64le with internal linking") } diff --git a/src/cmd/cgo/internal/test/issue8694.go b/src/cmd/cgo/internal/test/issue8694.go index 3b8f065d27..117547cfa4 100644 --- a/src/cmd/cgo/internal/test/issue8694.go +++ b/src/cmd/cgo/internal/test/issue8694.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build !android +//go:build !android && !((ppc64 || ppc64le) && internal) package cgotest diff --git a/src/cmd/cgo/internal/test/issue9510.go b/src/cmd/cgo/internal/test/issue9510.go index 7f0aff4fe4..c000a047f6 100644 --- a/src/cmd/cgo/internal/test/issue9510.go +++ b/src/cmd/cgo/internal/test/issue9510.go @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -//go:build cgo +//go:build cgo && !((ppc64 || ppc64le) && internal) // Test that we can link together two different cgo packages that both // use the same libgcc function. -- 2.48.1