Skip to content

Commit

Permalink
fix pie build for s390x arch
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanotorresi committed Dec 20, 2024
1 parent 3599459 commit 3b2a937
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Source: %{name}-%{version}.tar.gz
Source1: vendor.tar.gz
ExclusiveArch: aarch64 x86_64 ppc64le s390x
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: golang(API) >= 1.20
BuildRequires: golang(API) >= 1.23
Provides: sap_host_exporter = %{version}-%{release}
Provides: prometheus(sap_host_exporter) = %{version}-%{release}

Expand All @@ -40,8 +40,11 @@ to collect data about SAP systems like NetWeaver and S4/HANA.
%define shortname sap_host_exporter

%build

export CGO_ENABLED=0
%ifarch s390x
export CGO_ENABLED=1
%else
export CGO_ENABLED=0
%endif
go build -mod=vendor \
-buildmode=pie \
-ldflags="-s -w -X main.version=%{version}" \
Expand Down

0 comments on commit 3b2a937

Please sign in to comment.