nim / rpms / go-compilers

Forked from rpms/go-compilers 6 years ago
Clone
5562fc0
# Copyright (c) 2015 Jakub Cajka <jcajka@redhat.com>, Jan Chaloupka <jchaloup@redhat.com>
5562fc0
# This file is distributed under the terms of GNU GPL license version 3, or
5562fc0
# any later version.
5562fc0
5562fc0
# This file contains macros for building projects in golang for packages
5562fc0
# with golang compiler or gcc-go compiler based on an architecture.
5562fc0
5562fc0
# Define commands for building
5562fc0
# BUILD_ID can be generated for golang build no matter of debuginfo
e422df4
e422df4
%gobuild(o:) %{expand:
e422df4
# https://bugzilla.redhat.com/show_bug.cgi?id=995136#c12
e422df4
%global _dwz_low_mem_die_limit 0
e422df4
%ifnarch ppc64
e422df4
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 %{?**};
e422df4
%else
e422df4
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 %{?**};
e422df4
%endif}
5562fc0
5562fc0
# Define commands for testing
28e047c
%gotest() go test -buildmode pie -compiler gc -ldflags "${LDFLAGS:-} -extldflags '%__global_ldflags %{?__golang_extldflags}'" %{?**};