| |
@@ -29,7 +29,11 @@
|
| |
#
|
| |
# %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 '%__global_ldflags %{?__golang_extldflags}'\\" -a -v -x}
|
| |
+
|
| |
+ # Remove unsupported LDFLAGS
|
| |
+ %golang_filter_ldflags %(echo "$LDFLAGS" | sed -e 's/-Wl,-z,relro//')
|
| |
+
|
| |
+ %gobuildflags() %{expand:%{gocompilerflags} -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "%{golang_filter_ldflags} %{?currentgoldflags} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -compressdwarf=false -extldflags '%__global_ldflags %{?__golang_extldflags}'" -a -v -x}
|
| |
|
| |
# Turn off Go modules
|
| |
%gomodulesmode GO111MODULE=off
|
| |
@@ -47,4 +51,4 @@
|
| |
# Define commands for testing
|
| |
%gotestflags %{gocompilerflags}
|
| |
%gotestextldflags %__global_ldflags %{?__golang_extldflags}
|
| |
- %gotest() %{?gomodulesmode} go test %{gotestflags} -ldflags "${LDFLAGS:-} %{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**};
|
| |
+ %gotest() %{?gomodulesmode} go test %{gotestflags} -ldflags "%{golang_filter_ldflags} %{?currentgoldflags} -extldflags '%{gotestextldflags}'" %{?**};
|
| |
The LDFLAGS environment variable is now set for every RPM build, but in
Fedora it contains one flag that is not supported by the golang linker.
Fix this by filtering out the unsupported flag.