Blob Blame Raw
# Copyright (c) 2015 Jakub Cajka <>, Jan Chaloupka <>
# This file is distributed under the terms of GNU GPL license version 3, or
# any later version.

# This file contains macros for building projects in golang for packages
# with golang compiler or gcc-go compiler based on an architecture.

# Define commands for building
# BUILD_ID can be generated for golang build no matter of debuginfo

%gobuild(o:) %{expand:
%global _dwz_low_mem_die_limit 0
%ifnarch ppc64
go build -buildmode pie -compiler gc -tags=rpm_crashtraceback -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**};
go build -compiler gc -tags=rpm_crashtraceback -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x %{?**};

# Define commands for testing
%gotest() go test -buildmode pie -compiler gc -ldflags "${LDFLAGS:-} -extldflags '%__global_ldflags %{?__golang_extldflags}'" %{?**};