| |
@@ -31,6 +31,9 @@
|
| |
#
|
| |
%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}
|
| |
|
| |
+ %cgo_set_build_flags export CGO_CFLAGS="%{build_cflags}" CGO_CPPFLAGS="%{build_cxxflags}" CGO_FFLAGS="%{build_fflags}" CGO_LDFLAGS="%{build_ldflags}"
|
| |
+
|
| |
+
|
| |
# Turn off Go modules
|
| |
%gomodulesmode GO111MODULE=off
|
| |
|
| |
@@ -43,6 +46,7 @@
|
| |
%undefine _auto_set_build_flags
|
| |
# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12
|
| |
%global _dwz_low_mem_die_limit 0
|
| |
+ %cgo_set_build_flags
|
| |
%{?gobuilddir:GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} %{?gomodulesmode} \\
|
| |
go build %{gobuildflags} %{?**};
|
| |
}
|
| |
@@ -53,5 +57,6 @@
|
| |
%gotestextldflags %{build_ldflags} %{?__golang_extldflags}
|
| |
%gotest() %{expand:
|
| |
%undefine _auto_set_build_flags
|
| |
+ %cgo_set_build_flags
|
| |
%{?gomodulesmode} go test %{gotestflags} -ldflags "${LDFLAGS:-} %{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**};
|
| |
}
|
| |
As promised, here is my PR to set CGO to use Fedoa's build flags. I tested this with golang-github-containerd-btrfs, but it could probably use some more extended testing.