From 14f4eccb5fd0fcf6a68f5088737bb7071ef5de03 Mon Sep 17 00:00:00 2001 From: lyn1001 Date: Thu, 9 Feb 2023 17:46:56 +0800 Subject: [PATCH] set flags for BIND_NOW (cherry picked from commit 197fa75bf68a753386f0a2c598948408dbf7cfac) --- pushgateway.spec | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pushgateway.spec b/pushgateway.spec index 24691db..edb4f30 100644 --- a/pushgateway.spec +++ b/pushgateway.spec @@ -8,7 +8,7 @@ Name: pushgateway Version: 1.4.1 -Release: 4 +Release: 5 Summary: Prometheus pushgateway. License: ASL 2.0 URL: https://github.com/prometheus/%{name} @@ -37,7 +37,7 @@ The Pushgateway then exposes these metrics to Prometheus. %build mkdir -p $(pwd)/bin export GOBIN=$(pwd)/bin -go build -mod=vendor -buildmode=pie -ldflags "-s -w" -o bin ./ ... +go build -mod=vendor -buildmode=pie -ldflags "-s -w -linkmode=external -extldflags '-Wl,-z,relro -Wl,-z,now' " -o bin ./ ... %install mkdir -p %{buildroot}%{_bindir} @@ -70,6 +70,9 @@ exit 0 %dir %attr(755, prometheus, prometheus)%{_sharedstatedir}/prometheus %changelog +* Thu Feb 09 2023 xu_ping - 1.4.1-5 +- set flags for BIND_NOW + * Thu Feb 09 2023 xu_ping - 1.4.1-4 - set flags for build