diff --git a/SOURCES/rhbz1955032.patch b/SOURCES/rhbz1955032.patch new file mode 100644 index 0000000..c7deea7 --- /dev/null +++ b/SOURCES/rhbz1955032.patch @@ -0,0 +1,37 @@ +From 983dea90c169930e35721232afe39fd4e3fbe4a6 Mon Sep 17 00:00:00 2001 +From: Paul E. Murphy +Date: Tue, 27 Apr 2021 15:05:51 -0500 +Subject: [PATCH] cmd/link: disable plugin support if cgo is disabled + +Functional plugin support requires cgo to be enabled. Disable +it if the environment has disabled cgo. + +This prevents unexpected linker failures when linking large +binaries with cgo disabled which use the plugin package. + +Fixes #45564 + +Change-Id: Ib71f0e089f7373b7b3e3cd53da3612291e7bc473 +Reviewed-on: https://go-review.googlesource.com/c/go/+/314449 +Run-TryBot: Paul Murphy +Reviewed-by: Cherry Zhang +TryBot-Result: Go Bot +Trust: Lynn Boger +--- + +diff --git a/src/cmd/link/internal/ld/lib.go b/src/cmd/link/internal/ld/lib.go +index adf1669..043bf5a 100644 +--- a/src/cmd/link/internal/ld/lib.go ++++ b/src/cmd/link/internal/ld/lib.go +@@ -539,7 +539,10 @@ + // up symbol by name may not get expected result. + + iscgo = ctxt.LibraryByPkg["runtime/cgo"] != nil +- ctxt.canUsePlugins = ctxt.LibraryByPkg["plugin"] != nil ++ ++ // Plugins a require cgo support to function. Similarly, plugins may require additional ++ // internal linker support on some platforms which may not be implemented. ++ ctxt.canUsePlugins = ctxt.LibraryByPkg["plugin"] != nil && iscgo + + // We now have enough information to determine the link mode. + determineLinkMode(ctxt) diff --git a/SPECS/golang.spec b/SPECS/golang.spec index 0486f7b..c806a0d 100644 --- a/SPECS/golang.spec +++ b/SPECS/golang.spec @@ -101,7 +101,7 @@ Name: golang Version: %{go_version} -Release: 1%{?dist} +Release: 2%{?dist} Summary: The Go Programming Language # source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain License: BSD and Public Domain @@ -147,6 +147,14 @@ Patch223: golang-1.15-warnCN.patch Patch1939923: skip_test_rhbz1939923.patch +# cmd/link: disable plugin support if cgo is disabled +# Functional plugin support requires cgo to be enabled. Disable +# it if the environment has disabled cgo. +# This prevents unexpected linker failures when linking large +# binaries with cgo disabled which use the plugin package. +# https://go-review.googlesource.com/c/go/+/314449/ +Patch1955032: rhbz1955032.patch + # Having documentation separate was broken Obsoletes: %{name}-docs < 1.1-4 @@ -244,6 +252,8 @@ Requires: %{name} = %{version}-%{release} %patch1939923 -p1 +%patch1955032 -p1 + cp %{SOURCE1} ./src/runtime/ %build @@ -510,6 +520,9 @@ cd .. %endif %changelog +* Thu Apr 29 2021 Alejandro Sáez - 1.16.1-2 +- Resolves: rhbz#1955032 + * Wed Mar 17 2021 Alejandro Sáez - 1.16.1-1 - Rebase to go-1.16.1-2-openssl-fips - Resolves: rhbz#1938071