From 50b3fccce383b7771852b6453562a2a4a2b8f30a Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Feb 28 2022 14:12:16 +0000 Subject: rpm/macros.d: use linkmode=external The golang linker does not support a variety of flags and features, in particular it does not allow us to set add a .note.package section. Use linkmode=external so that it works out of the box. --- diff --git a/rpm/macros.d/macros.go-compilers-golang b/rpm/macros.d/macros.go-compilers-golang index c88e550..74428a3 100644 --- a/rpm/macros.d/macros.go-compilers-golang +++ b/rpm/macros.d/macros.go-compilers-golang @@ -29,7 +29,7 @@ # # %make GOBUILDFLAGS="%gobuildflags" # -%gobuildflags() %{expand:%{gocompilerflags} -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} %{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -compressdwarf=false -extldflags '%{build_ldflags} %{?__golang_extldflags}'" -a -v -x} +%gobuildflags() %{expand:%{gocompilerflags} -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} %{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -compressdwarf=false -linkmode=external -extldflags '%{build_ldflags} %{?__golang_extldflags}'" -a -v -x} # Turn off Go modules %gomodulesmode GO111MODULE=off